Module: services/dynamic/json-path

Methods

(async) fetch(attrs) → {object}

Request data from an upstream API, transform it to JSON 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 transformed to JSON

url string

URL to request

httpErrors 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

Source:
Returns:

Parsed response

Type
object