source: node_modules/@swagger-api/apidom-ns-json-schema-draft-4/cjs/elements/JSONReference.cjs@ d24f17c

main
Last change on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 934 bytes
Line 
1"use strict";
2
3exports.__esModule = true;
4exports.default = void 0;
5var _apidomCore = require("@swagger-api/apidom-core");
6/**
7 * In Draft 4, $ref behaves a little differently. When an object contains a $ref property,
8 * the object is considered a reference, not a schema. Therefore, any other properties you put in that object will
9 * not be treated as JSON Schema keywords and will be ignored by the validator.
10 * $ref can only be used where a schema is expected.
11 *
12 * URI: https://json-schema.org/understanding-json-schema/structuring.html?highlight=ref#id18
13 */
14
15class JSONReference extends _apidomCore.ObjectElement {
16 constructor(content, meta, attributes) {
17 super(content, meta, attributes);
18 this.element = 'JSONReference';
19 this.classes.push('json-reference');
20 }
21 get $ref() {
22 return this.get('$ref');
23 }
24 set $ref($ref) {
25 this.set('$ref', $ref);
26 }
27}
28var _default = exports.default = JSONReference;
Note: See TracBrowser for help on using the repository browser.