@swagger-api/apidom-ns-openapi-2 0.94.0 → 0.96.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 +18 -0
- package/cjs/refractor/index.cjs +2 -2
- package/cjs/refractor/visitors/SpecificationVisitor.cjs +1 -8
- package/cjs/refractor/visitors/Visitor.cjs +11 -4
- package/dist/apidom-ns-openapi-2.browser.js +2429 -2294
- package/dist/apidom-ns-openapi-2.browser.min.js +1 -1
- package/es/refractor/index.mjs +2 -2
- package/es/refractor/visitors/SpecificationVisitor.mjs +1 -8
- package/es/refractor/visitors/Visitor.mjs +12 -5
- package/package.json +5 -5
- package/types/dist.d.ts +99 -33
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
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
|
+
# [0.96.0](https://github.com/swagger-api/apidom/compare/v0.95.0...v0.96.0) (2024-02-28)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **ns-ads:** retain meta & attributes during refracting ([#3857](https://github.com/swagger-api/apidom/issues/3857)) ([333550e](https://github.com/swagger-api/apidom/commit/333550ea0e77d4bf363938902b2646ead56e332a)), closes [#3842](https://github.com/swagger-api/apidom/issues/3842)
|
|
11
|
+
- **ns-json-schema:** retain meta & attributes during refracting ([#3862](https://github.com/swagger-api/apidom/issues/3862)) ([99c3eb8](https://github.com/swagger-api/apidom/commit/99c3eb813e41bb47b059545052363f8e6018123c)), closes [#3842](https://github.com/swagger-api/apidom/issues/3842)
|
|
12
|
+
- **ns-openapi-2:** retain meta & attributes during refracting ([#3844](https://github.com/swagger-api/apidom/issues/3844)) ([b243110](https://github.com/swagger-api/apidom/commit/b2431100adc7f8179a9ca0859ca757d8c7edc9e1)), closes [#3842](https://github.com/swagger-api/apidom/issues/3842)
|
|
13
|
+
|
|
14
|
+
# [0.95.0](https://github.com/swagger-api/apidom/compare/v0.94.0...v0.95.0) (2024-02-09)
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
- allow refracting semantic ApiDOM ([#3798](https://github.com/swagger-api/apidom/issues/3798)) ([9d58bec](https://github.com/swagger-api/apidom/commit/9d58beccbaee4c7ff7eaccbb419be9a463cbc62e)), closes [#3756](https://github.com/swagger-api/apidom/issues/3756)
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
- **ns-openapi-2:** export new symbols and types ([#3800](https://github.com/swagger-api/apidom/issues/3800)) ([41bf5c3](https://github.com/swagger-api/apidom/commit/41bf5c34354dda9cdcc3a0f9114472b7822c33c6)), closes [#3776](https://github.com/swagger-api/apidom/issues/3776)
|
|
23
|
+
|
|
6
24
|
# [0.94.0](https://github.com/swagger-api/apidom/compare/v0.93.0...v0.94.0) (2024-02-05)
|
|
7
25
|
|
|
8
26
|
**Note:** Version bump only for package @swagger-api/apidom-ns-openapi-2
|
package/cjs/refractor/index.cjs
CHANGED
|
@@ -20,8 +20,8 @@ const refract = (value, {
|
|
|
20
20
|
* We don't allow consumers to hook into this translation.
|
|
21
21
|
* Though we allow consumers to define their onw plugins on already transformed ApiDOM.
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
24
|
-
const rootVisitor = new
|
|
23
|
+
const RootVisitorClass = (0, _ramda.path)(specPath, resolvedSpec);
|
|
24
|
+
const rootVisitor = new RootVisitorClass({
|
|
25
25
|
specObj: resolvedSpec
|
|
26
26
|
});
|
|
27
27
|
(0, _apidomCore.visit)(element, rootVisitor);
|
|
@@ -6,7 +6,6 @@ exports.default = void 0;
|
|
|
6
6
|
var _ramda = require("ramda");
|
|
7
7
|
var _ramdaAdjunct = require("ramda-adjunct");
|
|
8
8
|
var _apidomCore = require("@swagger-api/apidom-core");
|
|
9
|
-
var _visitor = require("../../traversal/visitor.cjs");
|
|
10
9
|
var _Visitor = _interopRequireDefault(require("./Visitor.cjs"));
|
|
11
10
|
var _FallbackVisitor = _interopRequireDefault(require("./FallbackVisitor.cjs"));
|
|
12
11
|
/**
|
|
@@ -64,13 +63,7 @@ class SpecificationVisitor extends _Visitor.default {
|
|
|
64
63
|
if (visitor instanceof _FallbackVisitor.default && (visitor == null ? void 0 : visitor.constructor) === _FallbackVisitor.default) {
|
|
65
64
|
return (0, _apidomCore.cloneDeep)(element);
|
|
66
65
|
}
|
|
67
|
-
|
|
68
|
-
// @ts-ignore
|
|
69
|
-
(0, _apidomCore.visit)(element, visitor, {
|
|
70
|
-
keyMap: _visitor.keyMap,
|
|
71
|
-
nodeTypeGetter: _visitor.getNodeType,
|
|
72
|
-
...options
|
|
73
|
-
});
|
|
66
|
+
(0, _apidomCore.visit)(element, visitor, options);
|
|
74
67
|
return visitor.element;
|
|
75
68
|
}
|
|
76
69
|
}
|
|
@@ -9,12 +9,19 @@ class Visitor {
|
|
|
9
9
|
Object.assign(this, options);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
/* eslint-disable class-methods-use-this, no-param-reassign */
|
|
13
13
|
copyMetaAndAttributes(from, to) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
if (from.meta.length > 0 || to.meta.length > 0) {
|
|
15
|
+
to.meta = (0, _apidomCore.deepmerge)(to.meta, from.meta);
|
|
16
|
+
if ((0, _apidomCore.hasElementSourceMap)(from)) {
|
|
17
|
+
// avoid deep merging of source maps
|
|
18
|
+
to.meta.set('sourceMap', from.meta.get('sourceMap'));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
if (from.attributes.length > 0 || from.meta.length > 0) {
|
|
22
|
+
to.attributes = (0, _apidomCore.deepmerge)(to.attributes, from.attributes); // eslint-disable-line no-param-reassign
|
|
17
23
|
}
|
|
18
24
|
}
|
|
25
|
+
/* eslint-enable class-methods-use-this, no-param-reassign */
|
|
19
26
|
}
|
|
20
27
|
var _default = exports.default = Visitor;
|