Class: BaseYamlService

(abstract) core/base-service/base-yaml~BaseYamlService()

Services which query a YAML endpoint should extend BaseYamlService

Constructor

(abstract) new BaseYamlService()

Source:

Methods

(async) _requestYaml(attrs) → {object}

Request data from an upstream API serving YAML, parse it and validate against a schema

Parameters:
Name Type Description
attrs object

Refer to individual attrs

Properties
Name Type Attributes Default Description
schema Joi

Joi schema to validate the response against

url string

URL to request

options object <optional>
{}

Options to pass to request. See documentation

errorMessages object <optional>
{}

Key-value map of status codes and custom error messages e.g: { 404: 'package not found' }. This can be used to extend or override the default

encoding object <optional>
'utf8'

Character encoding

Source:
See:
Returns:

Parsed response

Type
object