@speclynx/apidom-ns-json-schema-draft-6 4.0.2 → 4.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/package.json +8 -9
  3. package/src/elements/JSONSchema.cjs +124 -0
  4. package/src/elements/JSONSchema.mjs +121 -0
  5. package/src/elements/JSONSchema.ts +158 -0
  6. package/src/elements/LinkDescription.cjs +60 -0
  7. package/src/elements/LinkDescription.mjs +56 -0
  8. package/src/elements/LinkDescription.ts +100 -0
  9. package/src/index.cjs +46 -0
  10. package/src/index.mjs +14 -0
  11. package/src/index.ts +85 -0
  12. package/src/media-types.cjs +34 -0
  13. package/src/media-types.mjs +30 -0
  14. package/src/media-types.ts +40 -0
  15. package/src/namespace.cjs +24 -0
  16. package/src/namespace.mjs +19 -0
  17. package/src/namespace.ts +23 -0
  18. package/src/predicates.cjs +30 -0
  19. package/src/predicates.mjs +21 -0
  20. package/src/predicates.ts +25 -0
  21. package/src/refractor/index.cjs +76 -0
  22. package/src/refractor/index.mjs +67 -0
  23. package/src/refractor/index.ts +90 -0
  24. package/src/refractor/inspect.cjs +47 -0
  25. package/src/refractor/inspect.mjs +39 -0
  26. package/src/refractor/inspect.ts +51 -0
  27. package/src/refractor/plugins/replace-empty-element.cjs +218 -0
  28. package/src/refractor/plugins/replace-empty-element.mjs +212 -0
  29. package/src/refractor/plugins/replace-empty-element.ts +243 -0
  30. package/src/refractor/specification.cjs +29 -0
  31. package/src/refractor/specification.mjs +24 -0
  32. package/src/refractor/specification.ts +58 -0
  33. package/src/refractor/toolbox.cjs +26 -0
  34. package/src/refractor/toolbox.mjs +19 -0
  35. package/src/refractor/toolbox.ts +23 -0
  36. package/src/refractor/visitors/json-schema/ExamplesVisitor.cjs +15 -0
  37. package/src/refractor/visitors/json-schema/ExamplesVisitor.mjs +11 -0
  38. package/src/refractor/visitors/json-schema/ExamplesVisitor.ts +19 -0
  39. package/src/refractor/visitors/json-schema/ItemsVisitor.cjs +15 -0
  40. package/src/refractor/visitors/json-schema/ItemsVisitor.mjs +11 -0
  41. package/src/refractor/visitors/json-schema/ItemsVisitor.ts +21 -0
  42. package/src/refractor/visitors/json-schema/index.cjs +29 -0
  43. package/src/refractor/visitors/json-schema/index.mjs +24 -0
  44. package/src/refractor/visitors/json-schema/index.ts +38 -0
  45. package/src/refractor/visitors/json-schema/link-description/index.cjs +19 -0
  46. package/src/refractor/visitors/json-schema/link-description/index.mjs +14 -0
  47. package/src/refractor/visitors/json-schema/link-description/index.ts +23 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.0.3](https://github.com/speclynx/apidom/compare/v4.0.2...v4.0.3) (2026-03-11)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **release:** fix v4.0.2 failed release ([b4dc1c4](https://github.com/speclynx/apidom/commit/b4dc1c48e8d9b2986a70e49b5554eb0a166d7528))
11
+
6
12
  ## [4.0.2](https://github.com/speclynx/apidom/compare/v4.0.1...v4.0.2) (2026-03-11)
7
13
 
8
14
  **Note:** Version bump only for package @speclynx/apidom-ns-json-schema-draft-6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@speclynx/apidom-ns-json-schema-draft-6",
3
- "version": "4.0.2",
3
+ "version": "4.0.3",
4
4
  "description": "JSON Schema Draft 6 namespace for ApiDOM.",
5
5
  "keywords": [
6
6
  "apidom",
@@ -58,18 +58,17 @@
58
58
  "license": "Apache-2.0",
59
59
  "dependencies": {
60
60
  "@babel/runtime-corejs3": "^7.28.4",
61
- "@speclynx/apidom-core": "4.0.2",
62
- "@speclynx/apidom-datamodel": "4.0.2",
63
- "@speclynx/apidom-error": "4.0.2",
64
- "@speclynx/apidom-ns-json-schema-draft-4": "4.0.2",
65
- "@speclynx/apidom-traverse": "4.0.2",
61
+ "@speclynx/apidom-core": "4.0.3",
62
+ "@speclynx/apidom-datamodel": "4.0.3",
63
+ "@speclynx/apidom-error": "4.0.3",
64
+ "@speclynx/apidom-ns-json-schema-draft-4": "4.0.3",
65
+ "@speclynx/apidom-traverse": "4.0.3",
66
66
  "ramda": "~0.32.0",
67
67
  "ramda-adjunct": "^6.0.0",
68
68
  "ts-mixer": "^6.0.4"
69
69
  },
70
70
  "files": [
71
- "src/**/*.mjs",
72
- "src/**/*.cjs",
71
+ "src/",
73
72
  "dist/",
74
73
  "types/apidom-ns-json-schema-draft-6.d.ts",
75
74
  "LICENSES",
@@ -77,5 +76,5 @@
77
76
  "README.md",
78
77
  "CHANGELOG.md"
79
78
  ],
80
- "gitHead": "af1b05d4d5e48a11a3a03cd5699324e0f1b62765"
79
+ "gitHead": "6ccfa09c02232516215e7de3ead276641957e626"
81
80
  }
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ var _apidomError = require("@speclynx/apidom-error");
6
+ var _apidomNsJsonSchemaDraft = require("@speclynx/apidom-ns-json-schema-draft-4");
7
+ /**
8
+ * @public
9
+ */
10
+ class JSONSchema extends _apidomNsJsonSchemaDraft.JSONSchemaElement {
11
+ constructor(content, meta, attributes) {
12
+ super(content, meta, attributes);
13
+ this.element = 'JSONSchemaDraft6';
14
+ }
15
+
16
+ /**
17
+ * Core vocabulary
18
+ *
19
+ * URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-01
20
+ */
21
+
22
+ get idField() {
23
+ throw new _apidomError.UnsupportedOperationError('id keyword from Core vocabulary has been renamed to $id.');
24
+ }
25
+ set idField(id) {
26
+ throw new _apidomError.UnsupportedOperationError('id keyword from Core vocabulary has been renamed to $id.');
27
+ }
28
+ get $id() {
29
+ return this.get('$id');
30
+ }
31
+ set $id($id) {
32
+ this.set('$id', $id);
33
+ }
34
+
35
+ /**
36
+ * Validation vocabulary
37
+ *
38
+ * URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-01
39
+ */
40
+
41
+ /**
42
+ * Validation keywords for numeric instances (number and integer)
43
+ */
44
+
45
+ get exclusiveMaximum() {
46
+ return this.get('exclusiveMaximum');
47
+ }
48
+ set exclusiveMaximum(exclusiveMaximum) {
49
+ this.set('exclusiveMaximum', exclusiveMaximum);
50
+ }
51
+ get exclusiveMinimum() {
52
+ return this.get('exclusiveMinimum');
53
+ }
54
+ set exclusiveMinimum(exclusiveMinimum) {
55
+ this.set('exclusiveMinimum', exclusiveMinimum);
56
+ }
57
+
58
+ /**
59
+ * Validation keywords for arrays
60
+ */
61
+
62
+ get containsField() {
63
+ return this.get('contains');
64
+ }
65
+ set containsField(contains) {
66
+ this.set('contains', contains);
67
+ }
68
+
69
+ // @ts-expect-error - widening type to include BooleanElement (boolean schemas introduced in draft-6)
70
+ get itemsField() {
71
+ return this.get('items');
72
+ }
73
+
74
+ // @ts-expect-error - widening type to include BooleanElement (boolean schemas introduced in draft-6)
75
+ set itemsField(items) {
76
+ this.set('items', items);
77
+ }
78
+
79
+ /**
80
+ * Validation keywords for objects
81
+ */
82
+
83
+ get propertyNames() {
84
+ return this.get('propertyNames');
85
+ }
86
+ set propertyNames(propertyNames) {
87
+ this.set('propertyNames', propertyNames);
88
+ }
89
+
90
+ /**
91
+ * Validation keywords for any instance type
92
+ */
93
+
94
+ get const() {
95
+ return this.get('const');
96
+ }
97
+ set const(constValue) {
98
+ this.set('const', constValue);
99
+ }
100
+
101
+ // @ts-expect-error - widening type to include BooleanElement (boolean schemas introduced in draft-6)
102
+ get not() {
103
+ return this.get('not');
104
+ }
105
+
106
+ // @ts-expect-error - widening type to include BooleanElement (boolean schemas introduced in draft-6)
107
+ set not(not) {
108
+ this.set('not', not);
109
+ }
110
+
111
+ /**
112
+ * Metadata keywords
113
+ *
114
+ * URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-01#section-7
115
+ */
116
+
117
+ get examples() {
118
+ return this.get('examples');
119
+ }
120
+ set examples(examples) {
121
+ this.set('examples', examples);
122
+ }
123
+ }
124
+ var _default = exports.default = JSONSchema;
@@ -0,0 +1,121 @@
1
+ import { UnsupportedOperationError } from '@speclynx/apidom-error';
2
+ import { JSONSchemaElement } from '@speclynx/apidom-ns-json-schema-draft-4';
3
+
4
+ /**
5
+ * @public
6
+ */
7
+ class JSONSchema extends JSONSchemaElement {
8
+ constructor(content, meta, attributes) {
9
+ super(content, meta, attributes);
10
+ this.element = 'JSONSchemaDraft6';
11
+ }
12
+
13
+ /**
14
+ * Core vocabulary
15
+ *
16
+ * URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-01
17
+ */
18
+
19
+ get idField() {
20
+ throw new UnsupportedOperationError('id keyword from Core vocabulary has been renamed to $id.');
21
+ }
22
+ set idField(id) {
23
+ throw new UnsupportedOperationError('id keyword from Core vocabulary has been renamed to $id.');
24
+ }
25
+ get $id() {
26
+ return this.get('$id');
27
+ }
28
+ set $id($id) {
29
+ this.set('$id', $id);
30
+ }
31
+
32
+ /**
33
+ * Validation vocabulary
34
+ *
35
+ * URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-01
36
+ */
37
+
38
+ /**
39
+ * Validation keywords for numeric instances (number and integer)
40
+ */
41
+
42
+ get exclusiveMaximum() {
43
+ return this.get('exclusiveMaximum');
44
+ }
45
+ set exclusiveMaximum(exclusiveMaximum) {
46
+ this.set('exclusiveMaximum', exclusiveMaximum);
47
+ }
48
+ get exclusiveMinimum() {
49
+ return this.get('exclusiveMinimum');
50
+ }
51
+ set exclusiveMinimum(exclusiveMinimum) {
52
+ this.set('exclusiveMinimum', exclusiveMinimum);
53
+ }
54
+
55
+ /**
56
+ * Validation keywords for arrays
57
+ */
58
+
59
+ get containsField() {
60
+ return this.get('contains');
61
+ }
62
+ set containsField(contains) {
63
+ this.set('contains', contains);
64
+ }
65
+
66
+ // @ts-expect-error - widening type to include BooleanElement (boolean schemas introduced in draft-6)
67
+ get itemsField() {
68
+ return this.get('items');
69
+ }
70
+
71
+ // @ts-expect-error - widening type to include BooleanElement (boolean schemas introduced in draft-6)
72
+ set itemsField(items) {
73
+ this.set('items', items);
74
+ }
75
+
76
+ /**
77
+ * Validation keywords for objects
78
+ */
79
+
80
+ get propertyNames() {
81
+ return this.get('propertyNames');
82
+ }
83
+ set propertyNames(propertyNames) {
84
+ this.set('propertyNames', propertyNames);
85
+ }
86
+
87
+ /**
88
+ * Validation keywords for any instance type
89
+ */
90
+
91
+ get const() {
92
+ return this.get('const');
93
+ }
94
+ set const(constValue) {
95
+ this.set('const', constValue);
96
+ }
97
+
98
+ // @ts-expect-error - widening type to include BooleanElement (boolean schemas introduced in draft-6)
99
+ get not() {
100
+ return this.get('not');
101
+ }
102
+
103
+ // @ts-expect-error - widening type to include BooleanElement (boolean schemas introduced in draft-6)
104
+ set not(not) {
105
+ this.set('not', not);
106
+ }
107
+
108
+ /**
109
+ * Metadata keywords
110
+ *
111
+ * URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-01#section-7
112
+ */
113
+
114
+ get examples() {
115
+ return this.get('examples');
116
+ }
117
+ set examples(examples) {
118
+ this.set('examples', examples);
119
+ }
120
+ }
121
+ export default JSONSchema;
@@ -0,0 +1,158 @@
1
+ import {
2
+ Element,
3
+ StringElement,
4
+ NumberElement,
5
+ BooleanElement,
6
+ ArrayElement,
7
+ Attributes,
8
+ Meta,
9
+ } from '@speclynx/apidom-datamodel';
10
+ import { UnsupportedOperationError } from '@speclynx/apidom-error';
11
+ import { JSONSchemaElement, JSONReferenceElement } from '@speclynx/apidom-ns-json-schema-draft-4';
12
+
13
+ /**
14
+ * @public
15
+ */
16
+ class JSONSchema extends JSONSchemaElement {
17
+ constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
18
+ super(content, meta, attributes);
19
+ this.element = 'JSONSchemaDraft6';
20
+ }
21
+
22
+ /**
23
+ * Core vocabulary
24
+ *
25
+ * URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-01
26
+ */
27
+
28
+ override get idField(): StringElement | undefined {
29
+ throw new UnsupportedOperationError('id keyword from Core vocabulary has been renamed to $id.');
30
+ }
31
+
32
+ override set idField(id: StringElement | undefined) {
33
+ throw new UnsupportedOperationError('id keyword from Core vocabulary has been renamed to $id.');
34
+ }
35
+
36
+ get $id(): StringElement | undefined {
37
+ return this.get('$id') as StringElement | undefined;
38
+ }
39
+
40
+ set $id($id: StringElement | undefined) {
41
+ this.set('$id', $id);
42
+ }
43
+
44
+ /**
45
+ * Validation vocabulary
46
+ *
47
+ * URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-01
48
+ */
49
+
50
+ /**
51
+ * Validation keywords for numeric instances (number and integer)
52
+ */
53
+
54
+ override get exclusiveMaximum(): NumberElement | undefined {
55
+ return this.get('exclusiveMaximum') as NumberElement | undefined;
56
+ }
57
+
58
+ override set exclusiveMaximum(exclusiveMaximum: NumberElement | undefined) {
59
+ this.set('exclusiveMaximum', exclusiveMaximum);
60
+ }
61
+
62
+ override get exclusiveMinimum(): NumberElement | undefined {
63
+ return this.get('exclusiveMinimum') as NumberElement | undefined;
64
+ }
65
+
66
+ override set exclusiveMinimum(exclusiveMinimum: NumberElement | undefined) {
67
+ this.set('exclusiveMinimum', exclusiveMinimum);
68
+ }
69
+
70
+ /**
71
+ * Validation keywords for arrays
72
+ */
73
+
74
+ get containsField(): this | BooleanElement | JSONReferenceElement | undefined {
75
+ return this.get('contains') as this | BooleanElement | JSONReferenceElement | undefined;
76
+ }
77
+
78
+ set containsField(contains: this | BooleanElement | JSONReferenceElement | undefined) {
79
+ this.set('contains', contains);
80
+ }
81
+
82
+ // @ts-expect-error - widening type to include BooleanElement (boolean schemas introduced in draft-6)
83
+ get itemsField():
84
+ | this
85
+ | BooleanElement
86
+ | JSONReferenceElement
87
+ | ArrayElement<this | BooleanElement | JSONReferenceElement>
88
+ | undefined {
89
+ return this.get('items') as
90
+ | this
91
+ | BooleanElement
92
+ | JSONReferenceElement
93
+ | ArrayElement<this | BooleanElement | JSONReferenceElement>
94
+ | undefined;
95
+ }
96
+
97
+ // @ts-expect-error - widening type to include BooleanElement (boolean schemas introduced in draft-6)
98
+ set itemsField(
99
+ items:
100
+ | this
101
+ | BooleanElement
102
+ | JSONReferenceElement
103
+ | ArrayElement<this | BooleanElement | JSONReferenceElement>
104
+ | undefined,
105
+ ) {
106
+ this.set('items', items);
107
+ }
108
+
109
+ /**
110
+ * Validation keywords for objects
111
+ */
112
+
113
+ get propertyNames(): this | BooleanElement | JSONReferenceElement | undefined {
114
+ return this.get('propertyNames') as this | BooleanElement | JSONReferenceElement | undefined;
115
+ }
116
+
117
+ set propertyNames(propertyNames: this | BooleanElement | JSONReferenceElement | undefined) {
118
+ this.set('propertyNames', propertyNames);
119
+ }
120
+
121
+ /**
122
+ * Validation keywords for any instance type
123
+ */
124
+
125
+ get const(): Element | undefined {
126
+ return this.get('const') as Element | undefined;
127
+ }
128
+
129
+ set const(constValue: Element | undefined) {
130
+ this.set('const', constValue);
131
+ }
132
+
133
+ // @ts-expect-error - widening type to include BooleanElement (boolean schemas introduced in draft-6)
134
+ get not(): this | BooleanElement | JSONReferenceElement | undefined {
135
+ return this.get('not') as this | BooleanElement | JSONReferenceElement | undefined;
136
+ }
137
+
138
+ // @ts-expect-error - widening type to include BooleanElement (boolean schemas introduced in draft-6)
139
+ set not(not: this | BooleanElement | JSONReferenceElement | undefined) {
140
+ this.set('not', not);
141
+ }
142
+
143
+ /**
144
+ * Metadata keywords
145
+ *
146
+ * URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-01#section-7
147
+ */
148
+
149
+ get examples(): ArrayElement<Element> | undefined {
150
+ return this.get('examples') as ArrayElement<Element> | undefined;
151
+ }
152
+
153
+ set examples(examples: ArrayElement<Element> | undefined) {
154
+ this.set('examples', examples);
155
+ }
156
+ }
157
+
158
+ export default JSONSchema;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ var _apidomError = require("@speclynx/apidom-error");
6
+ var _apidomNsJsonSchemaDraft = require("@speclynx/apidom-ns-json-schema-draft-4");
7
+ /**
8
+ * URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-hyperschema-01#section-6
9
+ * @public
10
+ */
11
+
12
+ class LinkDescription extends _apidomNsJsonSchemaDraft.LinkDescriptionElement {
13
+ get hrefSchema() {
14
+ return this.get('hrefSchema');
15
+ }
16
+ set hrefSchema(hrefSchema) {
17
+ this.set('hrefSchema', hrefSchema);
18
+ }
19
+
20
+ // @ts-expect-error - widening type to include BooleanElement (boolean schemas introduced in draft-6)
21
+ get targetSchema() {
22
+ return this.get('targetSchema');
23
+ }
24
+
25
+ // @ts-expect-error - widening type to include BooleanElement (boolean schemas introduced in draft-6)
26
+ set targetSchema(targetSchema) {
27
+ this.set('targetSchema', targetSchema);
28
+ }
29
+ get schema() {
30
+ throw new _apidomError.UnsupportedOperationError('schema keyword from Hyper-Schema vocabulary has been renamed to submissionSchema.');
31
+ }
32
+ set schema(schema) {
33
+ throw new _apidomError.UnsupportedOperationError('schema keyword from Hyper-Schema vocabulary has been renamed to submissionSchema.');
34
+ }
35
+ get submissionSchema() {
36
+ return this.get('submissionSchema');
37
+ }
38
+ set submissionSchema(submissionSchema) {
39
+ this.set('submissionSchema', submissionSchema);
40
+ }
41
+ get method() {
42
+ throw new _apidomError.UnsupportedOperationError('method keyword from Hyper-Schema vocabulary has been removed.');
43
+ }
44
+ set method(method) {
45
+ throw new _apidomError.UnsupportedOperationError('method keyword from Hyper-Schema vocabulary has been removed.');
46
+ }
47
+ get encType() {
48
+ throw new _apidomError.UnsupportedOperationError('encType keyword from Hyper-Schema vocabulary has been renamed to submissionEncType.');
49
+ }
50
+ set encType(encType) {
51
+ throw new _apidomError.UnsupportedOperationError('encType keyword from Hyper-Schema vocabulary has been renamed to submissionEncType.');
52
+ }
53
+ get submissionEncType() {
54
+ return this.get('submissionEncType');
55
+ }
56
+ set submissionEncType(submissionEncType) {
57
+ this.set('submissionEncType', submissionEncType);
58
+ }
59
+ }
60
+ var _default = exports.default = LinkDescription;
@@ -0,0 +1,56 @@
1
+ import { UnsupportedOperationError } from '@speclynx/apidom-error';
2
+ import { LinkDescriptionElement } from '@speclynx/apidom-ns-json-schema-draft-4';
3
+ /**
4
+ * URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-hyperschema-01#section-6
5
+ * @public
6
+ */
7
+
8
+ class LinkDescription extends LinkDescriptionElement {
9
+ get hrefSchema() {
10
+ return this.get('hrefSchema');
11
+ }
12
+ set hrefSchema(hrefSchema) {
13
+ this.set('hrefSchema', hrefSchema);
14
+ }
15
+
16
+ // @ts-expect-error - widening type to include BooleanElement (boolean schemas introduced in draft-6)
17
+ get targetSchema() {
18
+ return this.get('targetSchema');
19
+ }
20
+
21
+ // @ts-expect-error - widening type to include BooleanElement (boolean schemas introduced in draft-6)
22
+ set targetSchema(targetSchema) {
23
+ this.set('targetSchema', targetSchema);
24
+ }
25
+ get schema() {
26
+ throw new UnsupportedOperationError('schema keyword from Hyper-Schema vocabulary has been renamed to submissionSchema.');
27
+ }
28
+ set schema(schema) {
29
+ throw new UnsupportedOperationError('schema keyword from Hyper-Schema vocabulary has been renamed to submissionSchema.');
30
+ }
31
+ get submissionSchema() {
32
+ return this.get('submissionSchema');
33
+ }
34
+ set submissionSchema(submissionSchema) {
35
+ this.set('submissionSchema', submissionSchema);
36
+ }
37
+ get method() {
38
+ throw new UnsupportedOperationError('method keyword from Hyper-Schema vocabulary has been removed.');
39
+ }
40
+ set method(method) {
41
+ throw new UnsupportedOperationError('method keyword from Hyper-Schema vocabulary has been removed.');
42
+ }
43
+ get encType() {
44
+ throw new UnsupportedOperationError('encType keyword from Hyper-Schema vocabulary has been renamed to submissionEncType.');
45
+ }
46
+ set encType(encType) {
47
+ throw new UnsupportedOperationError('encType keyword from Hyper-Schema vocabulary has been renamed to submissionEncType.');
48
+ }
49
+ get submissionEncType() {
50
+ return this.get('submissionEncType');
51
+ }
52
+ set submissionEncType(submissionEncType) {
53
+ this.set('submissionEncType', submissionEncType);
54
+ }
55
+ }
56
+ export default LinkDescription;
@@ -0,0 +1,100 @@
1
+ import { BooleanElement, StringElement } from '@speclynx/apidom-datamodel';
2
+ import { UnsupportedOperationError } from '@speclynx/apidom-error';
3
+ import {
4
+ LinkDescriptionElement,
5
+ JSONReferenceElement,
6
+ JSONSchemaElement,
7
+ } from '@speclynx/apidom-ns-json-schema-draft-4';
8
+
9
+ import JSONSchema from './JSONSchema.ts';
10
+
11
+ /**
12
+ * URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-hyperschema-01#section-6
13
+ * @public
14
+ */
15
+
16
+ class LinkDescription extends LinkDescriptionElement {
17
+ get hrefSchema(): JSONSchema | BooleanElement | JSONReferenceElement | undefined {
18
+ return this.get('hrefSchema') as JSONSchema | BooleanElement | JSONReferenceElement | undefined;
19
+ }
20
+
21
+ set hrefSchema(hrefSchema: JSONSchema | BooleanElement | JSONReferenceElement | undefined) {
22
+ this.set('hrefSchema', hrefSchema);
23
+ }
24
+
25
+ // @ts-expect-error - widening type to include BooleanElement (boolean schemas introduced in draft-6)
26
+ override get targetSchema(): JSONSchema | BooleanElement | JSONReferenceElement | undefined {
27
+ return this.get('targetSchema') as
28
+ | JSONSchema
29
+ | BooleanElement
30
+ | JSONReferenceElement
31
+ | undefined;
32
+ }
33
+
34
+ // @ts-expect-error - widening type to include BooleanElement (boolean schemas introduced in draft-6)
35
+ override set targetSchema(
36
+ targetSchema: JSONSchema | BooleanElement | JSONReferenceElement | undefined,
37
+ ) {
38
+ this.set('targetSchema', targetSchema);
39
+ }
40
+
41
+ override get schema(): JSONSchemaElement | JSONReferenceElement | undefined {
42
+ throw new UnsupportedOperationError(
43
+ 'schema keyword from Hyper-Schema vocabulary has been renamed to submissionSchema.',
44
+ );
45
+ }
46
+
47
+ override set schema(schema: JSONSchemaElement | JSONReferenceElement | undefined) {
48
+ throw new UnsupportedOperationError(
49
+ 'schema keyword from Hyper-Schema vocabulary has been renamed to submissionSchema.',
50
+ );
51
+ }
52
+
53
+ get submissionSchema(): JSONSchema | BooleanElement | JSONReferenceElement | undefined {
54
+ return this.get('submissionSchema') as
55
+ | JSONSchema
56
+ | BooleanElement
57
+ | JSONReferenceElement
58
+ | undefined;
59
+ }
60
+
61
+ set submissionSchema(
62
+ submissionSchema: JSONSchema | BooleanElement | JSONReferenceElement | undefined,
63
+ ) {
64
+ this.set('submissionSchema', submissionSchema);
65
+ }
66
+
67
+ override get method(): StringElement | undefined {
68
+ throw new UnsupportedOperationError(
69
+ 'method keyword from Hyper-Schema vocabulary has been removed.',
70
+ );
71
+ }
72
+
73
+ override set method(method: StringElement | undefined) {
74
+ throw new UnsupportedOperationError(
75
+ 'method keyword from Hyper-Schema vocabulary has been removed.',
76
+ );
77
+ }
78
+
79
+ override get encType(): StringElement | undefined {
80
+ throw new UnsupportedOperationError(
81
+ 'encType keyword from Hyper-Schema vocabulary has been renamed to submissionEncType.',
82
+ );
83
+ }
84
+
85
+ override set encType(encType: StringElement | undefined) {
86
+ throw new UnsupportedOperationError(
87
+ 'encType keyword from Hyper-Schema vocabulary has been renamed to submissionEncType.',
88
+ );
89
+ }
90
+
91
+ get submissionEncType(): StringElement | undefined {
92
+ return this.get('submissionEncType') as StringElement | undefined;
93
+ }
94
+
95
+ set submissionEncType(submissionEncType: StringElement | undefined) {
96
+ this.set('submissionEncType', submissionEncType);
97
+ }
98
+ }
99
+
100
+ export default LinkDescription;