main
Last change
on this file since e48199a 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 |
|
---|
3 | exports.__esModule = true;
|
---|
4 | exports.default = void 0;
|
---|
5 | var _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 |
|
---|
15 | class 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 | }
|
---|
28 | var _default = exports.default = JSONReference; |
---|
Note:
See
TracBrowser
for help on using the repository browser.