@swagger-api/apidom-ns-json-schema-draft-6 1.0.0-beta.9 → 1.0.0-rc.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 +184 -0
- package/README.md +1 -1
- package/dist/apidom-ns-json-schema-draft-6.browser.js +1 -1
- package/package.json +8 -8
- package/src/index.cjs +7 -3
- package/src/index.mjs +2 -0
- package/src/refractor/plugins/replace-empty-element.cjs +2 -1
- package/src/refractor/plugins/replace-empty-element.mjs +3 -2
- package/src/refractor/visitors/json-schema/ItemsVisitor.cjs +1 -22
- package/src/refractor/visitors/json-schema/ItemsVisitor.mjs +3 -25
- package/src/refractor/visitors/json-schema/index.cjs +3 -21
- package/src/refractor/visitors/json-schema/index.mjs +4 -21
- package/src/refractor/visitors/json-schema/link-description/index.cjs +1 -8
- package/src/refractor/visitors/json-schema/link-description/index.mjs +2 -8
- package/src/traversal/visitor.cjs +2 -11
- package/src/traversal/visitor.mjs +2 -11
- package/types/apidom-ns-json-schema-draft-6.d.ts +20 -38
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swagger-api/apidom-ns-json-schema-draft-6",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-rc.1",
|
|
4
4
|
"description": "JSON Schema Draft 6 namespace for ApiDOM.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"build:umd:browser": "cross-env BABEL_ENV=browser webpack --config config/webpack/browser.config.js --progress",
|
|
27
27
|
"lint": "eslint ./",
|
|
28
28
|
"lint:fix": "eslint ./ --fix",
|
|
29
|
-
"clean": "rimraf --glob 'src/**/*.mjs' 'src/**/*.cjs'
|
|
30
|
-
"test": "
|
|
29
|
+
"clean": "rimraf --glob 'src/**/*.mjs' 'src/**/*.cjs' ./dist ./types",
|
|
30
|
+
"test": "NODE_ENV=test ts-mocha --exit",
|
|
31
31
|
"test:update-snapshots": "cross-env UPDATE_SNAPSHOT=1 mocha",
|
|
32
32
|
"typescript:check-types": "tsc --noEmit && tsc -p ./test/tsconfig.json --noEmit",
|
|
33
33
|
"typescript:declaration": "tsc -p tsconfig.declaration.json && api-extractor run -l -c ./config/api-extractor/api-extractor.json 2>&1 | shx grep -v 'Visitor_base'",
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"author": "Vladimir Gorej",
|
|
42
42
|
"license": "Apache-2.0",
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@babel/runtime-corejs3": "^7.
|
|
45
|
-
"@swagger-api/apidom-core": "^1.0.0-
|
|
46
|
-
"@swagger-api/apidom-error": "^1.0.0-
|
|
47
|
-
"@swagger-api/apidom-ns-json-schema-draft-4": "^1.0.0-
|
|
44
|
+
"@babel/runtime-corejs3": "^7.26.10",
|
|
45
|
+
"@swagger-api/apidom-core": "^1.0.0-rc.1",
|
|
46
|
+
"@swagger-api/apidom-error": "^1.0.0-rc.1",
|
|
47
|
+
"@swagger-api/apidom-ns-json-schema-draft-4": "^1.0.0-rc.1",
|
|
48
48
|
"@types/ramda": "~0.30.0",
|
|
49
49
|
"ramda": "~0.30.0",
|
|
50
50
|
"ramda-adjunct": "^5.0.0",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"README.md",
|
|
61
61
|
"CHANGELOG.md"
|
|
62
62
|
],
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "e08fdf4c8a8070453c33066cc50f4e949fc4bd20"
|
|
64
64
|
}
|
package/src/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
4
|
var _interopRequireWildcard = require("@babel/runtime-corejs3/helpers/interopRequireWildcard").default;
|
|
5
5
|
exports.__esModule = true;
|
|
6
|
-
exports.specificationObj = exports.refractorPluginReplaceEmptyElement = exports.refract = exports.mediaTypes = exports.keyMap = exports.isStringElement = exports.isRefElement = exports.isObjectElement = exports.isNumberElement = exports.isNullElement = exports.isMemberElement = exports.isMediaElement = exports.isLinkElement = exports.isLinkDescriptionElement = exports.isJSONSchemaElement = exports.isJSONReferenceLikeElement = exports.isJSONReferenceElement = exports.isElement = exports.isBooleanElement = exports.isArrayElement = exports.getNodeType = exports.default = exports.createRefractor = exports.Visitor = exports.SpecificationVisitor = exports.PatternedFieldsVisitor = exports.ParentSchemaAwareVisitor = exports.MediaElement = exports.MapVisitor = exports.LinkDescriptionElement = exports.JSONSchemaVisitor = exports.JSONSchemaElement = exports.JSONSchemaDraft6MediaTypes = exports.JSONReferenceElement = exports.FixedFieldsVisitor = exports.FallbackVisitor = exports.AlternatingVisitor = void 0;
|
|
6
|
+
exports.specificationObj = exports.refractorPluginReplaceEmptyElement = exports.refract = exports.mediaTypes = exports.keyMap = exports.isStringElement = exports.isRefElement = exports.isObjectElement = exports.isNumberElement = exports.isNullElement = exports.isMemberElement = exports.isMediaElement = exports.isLinkElement = exports.isLinkDescriptionElement = exports.isJSONSchemaElement = exports.isJSONReferenceLikeElement = exports.isJSONReferenceElement = exports.isElement = exports.isBooleanElement = exports.isArrayElement = exports.getNodeType = exports.default = exports.createRefractor = exports.Visitor = exports.SpecificationVisitor = exports.PatternedFieldsVisitor = exports.ParentSchemaAwareVisitor = exports.MediaElement = exports.MapVisitor = exports.LinkDescriptionVisitor = exports.LinkDescriptionElement = exports.JSONSchemaVisitor = exports.JSONSchemaElement = exports.JSONSchemaDraft6MediaTypes = exports.JSONReferenceElement = exports.ItemsVisitor = exports.FixedFieldsVisitor = exports.FallbackVisitor = exports.AlternatingVisitor = void 0;
|
|
7
7
|
var _apidomCore = require("@swagger-api/apidom-core");
|
|
8
8
|
exports.isRefElement = _apidomCore.isRefElement;
|
|
9
9
|
exports.isLinkElement = _apidomCore.isLinkElement;
|
|
@@ -44,8 +44,12 @@ exports.ParentSchemaAwareVisitor = _apidomNsJsonSchemaDraft.ParentSchemaAwareVis
|
|
|
44
44
|
exports.Visitor = _apidomNsJsonSchemaDraft.Visitor;
|
|
45
45
|
exports.JSONReferenceElement = _apidomNsJsonSchemaDraft.JSONReferenceElement;
|
|
46
46
|
exports.MediaElement = _apidomNsJsonSchemaDraft.MediaElement;
|
|
47
|
-
var _index2 = _interopRequireDefault(require("./refractor/visitors/json-schema/index.cjs"));
|
|
48
|
-
exports.
|
|
47
|
+
var _index2 = _interopRequireDefault(require("./refractor/visitors/json-schema/link-description/index.cjs"));
|
|
48
|
+
exports.LinkDescriptionVisitor = _index2.default;
|
|
49
|
+
var _index3 = _interopRequireDefault(require("./refractor/visitors/json-schema/index.cjs"));
|
|
50
|
+
exports.JSONSchemaVisitor = _index3.default;
|
|
51
|
+
var _ItemsVisitor = _interopRequireDefault(require("./refractor/visitors/json-schema/ItemsVisitor.cjs"));
|
|
52
|
+
exports.ItemsVisitor = _ItemsVisitor.default;
|
|
49
53
|
var _visitor = require("./traversal/visitor.cjs");
|
|
50
54
|
exports.keyMap = _visitor.keyMap;
|
|
51
55
|
exports.getNodeType = _visitor.getNodeType;
|
package/src/index.mjs
CHANGED
|
@@ -7,7 +7,9 @@ export { default as refract, createRefractor } from "./refractor/index.mjs";
|
|
|
7
7
|
export { default as specificationObj } from "./refractor/specification.mjs";
|
|
8
8
|
export { isJSONReferenceElement, isJSONSchemaElement, isLinkDescriptionElement, isMediaElement } from "./predicates.mjs";
|
|
9
9
|
export { isJSONReferenceLikeElement, SpecificationVisitor, FallbackVisitor, FixedFieldsVisitor, PatternedFieldsVisitor, MapVisitor, AlternatingVisitor, ParentSchemaAwareVisitor, Visitor } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
10
|
+
export { default as LinkDescriptionVisitor } from "./refractor/visitors/json-schema/link-description/index.mjs";
|
|
10
11
|
export { default as JSONSchemaVisitor } from "./refractor/visitors/json-schema/index.mjs";
|
|
12
|
+
export { default as ItemsVisitor } from "./refractor/visitors/json-schema/ItemsVisitor.mjs";
|
|
11
13
|
export { keyMap, getNodeType } from "./traversal/visitor.mjs";
|
|
12
14
|
/**
|
|
13
15
|
* JSON Schema Draft 6 specification elements.
|
|
@@ -205,9 +205,10 @@ const plugin = () => () => ({
|
|
|
205
205
|
|
|
206
206
|
// no element factory found
|
|
207
207
|
if (typeof elementFactory !== 'function') return undefined;
|
|
208
|
-
|
|
208
|
+
const result = elementFactory.call({
|
|
209
209
|
context
|
|
210
210
|
}, undefined, (0, _apidomCore.cloneDeep)(element.meta), (0, _apidomCore.cloneDeep)(element.attributes));
|
|
211
|
+
return (0, _apidomCore.assignSourceMap)(result, element);
|
|
211
212
|
}
|
|
212
213
|
}
|
|
213
214
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ArrayElement, ObjectElement, isStringElement, isArrayElement, isElement, isMemberElement, includesClasses, cloneDeep, toValue } from '@swagger-api/apidom-core';
|
|
1
|
+
import { ArrayElement, ObjectElement, isStringElement, isArrayElement, isElement, isMemberElement, includesClasses, cloneDeep, toValue, assignSourceMap } from '@swagger-api/apidom-core';
|
|
2
2
|
/**
|
|
3
3
|
* JSON Schema Draft 6 specification elements.
|
|
4
4
|
*/
|
|
@@ -198,9 +198,10 @@ const plugin = () => () => ({
|
|
|
198
198
|
|
|
199
199
|
// no element factory found
|
|
200
200
|
if (typeof elementFactory !== 'function') return undefined;
|
|
201
|
-
|
|
201
|
+
const result = elementFactory.call({
|
|
202
202
|
context
|
|
203
203
|
}, undefined, cloneDeep(element.meta), cloneDeep(element.attributes));
|
|
204
|
+
return assignSourceMap(result, element);
|
|
204
205
|
}
|
|
205
206
|
}
|
|
206
207
|
});
|
|
@@ -2,33 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
|
-
var _tsMixer = require("ts-mixer");
|
|
6
5
|
var _apidomCore = require("@swagger-api/apidom-core");
|
|
7
6
|
var _apidomNsJsonSchemaDraft = require("@swagger-api/apidom-ns-json-schema-draft-4");
|
|
8
7
|
/**
|
|
9
8
|
* @public
|
|
10
9
|
*/
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
class ItemsVisitor extends (0, _tsMixer.Mixin)(_apidomNsJsonSchemaDraft.SpecificationVisitor, _apidomNsJsonSchemaDraft.ParentSchemaAwareVisitor, _apidomNsJsonSchemaDraft.FallbackVisitor) {
|
|
16
|
-
ObjectElement(objectElement) {
|
|
17
|
-
const specPath = (0, _apidomNsJsonSchemaDraft.isJSONReferenceLikeElement)(objectElement) ? ['document', 'objects', 'JSONReference'] : ['document', 'objects', 'JSONSchema'];
|
|
18
|
-
this.element = this.toRefractedElement(specPath, objectElement);
|
|
19
|
-
return _apidomCore.BREAK;
|
|
20
|
-
}
|
|
21
|
-
ArrayElement(arrayElement) {
|
|
22
|
-
this.element = new _apidomCore.ArrayElement();
|
|
23
|
-
this.element.classes.push('json-schema-items');
|
|
24
|
-
arrayElement.forEach(item => {
|
|
25
|
-
const specPath = (0, _apidomNsJsonSchemaDraft.isJSONReferenceLikeElement)(item) ? ['document', 'objects', 'JSONReference'] : ['document', 'objects', 'JSONSchema'];
|
|
26
|
-
const element = this.toRefractedElement(specPath, item);
|
|
27
|
-
this.element.push(element);
|
|
28
|
-
});
|
|
29
|
-
this.copyMetaAndAttributes(arrayElement, this.element);
|
|
30
|
-
return _apidomCore.BREAK;
|
|
31
|
-
}
|
|
10
|
+
class ItemsVisitor extends _apidomNsJsonSchemaDraft.ItemsVisitor {
|
|
32
11
|
BooleanElement(booleanElement) {
|
|
33
12
|
this.element = this.toRefractedElement(['document', 'objects', 'JSONSchema'], booleanElement);
|
|
34
13
|
return _apidomCore.BREAK;
|
|
@@ -1,31 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { SpecificationVisitor, FallbackVisitor, ParentSchemaAwareVisitor, isJSONReferenceLikeElement } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
4
|
-
|
|
1
|
+
import { BREAK } from '@swagger-api/apidom-core';
|
|
2
|
+
import { ItemsVisitor as JSONSchemaDraft4ItemsVisitor } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
5
3
|
/**
|
|
6
4
|
* @public
|
|
7
5
|
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
class ItemsVisitor extends Mixin(SpecificationVisitor, ParentSchemaAwareVisitor, FallbackVisitor) {
|
|
13
|
-
ObjectElement(objectElement) {
|
|
14
|
-
const specPath = isJSONReferenceLikeElement(objectElement) ? ['document', 'objects', 'JSONReference'] : ['document', 'objects', 'JSONSchema'];
|
|
15
|
-
this.element = this.toRefractedElement(specPath, objectElement);
|
|
16
|
-
return BREAK;
|
|
17
|
-
}
|
|
18
|
-
ArrayElement(arrayElement) {
|
|
19
|
-
this.element = new ArrayElement();
|
|
20
|
-
this.element.classes.push('json-schema-items');
|
|
21
|
-
arrayElement.forEach(item => {
|
|
22
|
-
const specPath = isJSONReferenceLikeElement(item) ? ['document', 'objects', 'JSONReference'] : ['document', 'objects', 'JSONSchema'];
|
|
23
|
-
const element = this.toRefractedElement(specPath, item);
|
|
24
|
-
this.element.push(element);
|
|
25
|
-
});
|
|
26
|
-
this.copyMetaAndAttributes(arrayElement, this.element);
|
|
27
|
-
return BREAK;
|
|
28
|
-
}
|
|
6
|
+
class ItemsVisitor extends JSONSchemaDraft4ItemsVisitor {
|
|
29
7
|
BooleanElement(booleanElement) {
|
|
30
8
|
this.element = this.toRefractedElement(['document', 'objects', 'JSONSchema'], booleanElement);
|
|
31
9
|
return BREAK;
|
|
@@ -3,46 +3,28 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
4
|
exports.__esModule = true;
|
|
5
5
|
exports.default = void 0;
|
|
6
|
-
var _tsMixer = require("ts-mixer");
|
|
7
|
-
var _ramda = require("ramda");
|
|
8
6
|
var _apidomNsJsonSchemaDraft = require("@swagger-api/apidom-ns-json-schema-draft-4");
|
|
9
7
|
var _JSONSchema = _interopRequireDefault(require("../../../elements/JSONSchema.cjs"));
|
|
10
8
|
/**
|
|
11
9
|
* @public
|
|
12
10
|
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
17
|
-
class JSONSchemaVisitor extends (0, _tsMixer.Mixin)(_apidomNsJsonSchemaDraft.FixedFieldsVisitor, _apidomNsJsonSchemaDraft.ParentSchemaAwareVisitor, _apidomNsJsonSchemaDraft.FallbackVisitor) {
|
|
11
|
+
class JSONSchemaVisitor extends _apidomNsJsonSchemaDraft.JSONSchemaVisitor {
|
|
18
12
|
constructor(options) {
|
|
19
13
|
super(options);
|
|
20
|
-
this.
|
|
14
|
+
this.element = new _JSONSchema.default();
|
|
21
15
|
}
|
|
22
16
|
|
|
23
17
|
// eslint-disable-next-line class-methods-use-this
|
|
24
18
|
get defaultDialectIdentifier() {
|
|
25
19
|
return 'http://json-schema.org/draft-06/schema#';
|
|
26
20
|
}
|
|
27
|
-
ObjectElement(objectElement) {
|
|
28
|
-
this.element = new _JSONSchema.default();
|
|
29
|
-
this.handleDialectIdentifier(objectElement);
|
|
30
|
-
this.handleSchemaIdentifier(objectElement);
|
|
31
|
-
|
|
32
|
-
// for further processing consider this Schema Element as parent for all embedded Schema Elements
|
|
33
|
-
this.parent = this.element;
|
|
34
|
-
return _apidomNsJsonSchemaDraft.FixedFieldsVisitor.prototype.ObjectElement.call(this, objectElement);
|
|
35
|
-
}
|
|
36
21
|
BooleanElement(booleanElement) {
|
|
37
22
|
const result = this.enter(booleanElement);
|
|
38
23
|
this.element.classes.push('boolean-json-schema');
|
|
39
24
|
return result;
|
|
40
25
|
}
|
|
41
|
-
handleDialectIdentifier(objectElement) {
|
|
42
|
-
return _apidomNsJsonSchemaDraft.JSONSchemaVisitor.prototype.handleDialectIdentifier.call(this, objectElement);
|
|
43
|
-
}
|
|
44
26
|
handleSchemaIdentifier(objectElement, identifierKeyword = '$id') {
|
|
45
|
-
return
|
|
27
|
+
return super.handleSchemaIdentifier(objectElement, identifierKeyword);
|
|
46
28
|
}
|
|
47
29
|
}
|
|
48
30
|
var _default = exports.default = JSONSchemaVisitor;
|
|
@@ -1,42 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { always } from 'ramda';
|
|
3
|
-
import { FixedFieldsVisitor, ParentSchemaAwareVisitor, FallbackVisitor, JSONSchemaVisitor as JSONSchemaDraft4Visitor } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
1
|
+
import { JSONSchemaVisitor as JSONSchemaDraft4Visitor } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
4
2
|
import JSONSchemaElement from "../../../elements/JSONSchema.mjs";
|
|
5
3
|
/**
|
|
6
4
|
* @public
|
|
7
5
|
*/
|
|
8
|
-
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
class JSONSchemaVisitor extends Mixin(FixedFieldsVisitor, ParentSchemaAwareVisitor, FallbackVisitor) {
|
|
6
|
+
class JSONSchemaVisitor extends JSONSchemaDraft4Visitor {
|
|
12
7
|
constructor(options) {
|
|
13
8
|
super(options);
|
|
14
|
-
this.
|
|
9
|
+
this.element = new JSONSchemaElement();
|
|
15
10
|
}
|
|
16
11
|
|
|
17
12
|
// eslint-disable-next-line class-methods-use-this
|
|
18
13
|
get defaultDialectIdentifier() {
|
|
19
14
|
return 'http://json-schema.org/draft-06/schema#';
|
|
20
15
|
}
|
|
21
|
-
ObjectElement(objectElement) {
|
|
22
|
-
this.element = new JSONSchemaElement();
|
|
23
|
-
this.handleDialectIdentifier(objectElement);
|
|
24
|
-
this.handleSchemaIdentifier(objectElement);
|
|
25
|
-
|
|
26
|
-
// for further processing consider this Schema Element as parent for all embedded Schema Elements
|
|
27
|
-
this.parent = this.element;
|
|
28
|
-
return FixedFieldsVisitor.prototype.ObjectElement.call(this, objectElement);
|
|
29
|
-
}
|
|
30
16
|
BooleanElement(booleanElement) {
|
|
31
17
|
const result = this.enter(booleanElement);
|
|
32
18
|
this.element.classes.push('boolean-json-schema');
|
|
33
19
|
return result;
|
|
34
20
|
}
|
|
35
|
-
handleDialectIdentifier(objectElement) {
|
|
36
|
-
return JSONSchemaDraft4Visitor.prototype.handleDialectIdentifier.call(this, objectElement);
|
|
37
|
-
}
|
|
38
21
|
handleSchemaIdentifier(objectElement, identifierKeyword = '$id') {
|
|
39
|
-
return
|
|
22
|
+
return super.handleSchemaIdentifier(objectElement, identifierKeyword);
|
|
40
23
|
}
|
|
41
24
|
}
|
|
42
25
|
export default JSONSchemaVisitor;
|
|
@@ -3,22 +3,15 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
4
|
exports.__esModule = true;
|
|
5
5
|
exports.default = void 0;
|
|
6
|
-
var _tsMixer = require("ts-mixer");
|
|
7
|
-
var _ramda = require("ramda");
|
|
8
6
|
var _apidomNsJsonSchemaDraft = require("@swagger-api/apidom-ns-json-schema-draft-4");
|
|
9
7
|
var _LinkDescription = _interopRequireDefault(require("../../../../elements/LinkDescription.cjs"));
|
|
10
8
|
/**
|
|
11
9
|
* @public
|
|
12
10
|
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
17
|
-
class LinkDescriptionVisitor extends (0, _tsMixer.Mixin)(_apidomNsJsonSchemaDraft.FixedFieldsVisitor, _apidomNsJsonSchemaDraft.FallbackVisitor) {
|
|
11
|
+
class LinkDescriptionVisitor extends _apidomNsJsonSchemaDraft.LinkDescriptionVisitor {
|
|
18
12
|
constructor(options) {
|
|
19
13
|
super(options);
|
|
20
14
|
this.element = new _LinkDescription.default();
|
|
21
|
-
this.specPath = (0, _ramda.always)(['document', 'objects', 'LinkDescription']);
|
|
22
15
|
}
|
|
23
16
|
}
|
|
24
17
|
var _default = exports.default = LinkDescriptionVisitor;
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { always } from 'ramda';
|
|
3
|
-
import { FixedFieldsVisitor, FallbackVisitor } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
1
|
+
import { LinkDescriptionVisitor as JSONSchemaDraft4LinkDescriptionVisitor } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
4
2
|
import LinkDescriptionElement from "../../../../elements/LinkDescription.mjs";
|
|
5
3
|
/**
|
|
6
4
|
* @public
|
|
7
5
|
*/
|
|
8
|
-
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
class LinkDescriptionVisitor extends Mixin(FixedFieldsVisitor, FallbackVisitor) {
|
|
6
|
+
class LinkDescriptionVisitor extends JSONSchemaDraft4LinkDescriptionVisitor {
|
|
12
7
|
constructor(options) {
|
|
13
8
|
super(options);
|
|
14
9
|
this.element = new LinkDescriptionElement();
|
|
15
|
-
this.specPath = always(['document', 'objects', 'LinkDescription']);
|
|
16
10
|
}
|
|
17
11
|
}
|
|
18
12
|
export default LinkDescriptionVisitor;
|
|
@@ -3,20 +3,11 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.keyMap = exports.getNodeType = void 0;
|
|
5
5
|
var _apidomCore = require("@swagger-api/apidom-core");
|
|
6
|
+
var _apidomNsJsonSchemaDraft = require("@swagger-api/apidom-ns-json-schema-draft-4");
|
|
7
|
+
exports.getNodeType = _apidomNsJsonSchemaDraft.getNodeType;
|
|
6
8
|
/**
|
|
7
9
|
* @public
|
|
8
10
|
*/
|
|
9
|
-
const getNodeType = element => {
|
|
10
|
-
if (!(0, _apidomCore.isElement)(element)) {
|
|
11
|
-
return undefined;
|
|
12
|
-
}
|
|
13
|
-
return `${element.element.charAt(0).toUpperCase() + element.element.slice(1)}Element`;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @public
|
|
18
|
-
*/
|
|
19
|
-
exports.getNodeType = getNodeType;
|
|
20
11
|
const keyMap = exports.keyMap = {
|
|
21
12
|
JSONSchemaDraft6Element: ['content'],
|
|
22
13
|
JSONReferenceElement: ['content'],
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import { keyMap as keyMapBase
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
6
|
-
export const getNodeType = element => {
|
|
7
|
-
if (!isElement(element)) {
|
|
8
|
-
return undefined;
|
|
9
|
-
}
|
|
10
|
-
return `${element.element.charAt(0).toUpperCase() + element.element.slice(1)}Element`;
|
|
11
|
-
};
|
|
1
|
+
import { keyMap as keyMapBase } from '@swagger-api/apidom-core';
|
|
2
|
+
export { getNodeType } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
12
3
|
|
|
13
4
|
/**
|
|
14
5
|
* @public
|
|
@@ -7,7 +7,6 @@ import { AnyOfVisitorOptions } from '@swagger-api/apidom-ns-json-schema-draft-4'
|
|
|
7
7
|
import { ArrayElement } from '@swagger-api/apidom-core';
|
|
8
8
|
import { Attributes } from '@swagger-api/apidom-core';
|
|
9
9
|
import { BooleanElement } from '@swagger-api/apidom-core';
|
|
10
|
-
import { Class } from 'ts-mixer/dist/types/types.js';
|
|
11
10
|
import { DefinitionsVisitor } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
12
11
|
import { DefinitionsVisitorOptions } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
13
12
|
import { DependenciesVisitor } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
@@ -19,6 +18,7 @@ import { FallbackVisitor } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
|
19
18
|
import { FallbackVisitorOptions } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
20
19
|
import { FixedFieldsVisitor } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
21
20
|
import { FixedFieldsVisitorOptions } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
21
|
+
import { getNodeType } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
22
22
|
import { isArrayElement } from '@swagger-api/apidom-core';
|
|
23
23
|
import { isBooleanElement } from '@swagger-api/apidom-core';
|
|
24
24
|
import { isElement } from '@swagger-api/apidom-core';
|
|
@@ -32,14 +32,17 @@ import { isNumberElement } from '@swagger-api/apidom-core';
|
|
|
32
32
|
import { isObjectElement } from '@swagger-api/apidom-core';
|
|
33
33
|
import { isRefElement } from '@swagger-api/apidom-core';
|
|
34
34
|
import { isStringElement } from '@swagger-api/apidom-core';
|
|
35
|
+
import { ItemsVisitorOptions } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
35
36
|
import { JSONReference$RefVisitor } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
36
37
|
import { JSONReferenceElement } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
37
38
|
import { JSONReferenceVisitor } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
38
39
|
import { ItemsVisitor as JSONSchemaDraft4ItemsVisitor } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
39
40
|
import { JSONSchemaElement as JSONSchemaElement_2 } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
40
41
|
import { JSONSchemaVisitor as JSONSchemaVisitor_2 } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
42
|
+
import { JSONSchemaVisitorOptions } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
41
43
|
import { LinkDescriptionElement as LinkDescriptionElement_2 } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
42
44
|
import { LinkDescriptionVisitor as LinkDescriptionVisitor_2 } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
45
|
+
import { LinkDescriptionVisitorOptions } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
43
46
|
import { LinksVisitor } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
44
47
|
import { MapVisitor } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
45
48
|
import { MapVisitorOptions } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
@@ -120,10 +123,7 @@ export { FixedFieldsVisitorOptions }
|
|
|
120
123
|
*/
|
|
121
124
|
export declare type Format = 'generic' | 'json' | 'yaml';
|
|
122
125
|
|
|
123
|
-
|
|
124
|
-
* @public
|
|
125
|
-
*/
|
|
126
|
-
export declare const getNodeType: <T extends Element_2>(element: T) => string | undefined;
|
|
126
|
+
export { getNodeType }
|
|
127
127
|
|
|
128
128
|
export { isArrayElement }
|
|
129
129
|
|
|
@@ -164,20 +164,11 @@ export { isStringElement }
|
|
|
164
164
|
/**
|
|
165
165
|
* @public
|
|
166
166
|
*/
|
|
167
|
-
export declare class ItemsVisitor extends
|
|
168
|
-
element: ObjectElement | ArrayElement;
|
|
169
|
-
ObjectElement(objectElement: ObjectElement): {};
|
|
170
|
-
ArrayElement(arrayElement: ArrayElement): {};
|
|
167
|
+
export declare class ItemsVisitor extends JSONSchemaDraft4ItemsVisitor {
|
|
171
168
|
BooleanElement(booleanElement: BooleanElement): {};
|
|
172
169
|
}
|
|
173
170
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* @public
|
|
178
|
-
*/
|
|
179
|
-
export declare interface ItemsVisitorOptions extends SpecificationVisitorOptions, ParentSchemaAwareVisitorOptions, FallbackVisitorOptions {
|
|
180
|
-
}
|
|
171
|
+
export { ItemsVisitorOptions }
|
|
181
172
|
|
|
182
173
|
export { JSONReferenceElement }
|
|
183
174
|
|
|
@@ -257,24 +248,15 @@ export declare class JSONSchemaElement extends JSONSchemaElement_2 {
|
|
|
257
248
|
/**
|
|
258
249
|
* @public
|
|
259
250
|
*/
|
|
260
|
-
export declare class JSONSchemaVisitor extends
|
|
251
|
+
export declare class JSONSchemaVisitor extends JSONSchemaVisitor_2 {
|
|
261
252
|
element: JSONSchemaElement;
|
|
262
|
-
protected readonly specPath: SpecPath<['document', 'objects', 'JSONSchema']>;
|
|
263
253
|
constructor(options: JSONSchemaVisitorOptions);
|
|
264
254
|
get defaultDialectIdentifier(): string;
|
|
265
|
-
ObjectElement(objectElement: ObjectElement): {};
|
|
266
255
|
BooleanElement(booleanElement: BooleanElement): {};
|
|
267
|
-
handleDialectIdentifier(objectElement: ObjectElement): void;
|
|
268
256
|
handleSchemaIdentifier(objectElement: ObjectElement, identifierKeyword?: string): void;
|
|
269
257
|
}
|
|
270
258
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
/**
|
|
274
|
-
* @public
|
|
275
|
-
*/
|
|
276
|
-
export declare interface JSONSchemaVisitorOptions extends FixedFieldsVisitorOptions, ParentSchemaAwareVisitorOptions, FallbackVisitorOptions {
|
|
277
|
-
}
|
|
259
|
+
export { JSONSchemaVisitorOptions }
|
|
278
260
|
|
|
279
261
|
/**
|
|
280
262
|
* @public
|
|
@@ -292,7 +274,6 @@ export declare const keyMap: {
|
|
|
292
274
|
Annotation: never[];
|
|
293
275
|
Comment: never[];
|
|
294
276
|
ParseResultElement: string[];
|
|
295
|
-
SourceMap: string[];
|
|
296
277
|
JSONSchemaDraft6Element: string[];
|
|
297
278
|
JSONReferenceElement: string[];
|
|
298
279
|
MediaElement: string[];
|
|
@@ -323,19 +304,12 @@ export declare class LinkDescriptionElement extends LinkDescriptionElement_2 {
|
|
|
323
304
|
/**
|
|
324
305
|
* @public
|
|
325
306
|
*/
|
|
326
|
-
export declare class LinkDescriptionVisitor extends
|
|
307
|
+
export declare class LinkDescriptionVisitor extends LinkDescriptionVisitor_2 {
|
|
327
308
|
readonly element: LinkDescriptionElement;
|
|
328
|
-
protected readonly specPath: SpecPath<['document', 'objects', 'LinkDescription']>;
|
|
329
309
|
constructor(options: LinkDescriptionVisitorOptions);
|
|
330
310
|
}
|
|
331
311
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
* @public
|
|
336
|
-
*/
|
|
337
|
-
export declare interface LinkDescriptionVisitorOptions extends FixedFieldsVisitorOptions, FallbackVisitorOptions {
|
|
338
|
-
}
|
|
312
|
+
export { LinkDescriptionVisitorOptions }
|
|
339
313
|
|
|
340
314
|
export { MapVisitor }
|
|
341
315
|
|
|
@@ -519,7 +493,15 @@ export declare const refract: <T extends Element_2>(value: unknown, { specPath,
|
|
|
519
493
|
*/
|
|
520
494
|
export declare const refractorPluginReplaceEmptyElement: () => () => {
|
|
521
495
|
visitor: {
|
|
522
|
-
StringElement(element: StringElement, key: any, parent: any, path: any, ancestors: any[]):
|
|
496
|
+
StringElement(element: StringElement, key: any, parent: any, path: any, ancestors: any[]): {
|
|
497
|
+
[key: string]: any;
|
|
498
|
+
startPositionRow?: number;
|
|
499
|
+
startPositionColumn?: number;
|
|
500
|
+
startIndex?: number;
|
|
501
|
+
endPositionRow?: number;
|
|
502
|
+
endPositionColumn?: number;
|
|
503
|
+
endIndex?: number;
|
|
504
|
+
} | undefined;
|
|
523
505
|
};
|
|
524
506
|
};
|
|
525
507
|
|