@speclynx/apidom-parser-adapter-openapi-json-3-0 2.2.3 → 2.4.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 +10 -0
- package/dist/apidom-parser-adapter-openapi-json-3-0.browser.js +13 -7
- package/dist/apidom-parser-adapter-openapi-json-3-0.browser.min.js +1 -1
- package/package.json +7 -7
- package/src/adapter.cjs +4 -1
- package/src/adapter.mjs +5 -1
- package/types/apidom-parser-adapter-openapi-json-3-0.d.ts +12 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@speclynx/apidom-parser-adapter-openapi-json-3-0",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Parser adapter for parsing JSON documents into OpenAPI 3.0.x namespace.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"lint": "eslint ./",
|
|
26
26
|
"lint:fix": "eslint ./ --fix",
|
|
27
27
|
"clean": "rimraf --glob 'src/**/*.mjs' 'src/**/*.cjs' 'test/**/*.mjs' ./dist ./types",
|
|
28
|
-
"typescript:check-types": "tsc --noEmit
|
|
28
|
+
"typescript:check-types": "tsc --noEmit",
|
|
29
29
|
"typescript:declaration": "tsc -p tsconfig.declaration.json && api-extractor run -l -c ./config/api-extractor/api-extractor.json",
|
|
30
30
|
"test": "npm run build:es && cross-env BABEL_ENV=es babel test --out-dir test --extensions '.ts' --out-file-extension '.mjs' --root-mode 'upward' && cross-env NODE_ENV=test mocha",
|
|
31
31
|
"prepack": "copyfiles -u 3 ../../LICENSES/* LICENSES && copyfiles -u 2 ../../NOTICE .",
|
|
@@ -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-3-0": "^2.
|
|
45
|
-
"@speclynx/apidom-parser-adapter-json": "^2.
|
|
42
|
+
"@speclynx/apidom-core": "^2.4.0",
|
|
43
|
+
"@speclynx/apidom-datamodel": "^2.4.0",
|
|
44
|
+
"@speclynx/apidom-ns-openapi-3-0": "^2.4.0",
|
|
45
|
+
"@speclynx/apidom-parser-adapter-json": "^2.4.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": "f127ee0b98cc108b83a690bf317895e17a32b4d4"
|
|
60
60
|
}
|
package/src/adapter.cjs
CHANGED
|
@@ -19,12 +19,15 @@ const detectionRegExp = exports.detectionRegExp = /"openapi"\s*:\s*"(?<version_j
|
|
|
19
19
|
/**
|
|
20
20
|
* @public
|
|
21
21
|
*/
|
|
22
|
-
const detect = async source => detectionRegExp.test(source) && (await (0, _apidomParserAdapterJson.detect)(source));
|
|
22
|
+
const detect = async (source, options = {}) => detectionRegExp.test(source) && (await (0, _apidomParserAdapterJson.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 = /"openapi"\s*:\s*"(?<version_json>3\.0\.(?:[1-9]\
|
|
|
12
12
|
/**
|
|
13
13
|
* @public
|
|
14
14
|
*/
|
|
15
|
-
export const detect = async source => detectionRegExp.test(source) && (await detectJSON(source));
|
|
15
|
+
export const detect = async (source, options = {}) => detectionRegExp.test(source) && (await detectJSON(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-json';
|
|
1
2
|
import { Namespace } from '@speclynx/apidom-datamodel';
|
|
2
3
|
import { OpenAPIMediaTypes } from '@speclynx/apidom-ns-openapi-3-0';
|
|
3
|
-
import {
|
|
4
|
+
import { parse as parse_2 } from '@speclynx/apidom-parser-adapter-json';
|
|
5
|
+
import { ParseOptions as ParseOptions_2 } from '@speclynx/apidom-parser-adapter-json';
|
|
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 { }
|