@speclynx/apidom-parser-adapter-openapi-yaml-2 2.2.3 → 2.3.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 +6 -0
- package/dist/apidom-parser-adapter-openapi-yaml-2.browser.js +38 -12
- package/dist/apidom-parser-adapter-openapi-yaml-2.browser.min.js +1 -1
- package/package.json +6 -6
- package/src/adapter.cjs +4 -1
- package/src/adapter.mjs +5 -1
- package/types/apidom-parser-adapter-openapi-yaml-2.d.ts +12 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@speclynx/apidom-parser-adapter-openapi-yaml-2",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Parser adapter for parsing YAML documents into OpenAPI 2.0 namespace.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"license": "Apache-2.0",
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@babel/runtime-corejs3": "^7.28.4",
|
|
42
|
-
"@speclynx/apidom-core": "^2.
|
|
43
|
-
"@speclynx/apidom-datamodel": "^2.
|
|
44
|
-
"@speclynx/apidom-ns-openapi-2": "^2.
|
|
45
|
-
"@speclynx/apidom-parser-adapter-yaml-1-2": "^2.
|
|
42
|
+
"@speclynx/apidom-core": "^2.3.0",
|
|
43
|
+
"@speclynx/apidom-datamodel": "^2.3.0",
|
|
44
|
+
"@speclynx/apidom-ns-openapi-2": "^2.3.0",
|
|
45
|
+
"@speclynx/apidom-parser-adapter-yaml-1-2": "^2.3.0",
|
|
46
46
|
"ramda": "~0.32.0",
|
|
47
47
|
"ramda-adjunct": "^6.0.0"
|
|
48
48
|
},
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"README.md",
|
|
57
57
|
"CHANGELOG.md"
|
|
58
58
|
],
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "b561fa09e688f1d9b1968b8353f32ddad9a4a803"
|
|
60
60
|
}
|
package/src/adapter.cjs
CHANGED
|
@@ -19,12 +19,15 @@ const detectionRegExp = exports.detectionRegExp = /(?<YAML>^(["']?)swagger\2\s*:
|
|
|
19
19
|
/**
|
|
20
20
|
* @public
|
|
21
21
|
*/
|
|
22
|
-
const detect = async source => detectionRegExp.test(source) && (await (0, _apidomParserAdapterYaml.detect)(source));
|
|
22
|
+
const detect = async (source, options = {}) => detectionRegExp.test(source) && (await (0, _apidomParserAdapterYaml.detect)(source, options));
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* @public
|
|
26
26
|
*/
|
|
27
27
|
exports.detect = detect;
|
|
28
|
+
/**
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
28
31
|
const parse = async (source, options = {}) => {
|
|
29
32
|
const refractorOpts = (0, _ramda.propOr)({}, 'refractorOpts', options);
|
|
30
33
|
const parserOpts = (0, _ramda.omit)(['refractorOpts'], options);
|
package/src/adapter.mjs
CHANGED
|
@@ -12,7 +12,11 @@ export const detectionRegExp = /(?<YAML>^(["']?)swagger\2\s*:\s*(["'])(?<version
|
|
|
12
12
|
/**
|
|
13
13
|
* @public
|
|
14
14
|
*/
|
|
15
|
-
export const detect = async source => detectionRegExp.test(source) && (await detectYAML(source));
|
|
15
|
+
export const detect = async (source, options = {}) => detectionRegExp.test(source) && (await detectYAML(source, options));
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
16
20
|
|
|
17
21
|
/**
|
|
18
22
|
* @public
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { detect as detect_2 } from '@speclynx/apidom-parser-adapter-yaml-1-2';
|
|
1
2
|
import { Namespace } from '@speclynx/apidom-datamodel';
|
|
2
3
|
import { OpenAPIMediaTypes } from '@speclynx/apidom-ns-openapi-2';
|
|
3
|
-
import {
|
|
4
|
+
import { parse as parse_2 } from '@speclynx/apidom-parser-adapter-yaml-1-2';
|
|
5
|
+
import { ParseOptions as ParseOptions_2 } from '@speclynx/apidom-parser-adapter-yaml-1-2';
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* @public
|
|
7
9
|
*/
|
|
8
|
-
export declare const detect:
|
|
10
|
+
export declare const detect: typeof detect_2;
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* @public
|
|
@@ -25,6 +27,13 @@ export declare const namespace: Namespace;
|
|
|
25
27
|
/**
|
|
26
28
|
* @public
|
|
27
29
|
*/
|
|
28
|
-
export declare const parse:
|
|
30
|
+
export declare const parse: typeof parse_2;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export declare interface ParseOptions extends ParseOptions_2 {
|
|
36
|
+
refractorOpts?: Record<string, unknown>;
|
|
37
|
+
}
|
|
29
38
|
|
|
30
39
|
export { }
|