@swagger-api/apidom-ns-openapi-2 0.95.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 CHANGED
@@ -3,6 +3,14 @@
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
+
6
14
  # [0.95.0](https://github.com/swagger-api/apidom/compare/v0.94.0...v0.95.0) (2024-02-09)
7
15
 
8
16
  ### Bug Fixes
@@ -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 RootVistorClass = (0, _ramda.path)(specPath, resolvedSpec);
24
- const rootVisitor = new RootVistorClass({
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);
@@ -9,12 +9,19 @@ class Visitor {
9
9
  Object.assign(this, options);
10
10
  }
11
11
 
12
- // eslint-disable-next-line class-methods-use-this
12
+ /* eslint-disable class-methods-use-this, no-param-reassign */
13
13
  copyMetaAndAttributes(from, to) {
14
- // copy sourcemaps
15
- if ((0, _apidomCore.hasElementSourceMap)(from)) {
16
- to.meta.set('sourceMap', from.meta.get('sourceMap'));
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;