Files
shields/services/dynamic/dynamic-json.service.js
Caleb Cartwright ac54dd3ced convert some service classes to static props, run [drone dub dynamic] (#5543)
* refactor(drone): convert to static props

* refactor(dub): convert to static props

* refactor(dynamic): convert to static props
2020-09-15 01:42:57 +00:00

20 lines
532 B
JavaScript

'use strict'
const { MetricNames } = require('../../core/base-service/metric-helper')
const { BaseJsonService } = require('..')
const { createRoute } = require('./dynamic-helpers')
const jsonPath = require('./json-path')
module.exports = class DynamicJson extends jsonPath(BaseJsonService) {
static enabledMetrics = [MetricNames.SERVICE_RESPONSE_SIZE]
static route = createRoute('json')
async fetch({ schema, url, errorMessages }) {
return this._requestJson({
schema,
url,
errorMessages,
})
}
}