@speclynx/apidom-ns-openapi-2 3.1.0 → 3.2.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 +12 -0
- package/dist/apidom-ns-openapi-2.browser.js +25 -29
- package/dist/apidom-ns-openapi-2.browser.min.js +1 -1
- package/package.json +20 -7
- package/src/refractor/visitors/open-api-2/path-item/index.cjs +2 -3
- package/src/refractor/visitors/open-api-2/path-item/index.mjs +3 -4
- package/src/refractor/visitors/open-api-2/paths/index.cjs +2 -2
- package/src/refractor/visitors/open-api-2/paths/index.mjs +2 -2
- package/src/refractor/visitors/open-api-2/responses/index.cjs +2 -3
- package/src/refractor/visitors/open-api-2/responses/index.mjs +2 -3
package/package.json
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@speclynx/apidom-ns-openapi-2",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "OpenAPI 2.0 namespace for ApiDOM.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"apidom",
|
|
7
|
+
"api",
|
|
8
|
+
"openapi",
|
|
9
|
+
"openapi2",
|
|
10
|
+
"swagger",
|
|
11
|
+
"oas",
|
|
12
|
+
"types",
|
|
13
|
+
"spec",
|
|
14
|
+
"specification",
|
|
15
|
+
"typescript",
|
|
16
|
+
"javascript"
|
|
17
|
+
],
|
|
5
18
|
"publishConfig": {
|
|
6
19
|
"access": "public",
|
|
7
20
|
"registry": "https://registry.npmjs.org",
|
|
@@ -43,11 +56,11 @@
|
|
|
43
56
|
"license": "Apache-2.0",
|
|
44
57
|
"dependencies": {
|
|
45
58
|
"@babel/runtime-corejs3": "^7.28.4",
|
|
46
|
-
"@speclynx/apidom-core": "3.1
|
|
47
|
-
"@speclynx/apidom-datamodel": "3.1
|
|
48
|
-
"@speclynx/apidom-error": "3.1
|
|
49
|
-
"@speclynx/apidom-ns-json-schema-draft-4": "3.1
|
|
50
|
-
"@speclynx/apidom-traverse": "3.1
|
|
59
|
+
"@speclynx/apidom-core": "3.2.1",
|
|
60
|
+
"@speclynx/apidom-datamodel": "3.2.1",
|
|
61
|
+
"@speclynx/apidom-error": "3.2.1",
|
|
62
|
+
"@speclynx/apidom-ns-json-schema-draft-4": "3.2.1",
|
|
63
|
+
"@speclynx/apidom-traverse": "3.2.1",
|
|
51
64
|
"ramda": "~0.32.0",
|
|
52
65
|
"ramda-adjunct": "^6.0.0",
|
|
53
66
|
"ts-mixer": "^6.0.4"
|
|
@@ -62,5 +75,5 @@
|
|
|
62
75
|
"README.md",
|
|
63
76
|
"CHANGELOG.md"
|
|
64
77
|
],
|
|
65
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "83a1e97089ef29134e41ff7cacd351973114ea5b"
|
|
66
79
|
}
|
|
@@ -26,9 +26,8 @@ class PathItemVisitor extends _bases.BaseFixedFieldsVisitor {
|
|
|
26
26
|
this.element.filter(_predicates.isOperationElement)
|
|
27
27
|
// @ts-ignore
|
|
28
28
|
.forEach((operationElement, httpMethodElementCI) => {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
operationElement.meta.set('http-method', httpMethodElementCS);
|
|
29
|
+
const httpMethod = (0, _apidomCore.toValue)(httpMethodElementCI).toUpperCase();
|
|
30
|
+
operationElement.meta.set('http-method', httpMethod);
|
|
32
31
|
});
|
|
33
32
|
|
|
34
33
|
// mark this PathItemElement with reference metadata
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { always } from 'ramda';
|
|
2
|
-
import { isStringElement
|
|
2
|
+
import { isStringElement } from '@speclynx/apidom-datamodel';
|
|
3
3
|
import { toValue } from '@speclynx/apidom-core';
|
|
4
4
|
import PathItemElement from "../../../../elements/PathItem.mjs";
|
|
5
5
|
import { isOperationElement } from "../../../../predicates.mjs";
|
|
@@ -21,9 +21,8 @@ class PathItemVisitor extends BaseFixedFieldsVisitor {
|
|
|
21
21
|
this.element.filter(isOperationElement)
|
|
22
22
|
// @ts-ignore
|
|
23
23
|
.forEach((operationElement, httpMethodElementCI) => {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
operationElement.meta.set('http-method', httpMethodElementCS);
|
|
24
|
+
const httpMethod = toValue(httpMethodElementCI).toUpperCase();
|
|
25
|
+
operationElement.meta.set('http-method', httpMethod);
|
|
27
26
|
});
|
|
28
27
|
|
|
29
28
|
// mark this PathItemElement with reference metadata
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
|
|
|
4
4
|
exports.__esModule = true;
|
|
5
5
|
exports.default = void 0;
|
|
6
6
|
var _ramda = require("ramda");
|
|
7
|
-
var
|
|
7
|
+
var _apidomCore = require("@speclynx/apidom-core");
|
|
8
8
|
var _Paths = _interopRequireDefault(require("../../../../elements/Paths.cjs"));
|
|
9
9
|
var _predicates = require("../../../../predicates.cjs");
|
|
10
10
|
var _bases = require("../bases.cjs");
|
|
@@ -30,7 +30,7 @@ class PathsVisitor extends _bases.BasePatternedFieldsVisitor {
|
|
|
30
30
|
.forEach((pathItemElement, key) => {
|
|
31
31
|
key.classes.push('openapi-path-template');
|
|
32
32
|
key.classes.push('path-template');
|
|
33
|
-
pathItemElement.meta.set('path', (0,
|
|
33
|
+
pathItemElement.meta.set('path', (0, _apidomCore.toValue)(key));
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { T as stubTrue, always } from 'ramda';
|
|
2
|
-
import {
|
|
2
|
+
import { toValue } from '@speclynx/apidom-core';
|
|
3
3
|
import PathsElement from "../../../../elements/Paths.mjs";
|
|
4
4
|
import { isPathItemElement } from "../../../../predicates.mjs";
|
|
5
5
|
import { BasePatternedFieldsVisitor } from "../bases.mjs";
|
|
@@ -25,7 +25,7 @@ class PathsVisitor extends BasePatternedFieldsVisitor {
|
|
|
25
25
|
.forEach((pathItemElement, key) => {
|
|
26
26
|
key.classes.push('openapi-path-template');
|
|
27
27
|
key.classes.push('path-template');
|
|
28
|
-
pathItemElement.meta.set('path',
|
|
28
|
+
pathItemElement.meta.set('path', toValue(key));
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -4,7 +4,6 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
|
|
|
4
4
|
exports.__esModule = true;
|
|
5
5
|
exports.default = void 0;
|
|
6
6
|
var _ramda = require("ramda");
|
|
7
|
-
var _apidomDatamodel = require("@speclynx/apidom-datamodel");
|
|
8
7
|
var _apidomCore = require("@speclynx/apidom-core");
|
|
9
8
|
var _Responses = _interopRequireDefault(require("../../../../elements/Responses.cjs"));
|
|
10
9
|
var _predicates = require("../../../predicates.cjs");
|
|
@@ -37,8 +36,8 @@ class ResponsesVisitor extends _bases.BaseMixedFieldsVisitor {
|
|
|
37
36
|
// decorate every ResponseElement with metadata about their status code
|
|
38
37
|
// @ts-ignore
|
|
39
38
|
this.element.filter(_predicates2.isResponseElement).forEach((value, key) => {
|
|
40
|
-
const httpStatusCode = (0,
|
|
41
|
-
if (!this.fieldPatternPredicate(
|
|
39
|
+
const httpStatusCode = (0, _apidomCore.toValue)(key);
|
|
40
|
+
if (!this.fieldPatternPredicate(httpStatusCode)) return;
|
|
42
41
|
value.meta.set('http-status-code', httpStatusCode);
|
|
43
42
|
});
|
|
44
43
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { test, always, range } from 'ramda';
|
|
2
|
-
import { cloneDeep } from '@speclynx/apidom-datamodel';
|
|
3
2
|
import { toValue } from '@speclynx/apidom-core';
|
|
4
3
|
import ResponsesElement from "../../../../elements/Responses.mjs";
|
|
5
4
|
import { isReferenceLikeElement } from "../../../predicates.mjs";
|
|
@@ -32,8 +31,8 @@ class ResponsesVisitor extends BaseMixedFieldsVisitor {
|
|
|
32
31
|
// decorate every ResponseElement with metadata about their status code
|
|
33
32
|
// @ts-ignore
|
|
34
33
|
this.element.filter(isResponseElement).forEach((value, key) => {
|
|
35
|
-
const httpStatusCode =
|
|
36
|
-
if (!this.fieldPatternPredicate(
|
|
34
|
+
const httpStatusCode = toValue(key);
|
|
35
|
+
if (!this.fieldPatternPredicate(httpStatusCode)) return;
|
|
37
36
|
value.meta.set('http-status-code', httpStatusCode);
|
|
38
37
|
});
|
|
39
38
|
}
|