@speclynx/apidom-ns-openapi-3-1 1.12.2 → 2.1.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.
- package/CHANGELOG.md +25 -0
- package/NOTICE +16 -7
- package/README.md +16 -29
- package/dist/apidom-ns-openapi-3-1.browser.js +13422 -14424
- package/dist/apidom-ns-openapi-3-1.browser.min.js +1 -1
- package/package.json +11 -11
- package/src/elements/JsonSchemaDialect.cjs +2 -2
- package/src/elements/JsonSchemaDialect.mjs +1 -1
- package/src/elements/OpenApi3-1.cjs +2 -2
- package/src/elements/OpenApi3-1.mjs +1 -1
- package/src/elements/PathItem.cjs +24 -24
- package/src/elements/PathItem.mjs +24 -24
- package/src/elements/nces/ComponentsPathItems.cjs +2 -2
- package/src/elements/nces/ComponentsPathItems.mjs +1 -1
- package/src/elements/nces/Webhooks.cjs +2 -2
- package/src/elements/nces/Webhooks.mjs +1 -1
- package/src/index.cjs +73 -49
- package/src/index.mjs +6 -3
- package/src/namespace.cjs +0 -1
- package/src/predicates.cjs +56 -187
- package/src/predicates.mjs +29 -186
- package/src/refractor/index.cjs +338 -17
- package/src/refractor/index.mjs +305 -16
- package/src/refractor/inspect.cjs +207 -0
- package/src/refractor/inspect.mjs +171 -0
- package/src/refractor/plugins/normalize-header-examples/NormalizeStorage.cjs +5 -5
- package/src/refractor/plugins/normalize-header-examples/NormalizeStorage.mjs +1 -1
- package/src/refractor/plugins/normalize-header-examples/index.cjs +11 -7
- package/src/refractor/plugins/normalize-header-examples/index.mjs +8 -4
- package/src/refractor/plugins/normalize-operation-ids.cjs +13 -6
- package/src/refractor/plugins/normalize-operation-ids.mjs +13 -6
- package/src/refractor/plugins/normalize-parameter-examples.cjs +11 -7
- package/src/refractor/plugins/normalize-parameter-examples.mjs +8 -4
- package/src/refractor/plugins/normalize-parameters.cjs +11 -5
- package/src/refractor/plugins/normalize-parameters.mjs +11 -5
- package/src/refractor/plugins/normalize-security-requirements.cjs +8 -4
- package/src/refractor/plugins/normalize-security-requirements.mjs +8 -4
- package/src/refractor/plugins/normalize-servers.cjs +15 -9
- package/src/refractor/plugins/normalize-servers.mjs +15 -9
- package/src/refractor/plugins/replace-empty-element.cjs +32 -30
- package/src/refractor/plugins/replace-empty-element.mjs +16 -15
- package/src/refractor/predicates.cjs +36 -0
- package/src/refractor/predicates.mjs +31 -0
- package/src/refractor/specification.cjs +43 -4
- package/src/refractor/specification.mjs +43 -4
- package/src/refractor/toolbox.cjs +12 -21
- package/src/refractor/toolbox.mjs +9 -16
- package/src/refractor/visitors/open-api-3-1/JsonSchemaDialectVisitor.cjs +5 -5
- package/src/refractor/visitors/open-api-3-1/JsonSchemaDialectVisitor.mjs +6 -6
- package/src/refractor/visitors/open-api-3-1/OpenapiVisitor.cjs +25 -0
- package/src/refractor/visitors/open-api-3-1/OpenapiVisitor.mjs +19 -0
- package/src/refractor/visitors/open-api-3-1/WebhooksVisitor.cjs +4 -5
- package/src/refractor/visitors/open-api-3-1/WebhooksVisitor.mjs +5 -6
- package/src/refractor/visitors/open-api-3-1/bases.cjs +46 -0
- package/src/refractor/visitors/open-api-3-1/bases.mjs +43 -0
- package/src/refractor/visitors/open-api-3-1/callback/index.cjs +2 -3
- package/src/refractor/visitors/open-api-3-1/callback/index.mjs +2 -3
- package/src/refractor/visitors/open-api-3-1/components/PathItemsVisitor.cjs +4 -5
- package/src/refractor/visitors/open-api-3-1/components/PathItemsVisitor.mjs +5 -6
- package/src/refractor/visitors/open-api-3-1/components/SchemasVisitor.cjs +2 -2
- package/src/refractor/visitors/open-api-3-1/components/SchemasVisitor.mjs +3 -5
- package/src/refractor/visitors/open-api-3-1/index.cjs +5 -4
- package/src/refractor/visitors/open-api-3-1/index.mjs +6 -5
- package/src/refractor/visitors/open-api-3-1/schema/index.cjs +11 -10
- package/src/refractor/visitors/open-api-3-1/schema/index.mjs +12 -11
- package/types/apidom-ns-openapi-3-1.d.ts +435 -274
- package/src/refractor/registration.cjs +0 -102
- package/src/refractor/registration.mjs +0 -66
- package/src/traversal/visitor.cjs +0 -57
- package/src/traversal/visitor.mjs +0 -54
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,31 @@
|
|
|
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
|
+
# [2.1.0](https://github.com/speclynx/apidom/compare/v2.0.1...v2.1.0) (2026-01-17)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @speclynx/apidom-ns-openapi-3-1
|
|
9
|
+
|
|
10
|
+
## [2.0.1](https://github.com/speclynx/apidom/compare/v2.0.0...v2.0.1) (2026-01-14)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @speclynx/apidom-ns-openapi-3-1
|
|
13
|
+
|
|
14
|
+
# [2.0.0](https://github.com/speclynx/apidom/compare/v1.12.2...v2.0.0) (2026-01-14)
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
- limit source maps memory consuption ([#20](https://github.com/speclynx/apidom/issues/20)) ([4a0574f](https://github.com/speclynx/apidom/commit/4a0574fd6d466be7c33c8a5871baacd384918d22))
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
- apply innovations learned during last 3 years ([#11](https://github.com/speclynx/apidom/issues/11)) ([cfdbbfc](https://github.com/speclynx/apidom/commit/cfdbbfc2721b0dadc77eeba31dd4e8768c078d22))
|
|
23
|
+
- **traverse:** move traverse operations to apidom-traverse package ([#18](https://github.com/speclynx/apidom/issues/18)) ([36c9d49](https://github.com/speclynx/apidom/commit/36c9d490ceac2ea961e2b23fbbc72df7fb54bbf3))
|
|
24
|
+
|
|
25
|
+
### BREAKING CHANGES
|
|
26
|
+
|
|
27
|
+
- source maps have been completely rewritten
|
|
28
|
+
- **traverse:** move traverse operations from core to traverse package
|
|
29
|
+
- breaking changes introduced to every package public API
|
|
30
|
+
|
|
6
31
|
## [1.12.2](https://github.com/speclynx/apidom/compare/v1.12.1...v1.12.2) (2025-12-23)
|
|
7
32
|
|
|
8
33
|
**Note:** Version bump only for package @speclynx/apidom-ns-openapi-3-1
|
package/NOTICE
CHANGED
|
@@ -5,11 +5,6 @@ This distribution includes modifications by SpecLynx.
|
|
|
5
5
|
All such modifications are licensed under the Apache License, Version 2.0.
|
|
6
6
|
A copy of the Apache 2.0 license can be found in `LICENSES/Apache-2.0.txt`.
|
|
7
7
|
|
|
8
|
-
ApiDOM
|
|
9
|
-
Copyright 2020 SmartBear Software Inc.
|
|
10
|
-
ApiDOM is licensed under Apache 2.0 license.
|
|
11
|
-
Copy of the Apache 2.0 license can be found in `LICENSES/Apache-2.0.txt` file.
|
|
12
|
-
|
|
13
8
|
json-schema-ref-parser
|
|
14
9
|
Copyright (c) 2015 James Messinger
|
|
15
10
|
File packages/apidom-reference/src/util/url.ts (the file) was originally created under MIT license in https://github.com/APIDevTools/json-schema-ref-parser repository.
|
|
@@ -18,8 +13,8 @@ Copy of the MIT license can be found in `LICENSES/MIT.txt` file.
|
|
|
18
13
|
|
|
19
14
|
graphql-js
|
|
20
15
|
Copyright (c) GraphQL Contributors
|
|
21
|
-
File packages/apidom-
|
|
22
|
-
|
|
16
|
+
File packages/apidom-traverse/src/traversal.ts (the file) was originally inspired by https://github.com/graphql/graphql-js repository.
|
|
17
|
+
All modifications are licensed under Apache 2.0 License.
|
|
23
18
|
Copy of the MIT license can be found in `LICENSES/MIT.txt` file.
|
|
24
19
|
|
|
25
20
|
babel-plugin-add-import-extension
|
|
@@ -54,6 +49,20 @@ Copyright (c) 2012 James Halliday, Josh Duff, and other contributors
|
|
|
54
49
|
Copy of the MIT license can be found in `LICENSES/MIT.txt` file.
|
|
55
50
|
All modifications are licensed under Apache 2.0 License.
|
|
56
51
|
|
|
52
|
+
ApiDOM
|
|
53
|
+
Copyright 2020 SmartBear Software Inc.
|
|
54
|
+
ApiDOM is licensed under Apache 2.0 license.
|
|
55
|
+
Copy of the Apache 2.0 license can be found in `LICENSES/Apache-2.0.txt` file.
|
|
56
|
+
|
|
57
|
+
minim
|
|
58
|
+
Copyright (c) 2014 Stephen Mizell
|
|
59
|
+
The apidom-datamodel package contains code originally created under the MIT
|
|
60
|
+
License as part of the Minim project (https://github.com/refractproject/minim).
|
|
61
|
+
This code has been copied into this project and modified.
|
|
62
|
+
The original portions remain licensed under the MIT License. Our modifications
|
|
63
|
+
to that code are licensed under the Apache License 2.0.
|
|
64
|
+
Copy of the MIT license can be found in `LICENSES/MIT.txt` file.
|
|
65
|
+
|
|
57
66
|
---
|
|
58
67
|
|
|
59
68
|
If the SPDX-FileCopyrightText and SPDX-License-Identifier tags are not present in the file,
|
package/README.md
CHANGED
|
@@ -14,25 +14,12 @@ You can install this package via [npm CLI](https://docs.npmjs.com/cli) by runnin
|
|
|
14
14
|
$ npm install @speclynx/apidom-ns-openapi-3-1
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
## OpenAPI 3.1.
|
|
17
|
+
## OpenAPI 3.1.x namespace
|
|
18
18
|
|
|
19
|
-
OpenAPI 3.1.
|
|
20
|
-
of [primitive ones](https://github.com/
|
|
19
|
+
OpenAPI 3.1.x namespace consists of [number of elements](https://github.com/speclynx/apidom/tree/main/packages/apidom-ns-openapi-3-1/src/elements) implemented on top
|
|
20
|
+
of [primitive ones](https://github.com/speclynx/apidom/tree/main/packages/apidom-datamodel/src/primitives).
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
import { createNamespace } from '@speclynx/apidom-core';
|
|
24
|
-
import openApi3_1Namespace from '@speclynx/apidom-ns-openapi-3-1';
|
|
25
|
-
|
|
26
|
-
const namespace = createNamespace(openApi3_1Namespace);
|
|
27
|
-
|
|
28
|
-
const objectElement = new namespace.elements.Object();
|
|
29
|
-
const openApiElement = new namespace.elements.OpenApi3_1();
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
When namespace instance is created in this way, it will extend the base namespace
|
|
33
|
-
with the namespace provided as an argument.
|
|
34
|
-
|
|
35
|
-
Elements from the namespace can also be used directly by importing them.
|
|
22
|
+
Elements from the namespace can be used directly by importing them.
|
|
36
23
|
|
|
37
24
|
```js
|
|
38
25
|
import { OpenApi3_1Element, InfoElement } from '@speclynx/apidom-ns-openapi-3-1';
|
|
@@ -56,23 +43,23 @@ isOpenApi3_1Element(openApiElement); // => true
|
|
|
56
43
|
|
|
57
44
|
## Traversal
|
|
58
45
|
|
|
59
|
-
Traversing ApiDOM in this namespace is possible by using `
|
|
60
|
-
This package comes with its own [
|
|
61
|
-
To learn more about these `
|
|
46
|
+
Traversing ApiDOM in this namespace is possible by using `traverse` function from `@speclynx/apidom-traverse` package.
|
|
47
|
+
This package comes with its own [nodeTypeGetter](https://github.com/speclynx/apidom/blob/main/packages/apidom-ns-openapi-3-1/src/traversal/visitor.ts#L4).
|
|
48
|
+
To learn more about these `traverse` configuration options please refer to [@speclynx/apidom-traverse documentation](https://github.com/speclynx/apidom/blob/main/packages/apidom-traverse/README.md).
|
|
62
49
|
|
|
63
50
|
```js
|
|
64
|
-
import {
|
|
65
|
-
import { OpenApi3_1Element
|
|
51
|
+
import { traverse, getNodePrimitiveType } from '@speclynx/apidom-traverse';
|
|
52
|
+
import { OpenApi3_1Element } from '@speclynx/apidom-ns-openapi-3-1';
|
|
66
53
|
|
|
67
54
|
const element = new OpenApi3_1Element();
|
|
68
55
|
|
|
69
56
|
const visitor = {
|
|
70
|
-
OpenApi3_1Element(
|
|
71
|
-
console.dir(
|
|
57
|
+
OpenApi3_1Element(path) {
|
|
58
|
+
console.dir(path.node);
|
|
72
59
|
},
|
|
73
60
|
};
|
|
74
61
|
|
|
75
|
-
|
|
62
|
+
traverse(element, visitor, { nodeTypeGetter: getNodePrimitiveType });
|
|
76
63
|
```
|
|
77
64
|
|
|
78
65
|
## Refractors
|
|
@@ -97,7 +84,7 @@ InfoElement.refract(object); // => InfoElement({ title, description, version })
|
|
|
97
84
|
**Refracting generic ApiDOM structures**:
|
|
98
85
|
|
|
99
86
|
```js
|
|
100
|
-
import { ObjectElement } from '@speclynx/apidom-
|
|
87
|
+
import { ObjectElement } from '@speclynx/apidom-datamodel';
|
|
101
88
|
import { InfoElement } from '@speclynx/apidom-ns-openapi-3-1';
|
|
102
89
|
|
|
103
90
|
const objectElement = new ObjectElement({
|
|
@@ -114,7 +101,7 @@ InfoElement.refract(objectElement); // => InfoElement({ title = 'my title', desc
|
|
|
114
101
|
Refractors can accept plugins as a second argument of refract static method.
|
|
115
102
|
|
|
116
103
|
```js
|
|
117
|
-
import { ObjectElement } from '@speclynx/apidom-
|
|
104
|
+
import { ObjectElement } from '@speclynx/apidom-datamodel';
|
|
118
105
|
import { InfoElement } from '@speclynx/apidom-ns-openapi-3-1';
|
|
119
106
|
|
|
120
107
|
const objectElement = new ObjectElement({
|
|
@@ -129,8 +116,8 @@ const plugin = ({ predicates, namespace }) => ({
|
|
|
129
116
|
console.dir('runs before traversal');
|
|
130
117
|
},
|
|
131
118
|
visitor: {
|
|
132
|
-
InfoElement(
|
|
133
|
-
|
|
119
|
+
InfoElement(path) {
|
|
120
|
+
path.node.version = '2.0.0';
|
|
134
121
|
},
|
|
135
122
|
},
|
|
136
123
|
post() {
|