botbook/node_modules/json-schema-library/dist/module/lib/addRemoteSchema.js

10 lines
295 B
JavaScript
Raw Normal View History

2024-09-04 13:13:15 -03:00
/**
* register a json-schema to be referenced from another json-schema
* @param url base-url of json-schema (aka id)
* @param schema
*/
export default function addRemoteSchema(draft, url, schema) {
schema.id = schema.id || url;
draft.remotes[url] = draft.compileSchema(schema);
}