@swagger-api/apidom-ns-openapi-3-1 1.0.0-beta.8 → 1.0.0-rc.0

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 (54) hide show
  1. package/CHANGELOG.md +191 -0
  2. package/README.md +371 -1
  3. package/dist/apidom-ns-openapi-3-1.browser.js +29414 -24750
  4. package/dist/apidom-ns-openapi-3-1.browser.min.js +1 -1
  5. package/package.json +10 -9
  6. package/src/elements/Schema.cjs +2 -427
  7. package/src/elements/Schema.mjs +2 -427
  8. package/src/index.cjs +3 -1
  9. package/src/index.mjs +1 -0
  10. package/src/refractor/plugins/normalize-discriminator-mapping.cjs +173 -0
  11. package/src/refractor/plugins/normalize-discriminator-mapping.mjs +167 -0
  12. package/src/refractor/plugins/replace-empty-element.cjs +2 -1
  13. package/src/refractor/plugins/replace-empty-element.mjs +3 -2
  14. package/src/refractor/specification.cjs +55 -157
  15. package/src/refractor/specification.mjs +13 -115
  16. package/src/refractor/toolbox.cjs +2 -2
  17. package/src/refractor/toolbox.mjs +1 -1
  18. package/src/refractor/visitors/open-api-3-1/components/SchemasVisitor.cjs +13 -0
  19. package/src/refractor/visitors/open-api-3-1/components/SchemasVisitor.mjs +13 -2
  20. package/src/refractor/visitors/open-api-3-1/schema/$defsVisitor.cjs +2 -10
  21. package/src/refractor/visitors/open-api-3-1/schema/$defsVisitor.mjs +4 -9
  22. package/src/refractor/visitors/open-api-3-1/schema/AllOfVisitor.cjs +2 -25
  23. package/src/refractor/visitors/open-api-3-1/schema/AllOfVisitor.mjs +2 -23
  24. package/src/refractor/visitors/open-api-3-1/schema/AnyOfVisitor.cjs +2 -25
  25. package/src/refractor/visitors/open-api-3-1/schema/AnyOfVisitor.mjs +2 -23
  26. package/src/refractor/visitors/open-api-3-1/schema/DependentSchemasVisitor.cjs +2 -14
  27. package/src/refractor/visitors/open-api-3-1/schema/DependentSchemasVisitor.mjs +2 -12
  28. package/src/refractor/visitors/open-api-3-1/schema/OneOfVisitor.cjs +2 -25
  29. package/src/refractor/visitors/open-api-3-1/schema/OneOfVisitor.mjs +2 -23
  30. package/src/refractor/visitors/open-api-3-1/schema/PatternPropertiesVisitor.cjs +2 -14
  31. package/src/refractor/visitors/open-api-3-1/schema/PatternPropertiesVisitor.mjs +2 -12
  32. package/src/refractor/visitors/open-api-3-1/schema/PrefixItemsVisitor.cjs +2 -25
  33. package/src/refractor/visitors/open-api-3-1/schema/PrefixItemsVisitor.mjs +2 -23
  34. package/src/refractor/visitors/open-api-3-1/schema/PropertiesVisitor.cjs +2 -14
  35. package/src/refractor/visitors/open-api-3-1/schema/PropertiesVisitor.mjs +2 -12
  36. package/src/refractor/visitors/open-api-3-1/schema/index.cjs +10 -31
  37. package/src/refractor/visitors/open-api-3-1/schema/index.mjs +12 -33
  38. package/types/apidom-ns-openapi-3-1.d.ts +183 -408
  39. package/src/refractor/visitors/open-api-3-1/schema/$refVisitor.cjs +0 -16
  40. package/src/refractor/visitors/open-api-3-1/schema/$refVisitor.mjs +0 -12
  41. package/src/refractor/visitors/open-api-3-1/schema/$vocabularyVisitor.cjs +0 -16
  42. package/src/refractor/visitors/open-api-3-1/schema/$vocabularyVisitor.mjs +0 -12
  43. package/src/refractor/visitors/open-api-3-1/schema/DependentRequiredVisitor.cjs +0 -16
  44. package/src/refractor/visitors/open-api-3-1/schema/DependentRequiredVisitor.mjs +0 -12
  45. package/src/refractor/visitors/open-api-3-1/schema/EnumVisitor.cjs +0 -16
  46. package/src/refractor/visitors/open-api-3-1/schema/EnumVisitor.mjs +0 -12
  47. package/src/refractor/visitors/open-api-3-1/schema/ExamplesVisitor.cjs +0 -16
  48. package/src/refractor/visitors/open-api-3-1/schema/ExamplesVisitor.mjs +0 -12
  49. package/src/refractor/visitors/open-api-3-1/schema/ParentSchemaAwareVisitor.cjs +0 -17
  50. package/src/refractor/visitors/open-api-3-1/schema/ParentSchemaAwareVisitor.mjs +0 -13
  51. package/src/refractor/visitors/open-api-3-1/schema/RequiredVisitor.cjs +0 -16
  52. package/src/refractor/visitors/open-api-3-1/schema/RequiredVisitor.mjs +0 -12
  53. package/src/refractor/visitors/open-api-3-1/schema/TypeVisitor.cjs +0 -21
  54. package/src/refractor/visitors/open-api-3-1/schema/TypeVisitor.mjs +0 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swagger-api/apidom-ns-openapi-3-1",
3
- "version": "1.0.0-beta.8",
3
+ "version": "1.0.0-rc.0",
4
4
  "description": "OpenAPI 3.1.x namespace for ApiDOM.",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -26,8 +26,8 @@
26
26
  "build:umd:browser": "cross-env BABEL_ENV=browser webpack --config config/webpack/browser.config.js --progress",
27
27
  "lint": "eslint ./",
28
28
  "lint:fix": "eslint ./ --fix",
29
- "clean": "rimraf --glob 'src/**/*.mjs' 'src/**/*.cjs' 'test/**/*.mjs' ./dist ./types",
30
- "test": "npm run build:es && cross-env BABEL_ENV=es babel test --out-dir test --extensions '.ts' --out-file-extension '.mjs' --root-mode 'upward' && cross-env NODE_ENV=test mocha",
29
+ "clean": "rimraf --glob 'src/**/*.mjs' 'src/**/*.cjs' ./dist ./types",
30
+ "test": "NODE_ENV=test ts-mocha --exit",
31
31
  "test:update-snapshots": "cross-env UPDATE_SNAPSHOT=1 mocha",
32
32
  "perf": "cross-env BABEL_ENV=es babel ./test/perf/index.ts --out-file ./test/perf/index.mjs --root-mode 'upward' && cross-env NODE_ENV=test node ./test/perf/index.mjs",
33
33
  "perf:visitor-shortcut": "cross-env BABEL_ENV=es babel ./test/perf/visitor-shortcut.ts --out-file ./test/perf/visitor-shortcut.mjs --root-mode 'upward' && cross-env NODE_ENV=test node ./test/perf/visitor-shortcut.mjs",
@@ -44,11 +44,12 @@
44
44
  "author": "Vladimir Gorej",
45
45
  "license": "Apache-2.0",
46
46
  "dependencies": {
47
- "@babel/runtime-corejs3": "^7.20.7",
48
- "@swagger-api/apidom-ast": "^1.0.0-beta.8",
49
- "@swagger-api/apidom-core": "^1.0.0-beta.8",
50
- "@swagger-api/apidom-json-pointer": "^1.0.0-beta.8",
51
- "@swagger-api/apidom-ns-openapi-3-0": "^1.0.0-beta.8",
47
+ "@babel/runtime-corejs3": "^7.26.10",
48
+ "@swagger-api/apidom-ast": "^1.0.0-rc.0",
49
+ "@swagger-api/apidom-core": "^1.0.0-rc.0",
50
+ "@swagger-api/apidom-json-pointer": "^1.0.0-rc.0",
51
+ "@swagger-api/apidom-ns-json-schema-2020-12": "^1.0.0-rc.0",
52
+ "@swagger-api/apidom-ns-openapi-3-0": "^1.0.0-rc.0",
52
53
  "@types/ramda": "~0.30.0",
53
54
  "ramda": "~0.30.0",
54
55
  "ramda-adjunct": "^5.0.0",
@@ -64,5 +65,5 @@
64
65
  "README.md",
65
66
  "CHANGELOG.md"
66
67
  ],
67
- "gitHead": "1066cb6941da513bc53171fbf205cd894b7f0d4e"
68
+ "gitHead": "af4b6e0fcae489477729581c52036725ac57a412"
68
69
  }
@@ -2,441 +2,16 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  exports.default = void 0;
5
- var _apidomCore = require("@swagger-api/apidom-core");
5
+ var _apidomNsJsonSchema = require("@swagger-api/apidom-ns-json-schema-2020-12");
6
6
  /**
7
7
  * @public
8
8
  */
9
- class Schema extends _apidomCore.ObjectElement {
9
+ class Schema extends _apidomNsJsonSchema.JSONSchemaElement {
10
10
  constructor(content, meta, attributes) {
11
11
  super(content, meta, attributes);
12
12
  this.element = 'schema';
13
13
  }
14
14
 
15
- /**
16
- * Core vocabulary
17
- *
18
- * URI: https://json-schema.org/draft/2020-12/vocab/core
19
- */
20
-
21
- get $schema() {
22
- return this.get('$schema');
23
- }
24
- set $schema($schema) {
25
- this.set('$schema', $schema);
26
- }
27
- get $vocabulary() {
28
- return this.get('$vocabulary');
29
- }
30
- set $vocabulary($vocabulary) {
31
- this.set('$vocabulary', $vocabulary);
32
- }
33
- get $id() {
34
- return this.get('$id');
35
- }
36
- set $id($id) {
37
- this.set('$id', $id);
38
- }
39
- get $anchor() {
40
- return this.get('$anchor');
41
- }
42
- set $anchor($anchor) {
43
- this.set('$anchor', $anchor);
44
- }
45
- get $dynamicAnchor() {
46
- return this.get('$dynamicAnchor');
47
- }
48
- set $dynamicAnchor($dynamicAnchor) {
49
- this.set('$dynamicAnchor', $dynamicAnchor);
50
- }
51
- get $dynamicRef() {
52
- return this.get('$dynamicRef');
53
- }
54
- set $dynamicRef($dynamicRef) {
55
- this.set('$dynamicRef', $dynamicRef);
56
- }
57
- get $ref() {
58
- return this.get('$ref');
59
- }
60
- set $ref($ref) {
61
- this.set('$ref', $ref);
62
- }
63
- get $defs() {
64
- return this.get('$defs');
65
- }
66
- set $defs($defs) {
67
- this.set('$defs', $defs);
68
- }
69
- get $comment() {
70
- return this.get('$comment');
71
- }
72
- set $comment($comment) {
73
- this.set('$comment', $comment);
74
- }
75
-
76
- /**
77
- * Applicator vocabulary
78
- *
79
- * URI: https://json-schema.org/draft/2020-12/vocab/applicator
80
- */
81
-
82
- get allOf() {
83
- return this.get('allOf');
84
- }
85
- set allOf(allOf) {
86
- this.set('allOf', allOf);
87
- }
88
- get anyOf() {
89
- return this.get('anyOf');
90
- }
91
- set anyOf(anyOf) {
92
- this.set('anyOf', anyOf);
93
- }
94
- get oneOf() {
95
- return this.get('oneOf');
96
- }
97
- set oneOf(oneOf) {
98
- this.set('oneOf', oneOf);
99
- }
100
- get not() {
101
- return this.get('not');
102
- }
103
- set not(not) {
104
- this.set('not', not);
105
- }
106
- get if() {
107
- return this.get('if');
108
- }
109
- set if(ifSchema) {
110
- this.set('if', ifSchema);
111
- }
112
- get then() {
113
- return this.get('then');
114
- }
115
- set then(thenSchema) {
116
- this.set('then', thenSchema);
117
- }
118
- get else() {
119
- return this.get('else');
120
- }
121
- set else(elseSchema) {
122
- this.set('else', elseSchema);
123
- }
124
- get dependentSchemas() {
125
- return this.get('dependentSchemas');
126
- }
127
- set dependentSchemas(dependentSchemas) {
128
- this.set('dependentSchemas', dependentSchemas);
129
- }
130
- get prefixItems() {
131
- return this.get('prefixItems');
132
- }
133
- set prefixItems(prefixItems) {
134
- this.set('prefixItems', prefixItems);
135
- }
136
- get items() {
137
- return this.get('items');
138
- }
139
- set items(items) {
140
- this.set('items', items);
141
- }
142
- get containsProp() {
143
- return this.get('contains');
144
- }
145
- set containsProp(containsProp) {
146
- this.set('contains', containsProp);
147
- }
148
- get properties() {
149
- return this.get('properties');
150
- }
151
- set properties(properties) {
152
- this.set('properties', properties);
153
- }
154
- get patternProperties() {
155
- return this.get('patternProperties');
156
- }
157
- set patternProperties(patternProperties) {
158
- this.set('patternProperties', patternProperties);
159
- }
160
- get additionalProperties() {
161
- return this.get('additionalProperties');
162
- }
163
- set additionalProperties(additionalProperties) {
164
- this.set('additionalProperties', additionalProperties);
165
- }
166
- get propertyNames() {
167
- return this.get('propertyNames');
168
- }
169
- set propertyNames(propertyNames) {
170
- this.set('propertyNames', propertyNames);
171
- }
172
-
173
- /**
174
- * Unevaluated Locations vocabulary
175
- *
176
- * URI: https://json-schema.org/draft/2020-12/vocab/unevaluated
177
- */
178
-
179
- get unevaluatedItems() {
180
- return this.get('unevaluatedItems');
181
- }
182
- set unevaluatedItems(unevaluatedItems) {
183
- this.set('unevaluatedItems', unevaluatedItems);
184
- }
185
- get unevaluatedProperties() {
186
- return this.get('unevaluatedProperties');
187
- }
188
- set unevaluatedProperties(unevaluatedProperties) {
189
- this.set('unevaluatedProperties', unevaluatedProperties);
190
- }
191
-
192
- /**
193
- * Validation vocabulary
194
- *
195
- * URI: https://json-schema.org/draft/2020-12/vocab/validation
196
- */
197
-
198
- /**
199
- * Validation Keywords for Any Instance Type
200
- *
201
- * URI: https://json-schema.org/draft/2020-12/json-schema-validation.html#rfc.section.6.1
202
- */
203
-
204
- get type() {
205
- return this.get('type');
206
- }
207
- set type(type) {
208
- this.set('type', type);
209
- }
210
- get enum() {
211
- return this.get('enum');
212
- }
213
- set enum(enumVal) {
214
- this.set('enum', enumVal);
215
- }
216
- get const() {
217
- return this.get('const');
218
- }
219
- set const(constVal) {
220
- this.set('const', constVal);
221
- }
222
-
223
- /**
224
- * Validation Keywords for Numeric Instances (number and integer)
225
- *
226
- * URI: https://json-schema.org/draft/2020-12/json-schema-validation.html#numeric
227
- */
228
-
229
- get multipleOf() {
230
- return this.get('multipleOf');
231
- }
232
- set multipleOf(multipleOf) {
233
- this.set('multipleOf', multipleOf);
234
- }
235
- get maximum() {
236
- return this.get('maximum');
237
- }
238
- set maximum(maximum) {
239
- this.set('maximum', maximum);
240
- }
241
- get exclusiveMaximum() {
242
- return this.get('exclusiveMaximum');
243
- }
244
- set exclusiveMaximum(exclusiveMaximum) {
245
- this.set('exclusiveMaximum', exclusiveMaximum);
246
- }
247
- get minimum() {
248
- return this.get('minimum');
249
- }
250
- set minimum(minimum) {
251
- this.set('minimum', minimum);
252
- }
253
- get exclusiveMinimum() {
254
- return this.get('exclusiveMinimum');
255
- }
256
- set exclusiveMinimum(exclusiveMinimum) {
257
- this.set('exclusiveMinimum', exclusiveMinimum);
258
- }
259
-
260
- /**
261
- * Validation Keywords for Strings
262
- *
263
- * URI: https://json-schema.org/draft/2020-12/json-schema-validation.html#string
264
- */
265
-
266
- get maxLength() {
267
- return this.get('maxLength');
268
- }
269
- set maxLength(maxLength) {
270
- this.set('maxLength', maxLength);
271
- }
272
- get minLength() {
273
- return this.get('minLength');
274
- }
275
- set minLength(minLength) {
276
- this.set('minLength', minLength);
277
- }
278
- get pattern() {
279
- return this.get('pattern');
280
- }
281
- set pattern(pattern) {
282
- this.set('pattern', pattern);
283
- }
284
-
285
- /**
286
- * Validation Keywords for Arrays
287
- *
288
- * URI: https://json-schema.org/draft/2020-12/json-schema-validation.html#rfc.section.6.4
289
- */
290
-
291
- get maxItems() {
292
- return this.get('maxItems');
293
- }
294
- set maxItems(maxItems) {
295
- this.set('maxItems', maxItems);
296
- }
297
- get minItems() {
298
- return this.get('minItems');
299
- }
300
- set minItems(minItems) {
301
- this.set('minItems', minItems);
302
- }
303
- get uniqueItems() {
304
- return this.get('uniqueItems');
305
- }
306
- set uniqueItems(uniqueItems) {
307
- this.set('uniqueItems', uniqueItems);
308
- }
309
- get maxContains() {
310
- return this.get('maxContains');
311
- }
312
- set maxContains(maxContains) {
313
- this.set('maxContains', maxContains);
314
- }
315
- get minContains() {
316
- return this.get('minContains');
317
- }
318
- set minContains(minContains) {
319
- this.set('minContains', minContains);
320
- }
321
-
322
- /**
323
- * Validation Keywords for Objects
324
- *
325
- * URI: https://json-schema.org/draft/2020-12/json-schema-validation.html#rfc.section.6.5
326
- */
327
-
328
- get maxProperties() {
329
- return this.get('maxProperties');
330
- }
331
- set maxProperties(maxProperties) {
332
- this.set('maxProperties', maxProperties);
333
- }
334
- get minProperties() {
335
- return this.get('minProperties');
336
- }
337
- set minProperties(minProperties) {
338
- this.set('minProperties', minProperties);
339
- }
340
- get required() {
341
- return this.get('required');
342
- }
343
- set required(required) {
344
- this.set('required', required);
345
- }
346
- get dependentRequired() {
347
- return this.get('dependentRequired');
348
- }
349
- set dependentRequired(dependentRequired) {
350
- this.set('dependentRequired', dependentRequired);
351
- }
352
-
353
- /**
354
- * Vocabulary for Basic Meta-Data Annotations
355
- *
356
- * URI: https://json-schema.org/draft/2020-12/vocab/meta-data
357
- */
358
-
359
- get title() {
360
- return this.get('title');
361
- }
362
- set title(title) {
363
- this.set('title', title);
364
- }
365
- get description() {
366
- return this.get('description');
367
- }
368
- set description(description) {
369
- this.set('description', description);
370
- }
371
- get default() {
372
- return this.get('default');
373
- }
374
- set default(defaultVal) {
375
- this.set('default', defaultVal);
376
- }
377
- get deprecated() {
378
- return this.get('deprecated');
379
- }
380
- set deprecated(deprecated) {
381
- this.set('deprecated', deprecated);
382
- }
383
- get readOnly() {
384
- return this.get('readOnly');
385
- }
386
- set readOnly(readOnly) {
387
- this.set('readOnly', readOnly);
388
- }
389
- get writeOnly() {
390
- return this.get('writeOnly');
391
- }
392
- set writeOnly(writeOnly) {
393
- this.set('writeOnly', writeOnly);
394
- }
395
- get examples() {
396
- return this.get('examples');
397
- }
398
- set examples(examples) {
399
- this.set('examples', examples);
400
- }
401
-
402
- /**
403
- * Vocabularies for Semantic Content With "format"
404
- *
405
- * URI: https://json-schema.org/draft/2020-12/vocab/format-annotation
406
- */
407
-
408
- get format() {
409
- return this.get('format');
410
- }
411
- set format(format) {
412
- this.set('format', format);
413
- }
414
-
415
- /**
416
- * Vocabulary for the Contents of String-Encoded Data
417
- *
418
- * URI: https://json-schema.org/draft/2020-12/vocab/content
419
- */
420
-
421
- get contentEncoding() {
422
- return this.get('contentEncoding');
423
- }
424
- set contentEncoding(contentEncoding) {
425
- this.set('contentEncoding', contentEncoding);
426
- }
427
- get contentMediaType() {
428
- return this.get('contentMediaType');
429
- }
430
- set contentMediaType(contentMediaType) {
431
- this.set('contentMediaType', contentMediaType);
432
- }
433
- get contentSchema() {
434
- return this.get('contentSchema');
435
- }
436
- set contentSchema(contentSchema) {
437
- this.set('contentSchema', contentSchema);
438
- }
439
-
440
15
  /**
441
16
  * OAS base vocabulary
442
17
  *