@swagger-api/apidom-ns-openapi-3-1 0.76.0 → 0.76.1
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 +4 -0
- package/cjs/refractor/plugins/normalize-header-examples.cjs +2 -2
- package/cjs/refractor/plugins/normalize-operation-ids.cjs +1 -1
- package/cjs/refractor/plugins/normalize-parameter-examples.cjs +2 -2
- package/cjs/refractor/plugins/normalize-security-requirements.cjs +1 -1
- package/cjs/refractor/plugins/normalize-servers.cjs +1 -1
- package/cjs/refractor/plugins/replace-empty-element.cjs +2 -2
- package/cjs/refractor/visitors/open-api-3-1/schema/index.cjs +2 -2
- package/dist/apidom-ns-openapi-3-1.browser.js +988 -84
- package/dist/apidom-ns-openapi-3-1.browser.min.js +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
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.76.1](https://github.com/swagger-api/apidom/compare/v0.76.0...v0.76.1) (2023-09-07)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @swagger-api/apidom-ns-openapi-3-1
|
|
9
|
+
|
|
6
10
|
# [0.76.0](https://github.com/swagger-api/apidom/compare/v0.75.0...v0.76.0) (2023-09-01)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @swagger-api/apidom-ns-openapi-3-1
|
|
@@ -33,7 +33,7 @@ const plugin = () => ({
|
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
// Schema contains no example
|
|
36
|
-
if (typeof ((_headerElement$schema = headerElement.schema)
|
|
36
|
+
if (typeof ((_headerElement$schema = headerElement.schema) == null ? void 0 : _headerElement$schema.example) === 'undefined' && typeof ((_headerElement$schema2 = headerElement.schema) == null ? void 0 : _headerElement$schema2.examples) === 'undefined') {
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -45,7 +45,7 @@ const plugin = () => ({
|
|
|
45
45
|
// @ts-ignore
|
|
46
46
|
const examples = headerElement.examples.map(example => {
|
|
47
47
|
var _example$value;
|
|
48
|
-
return (_example$value = example.value)
|
|
48
|
+
return (_example$value = example.value) == null ? void 0 : _example$value.clone();
|
|
49
49
|
});
|
|
50
50
|
if (typeof headerElement.schema.examples !== 'undefined') {
|
|
51
51
|
headerElement.schema.set('examples', examples);
|
|
@@ -81,7 +81,7 @@ const plugin = ({
|
|
|
81
81
|
|
|
82
82
|
// Link Object doesn't need to be rectified
|
|
83
83
|
if (typeof operationElement === 'undefined') return;
|
|
84
|
-
linkElement.operationId = (_operationElement$ope = operationElement.operationId)
|
|
84
|
+
linkElement.operationId = (_operationElement$ope = operationElement.operationId) == null ? void 0 : _operationElement$ope.clone();
|
|
85
85
|
linkElement.meta.set('originalOperationId', linkOperationId);
|
|
86
86
|
linkElement.set('__originalOperationId', linkOperationId);
|
|
87
87
|
});
|
|
@@ -33,7 +33,7 @@ const plugin = () => ({
|
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
// Schema contains no example
|
|
36
|
-
if (typeof ((_parameterElement$sch = parameterElement.schema)
|
|
36
|
+
if (typeof ((_parameterElement$sch = parameterElement.schema) == null ? void 0 : _parameterElement$sch.example) === 'undefined' && typeof ((_parameterElement$sch2 = parameterElement.schema) == null ? void 0 : _parameterElement$sch2.examples) === 'undefined') {
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -45,7 +45,7 @@ const plugin = () => ({
|
|
|
45
45
|
// @ts-ignore
|
|
46
46
|
const examples = parameterElement.examples.map(example => {
|
|
47
47
|
var _example$value;
|
|
48
|
-
return (_example$value = example.value)
|
|
48
|
+
return (_example$value = example.value) == null ? void 0 : _example$value.clone();
|
|
49
49
|
});
|
|
50
50
|
if (typeof parameterElement.schema.examples !== 'undefined') {
|
|
51
51
|
parameterElement.schema.set('examples', examples);
|
|
@@ -40,7 +40,7 @@ const plugin = () => ({
|
|
|
40
40
|
const hasTopLevelSecurity = typeof topLevelSecurity !== 'undefined';
|
|
41
41
|
if (missingOperationLevelSecurity && hasTopLevelSecurity) {
|
|
42
42
|
var _topLevelSecurity;
|
|
43
|
-
operationElement.security = new _apidomNsOpenapi.OperationSecurityElement((_topLevelSecurity = topLevelSecurity)
|
|
43
|
+
operationElement.security = new _apidomNsOpenapi.OperationSecurityElement((_topLevelSecurity = topLevelSecurity) == null ? void 0 : _topLevelSecurity.content);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -28,7 +28,7 @@ const plugin = () => ({
|
|
|
28
28
|
enter(openapiElement) {
|
|
29
29
|
if (predicates.isArrayElement(openapiElement.servers)) {
|
|
30
30
|
var _openapiElement$serve;
|
|
31
|
-
openAPIServers = (_openapiElement$serve = openapiElement.servers)
|
|
31
|
+
openAPIServers = (_openapiElement$serve = openapiElement.servers) == null ? void 0 : _openapiElement$serve.content;
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
leave() {
|
|
@@ -625,9 +625,9 @@ const schema = {
|
|
|
625
625
|
}
|
|
626
626
|
};
|
|
627
627
|
const findElementFactory = (ancestor, keyName) => {
|
|
628
|
-
var _ancestor$classes$fir
|
|
628
|
+
var _ancestor$classes$fir;
|
|
629
629
|
const elementType = (0, _visitor.getNodeType)(ancestor); // @ts-ignore
|
|
630
|
-
const keyMapping = schema[elementType] || schema[(_ancestor$classes$fir = ancestor.classes.first)
|
|
630
|
+
const keyMapping = schema[elementType] || schema[(_ancestor$classes$fir = ancestor.classes.first) == null || _ancestor$classes$fir.toValue == null ? void 0 : _ancestor$classes$fir.toValue()];
|
|
631
631
|
return typeof keyMapping === 'undefined' ? undefined : Object.prototype.hasOwnProperty.call(keyMapping, '[key: *]') ? keyMapping['[key: *]'] : keyMapping[keyName];
|
|
632
632
|
};
|
|
633
633
|
const plugin = () => ({
|
|
@@ -47,7 +47,7 @@ const SchemaVisitor = (0, _stampit.default)(_apidomNsOpenapi.FixedFieldsVisitor,
|
|
|
47
47
|
} else if ((0, _predicates.isSchemaElement)(this.parent) && !(0, _apidomCore.isStringElement)(objectElement.get('$schema'))) {
|
|
48
48
|
var _this$parent$meta$get, _this$parent$$schema;
|
|
49
49
|
// parent is available and no $schema is defined, set parent $schema
|
|
50
|
-
const inherited$schema = (0, _ramda.defaultTo)((_this$parent$meta$get = this.parent.meta.get('inherited$schema'))
|
|
50
|
+
const inherited$schema = (0, _ramda.defaultTo)((_this$parent$meta$get = this.parent.meta.get('inherited$schema')) == null ? void 0 : _this$parent$meta$get.toValue(), (_this$parent$$schema = this.parent.$schema) == null ? void 0 : _this$parent$$schema.toValue());
|
|
51
51
|
this.element.setMetaProperty('inherited$schema', inherited$schema);
|
|
52
52
|
}
|
|
53
53
|
};
|
|
@@ -57,7 +57,7 @@ const SchemaVisitor = (0, _stampit.default)(_apidomNsOpenapi.FixedFieldsVisitor,
|
|
|
57
57
|
// fetch parent's inherited$id
|
|
58
58
|
const inherited$id = this.parent !== null ? this.parent.getMetaProperty('inherited$id', []).clone() : new _apidomCore.ArrayElement();
|
|
59
59
|
// get current $id keyword
|
|
60
|
-
const $id = (_objectElement$get = objectElement.get('$id'))
|
|
60
|
+
const $id = (_objectElement$get = objectElement.get('$id')) == null ? void 0 : _objectElement$get.toValue();
|
|
61
61
|
|
|
62
62
|
// remember $id keyword if it's a non empty strings
|
|
63
63
|
if ((0, _ramdaAdjunct.isNonEmptyString)($id)) {
|