min-max-reference-example

node v8.17.0
version: 1.0.0
endpointsharetweet
const parser = require("json-schema-ref-parser"); const schema = { definitions: { numericRange: { type: "object", properties: { startAt: { type: "integer", minimum: 0 }, endAt: { type: "integer", maximum: { $ref: "#/definitions/numericRange/properties/startAt/minimum" } } } } } }; parser.dereference(schema) .then(result => { let json = JSON.stringify(result, null, 2); console.log(`Here's the dereferenced schema:\n ${json}`); }) .catch(err => console.error(err));
Loading…

no comments

    sign in to comment