min-max-reference-example
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));
no comments