@redocly/openapi-core 0.0.0-snapshot.1737554067
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/README.md +268 -0
- package/lib/benchmark/benches/lint-with-many-rules.bench.d.ts +4 -0
- package/lib/benchmark/benches/lint-with-many-rules.bench.js +38 -0
- package/lib/benchmark/benches/lint-with-nested-rule.bench.d.ts +4 -0
- package/lib/benchmark/benches/lint-with-nested-rule.bench.js +44 -0
- package/lib/benchmark/benches/lint-with-no-rules.bench.d.ts +4 -0
- package/lib/benchmark/benches/lint-with-no-rules.bench.js +25 -0
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.d.ts +4 -0
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.js +37 -0
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.d.ts +4 -0
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.js +36 -0
- package/lib/benchmark/benches/recommended-oas3.bench.d.ts +3 -0
- package/lib/benchmark/benches/recommended-oas3.bench.js +21 -0
- package/lib/benchmark/benches/resolve-with-no-external.bench.d.ts +3 -0
- package/lib/benchmark/benches/resolve-with-no-external.bench.js +22 -0
- package/lib/benchmark/utils.d.ts +6 -0
- package/lib/benchmark/utils.js +34 -0
- package/lib/bundle.d.ts +50 -0
- package/lib/bundle.js +385 -0
- package/lib/config/all.d.ts +3 -0
- package/lib/config/all.js +227 -0
- package/lib/config/builtIn.d.ts +3 -0
- package/lib/config/builtIn.js +53 -0
- package/lib/config/config-resolvers.d.ts +30 -0
- package/lib/config/config-resolvers.js +447 -0
- package/lib/config/config.d.ts +53 -0
- package/lib/config/config.js +320 -0
- package/lib/config/index.d.ts +7 -0
- package/lib/config/index.js +23 -0
- package/lib/config/load.d.ts +38 -0
- package/lib/config/load.js +140 -0
- package/lib/config/minimal.d.ts +3 -0
- package/lib/config/minimal.js +203 -0
- package/lib/config/recommended-strict.d.ts +3 -0
- package/lib/config/recommended-strict.js +203 -0
- package/lib/config/recommended.d.ts +3 -0
- package/lib/config/recommended.js +203 -0
- package/lib/config/rules.d.ts +10 -0
- package/lib/config/rules.js +37 -0
- package/lib/config/spec.d.ts +3 -0
- package/lib/config/spec.js +29 -0
- package/lib/config/types.d.ts +189 -0
- package/lib/config/types.js +2 -0
- package/lib/config/utils.d.ts +19 -0
- package/lib/config/utils.js +308 -0
- package/lib/decorators/arazzo/index.d.ts +1 -0
- package/lib/decorators/arazzo/index.js +4 -0
- package/lib/decorators/async2/index.d.ts +1 -0
- package/lib/decorators/async2/index.js +4 -0
- package/lib/decorators/async3/index.d.ts +1 -0
- package/lib/decorators/async3/index.js +4 -0
- package/lib/decorators/common/filters/filter-helper.d.ts +3 -0
- package/lib/decorators/common/filters/filter-helper.js +66 -0
- package/lib/decorators/common/filters/filter-in.d.ts +2 -0
- package/lib/decorators/common/filters/filter-in.js +17 -0
- package/lib/decorators/common/filters/filter-out.d.ts +2 -0
- package/lib/decorators/common/filters/filter-out.js +17 -0
- package/lib/decorators/common/info-description-override.d.ts +2 -0
- package/lib/decorators/common/info-description-override.js +24 -0
- package/lib/decorators/common/info-override.d.ts +2 -0
- package/lib/decorators/common/info-override.js +17 -0
- package/lib/decorators/common/media-type-examples-override.d.ts +2 -0
- package/lib/decorators/common/media-type-examples-override.js +59 -0
- package/lib/decorators/common/operation-description-override.d.ts +2 -0
- package/lib/decorators/common/operation-description-override.js +29 -0
- package/lib/decorators/common/registry-dependencies.d.ts +2 -0
- package/lib/decorators/common/registry-dependencies.js +24 -0
- package/lib/decorators/common/remove-x-internal.d.ts +2 -0
- package/lib/decorators/common/remove-x-internal.js +69 -0
- package/lib/decorators/common/tag-description-override.d.ts +2 -0
- package/lib/decorators/common/tag-description-override.js +25 -0
- package/lib/decorators/oas2/index.d.ts +11 -0
- package/lib/decorators/oas2/index.js +21 -0
- package/lib/decorators/oas2/remove-unused-components.d.ts +2 -0
- package/lib/decorators/oas2/remove-unused-components.js +89 -0
- package/lib/decorators/oas3/index.d.ts +12 -0
- package/lib/decorators/oas3/index.js +23 -0
- package/lib/decorators/oas3/remove-unused-components.d.ts +2 -0
- package/lib/decorators/oas3/remove-unused-components.js +100 -0
- package/lib/env.d.ts +2 -0
- package/lib/env.js +7 -0
- package/lib/format/codeframes.d.ts +22 -0
- package/lib/format/codeframes.js +185 -0
- package/lib/format/format.d.ts +20 -0
- package/lib/format/format.js +365 -0
- package/lib/index.d.ts +26 -0
- package/lib/index.js +98 -0
- package/lib/js-yaml/index.d.ts +3 -0
- package/lib/js-yaml/index.js +15 -0
- package/lib/lint.d.ts +32 -0
- package/lib/lint.js +118 -0
- package/lib/logger.d.ts +10 -0
- package/lib/logger.js +31 -0
- package/lib/oas-types.d.ts +36 -0
- package/lib/oas-types.js +92 -0
- package/lib/output.d.ts +3 -0
- package/lib/output.js +9 -0
- package/lib/redocly/domains.d.ts +14 -0
- package/lib/redocly/domains.js +41 -0
- package/lib/redocly/index.d.ts +30 -0
- package/lib/redocly/index.js +131 -0
- package/lib/redocly/redocly-client-types.d.ts +8 -0
- package/lib/redocly/redocly-client-types.js +2 -0
- package/lib/redocly/registry-api-types.d.ts +29 -0
- package/lib/redocly/registry-api-types.js +2 -0
- package/lib/redocly/registry-api.d.ts +17 -0
- package/lib/redocly/registry-api.js +96 -0
- package/lib/ref-utils.d.ts +27 -0
- package/lib/ref-utils.js +85 -0
- package/lib/resolve.d.ts +66 -0
- package/lib/resolve.js +342 -0
- package/lib/rules/ajv.d.ts +10 -0
- package/lib/rules/ajv.js +82 -0
- package/lib/rules/arazzo/criteria-unique.d.ts +2 -0
- package/lib/rules/arazzo/criteria-unique.js +71 -0
- package/lib/rules/arazzo/index.d.ts +3 -0
- package/lib/rules/arazzo/index.js +36 -0
- package/lib/rules/arazzo/parameters-unique.d.ts +2 -0
- package/lib/rules/arazzo/parameters-unique.js +32 -0
- package/lib/rules/arazzo/requestBody-replacements-unique.d.ts +2 -0
- package/lib/rules/arazzo/requestBody-replacements-unique.js +28 -0
- package/lib/rules/arazzo/sourceDescription-type.d.ts +2 -0
- package/lib/rules/arazzo/sourceDescription-type.js +22 -0
- package/lib/rules/arazzo/sourceDescriptions-name-unique.d.ts +2 -0
- package/lib/rules/arazzo/sourceDescriptions-name-unique.js +24 -0
- package/lib/rules/arazzo/sourceDescriptions-not-empty.d.ts +2 -0
- package/lib/rules/arazzo/sourceDescriptions-not-empty.js +18 -0
- package/lib/rules/arazzo/step-onFailure-unique.d.ts +2 -0
- package/lib/rules/arazzo/step-onFailure-unique.js +32 -0
- package/lib/rules/arazzo/step-onSuccess-unique.d.ts +2 -0
- package/lib/rules/arazzo/step-onSuccess-unique.js +32 -0
- package/lib/rules/arazzo/stepId-unique.d.ts +2 -0
- package/lib/rules/arazzo/stepId-unique.js +26 -0
- package/lib/rules/arazzo/workflow-dependsOn.d.ts +2 -0
- package/lib/rules/arazzo/workflow-dependsOn.js +56 -0
- package/lib/rules/arazzo/workflowId-unique.d.ts +2 -0
- package/lib/rules/arazzo/workflowId-unique.js +22 -0
- package/lib/rules/async2/channels-kebab-case.d.ts +2 -0
- package/lib/rules/async2/channels-kebab-case.js +19 -0
- package/lib/rules/async2/index.d.ts +3 -0
- package/lib/rules/async2/index.js +27 -0
- package/lib/rules/async2/no-channel-trailing-slash.d.ts +2 -0
- package/lib/rules/async2/no-channel-trailing-slash.js +16 -0
- package/lib/rules/async3/channels-kebab-case.d.ts +2 -0
- package/lib/rules/async3/channels-kebab-case.js +19 -0
- package/lib/rules/async3/index.d.ts +3 -0
- package/lib/rules/async3/index.js +27 -0
- package/lib/rules/async3/no-channel-trailing-slash.d.ts +2 -0
- package/lib/rules/async3/no-channel-trailing-slash.js +16 -0
- package/lib/rules/common/assertions/asserts.d.ts +30 -0
- package/lib/rules/common/assertions/asserts.js +281 -0
- package/lib/rules/common/assertions/index.d.ts +27 -0
- package/lib/rules/common/assertions/index.js +24 -0
- package/lib/rules/common/assertions/utils.d.ts +28 -0
- package/lib/rules/common/assertions/utils.js +226 -0
- package/lib/rules/common/info-contact.d.ts +2 -0
- package/lib/rules/common/info-contact.js +17 -0
- package/lib/rules/common/info-license-strict.d.ts +2 -0
- package/lib/rules/common/info-license-strict.js +26 -0
- package/lib/rules/common/info-license-url.d.ts +2 -0
- package/lib/rules/common/info-license-url.js +12 -0
- package/lib/rules/common/info-license.d.ts +2 -0
- package/lib/rules/common/info-license.js +17 -0
- package/lib/rules/common/no-ambiguous-paths.d.ts +2 -0
- package/lib/rules/common/no-ambiguous-paths.js +45 -0
- package/lib/rules/common/no-enum-type-mismatch.d.ts +2 -0
- package/lib/rules/common/no-enum-type-mismatch.js +41 -0
- package/lib/rules/common/no-http-verbs-in-paths.d.ts +2 -0
- package/lib/rules/common/no-http-verbs-in-paths.js +33 -0
- package/lib/rules/common/no-identical-paths.d.ts +2 -0
- package/lib/rules/common/no-identical-paths.js +24 -0
- package/lib/rules/common/no-invalid-parameter-examples.d.ts +1 -0
- package/lib/rules/common/no-invalid-parameter-examples.js +24 -0
- package/lib/rules/common/no-invalid-schema-examples.d.ts +1 -0
- package/lib/rules/common/no-invalid-schema-examples.js +22 -0
- package/lib/rules/common/no-path-trailing-slash.d.ts +2 -0
- package/lib/rules/common/no-path-trailing-slash.js +16 -0
- package/lib/rules/common/no-required-schema-properties-undefined.d.ts +2 -0
- package/lib/rules/common/no-required-schema-properties-undefined.js +36 -0
- package/lib/rules/common/operation-2xx-response.d.ts +2 -0
- package/lib/rules/common/operation-2xx-response.js +23 -0
- package/lib/rules/common/operation-4xx-response.d.ts +2 -0
- package/lib/rules/common/operation-4xx-response.js +23 -0
- package/lib/rules/common/operation-description.d.ts +2 -0
- package/lib/rules/common/operation-description.js +12 -0
- package/lib/rules/common/operation-operationId-unique.d.ts +2 -0
- package/lib/rules/common/operation-operationId-unique.js +20 -0
- package/lib/rules/common/operation-operationId-url-safe.d.ts +2 -0
- package/lib/rules/common/operation-operationId-url-safe.js +18 -0
- package/lib/rules/common/operation-operationId.d.ts +2 -0
- package/lib/rules/common/operation-operationId.js +16 -0
- package/lib/rules/common/operation-parameters-unique.d.ts +2 -0
- package/lib/rules/common/operation-parameters-unique.js +40 -0
- package/lib/rules/common/operation-singular-tag.d.ts +2 -0
- package/lib/rules/common/operation-singular-tag.js +16 -0
- package/lib/rules/common/operation-summary.d.ts +2 -0
- package/lib/rules/common/operation-summary.js +12 -0
- package/lib/rules/common/operation-tag-defined.d.ts +2 -0
- package/lib/rules/common/operation-tag-defined.js +24 -0
- package/lib/rules/common/parameter-description.d.ts +2 -0
- package/lib/rules/common/parameter-description.js +22 -0
- package/lib/rules/common/path-declaration-must-exist.d.ts +2 -0
- package/lib/rules/common/path-declaration-must-exist.js +16 -0
- package/lib/rules/common/path-excludes-patterns.d.ts +2 -0
- package/lib/rules/common/path-excludes-patterns.js +22 -0
- package/lib/rules/common/path-http-verbs-order.d.ts +2 -0
- package/lib/rules/common/path-http-verbs-order.js +26 -0
- package/lib/rules/common/path-not-include-query.d.ts +2 -0
- package/lib/rules/common/path-not-include-query.js +18 -0
- package/lib/rules/common/path-params-defined.d.ts +2 -0
- package/lib/rules/common/path-params-defined.js +58 -0
- package/lib/rules/common/path-segment-plural.d.ts +2 -0
- package/lib/rules/common/path-segment-plural.js +33 -0
- package/lib/rules/common/paths-kebab-case.d.ts +2 -0
- package/lib/rules/common/paths-kebab-case.js +20 -0
- package/lib/rules/common/required-string-property-missing-min-length.d.ts +2 -0
- package/lib/rules/common/required-string-property-missing-min-length.js +37 -0
- package/lib/rules/common/response-contains-header.d.ts +2 -0
- package/lib/rules/common/response-contains-header.js +29 -0
- package/lib/rules/common/scalar-property-missing-example.d.ts +2 -0
- package/lib/rules/common/scalar-property-missing-example.js +42 -0
- package/lib/rules/common/security-defined.d.ts +2 -0
- package/lib/rules/common/security-defined.js +65 -0
- package/lib/rules/common/spec-strict-refs.d.ts +2 -0
- package/lib/rules/common/spec-strict-refs.js +30 -0
- package/lib/rules/common/struct.d.ts +2 -0
- package/lib/rules/common/struct.js +158 -0
- package/lib/rules/common/tag-description.d.ts +2 -0
- package/lib/rules/common/tag-description.js +12 -0
- package/lib/rules/common/tags-alphabetical.d.ts +2 -0
- package/lib/rules/common/tags-alphabetical.js +23 -0
- package/lib/rules/no-unresolved-refs.d.ts +5 -0
- package/lib/rules/no-unresolved-refs.js +46 -0
- package/lib/rules/oas2/boolean-parameter-prefixes.d.ts +5 -0
- package/lib/rules/oas2/boolean-parameter-prefixes.js +22 -0
- package/lib/rules/oas2/index.d.ts +3 -0
- package/lib/rules/oas2/index.js +98 -0
- package/lib/rules/oas2/request-mime-type.d.ts +2 -0
- package/lib/rules/oas2/request-mime-type.js +17 -0
- package/lib/rules/oas2/response-contains-property.d.ts +2 -0
- package/lib/rules/oas2/response-contains-property.js +37 -0
- package/lib/rules/oas2/response-mime-type.d.ts +2 -0
- package/lib/rules/oas2/response-mime-type.js +17 -0
- package/lib/rules/oas3/array-parameter-serialization.d.ts +5 -0
- package/lib/rules/oas3/array-parameter-serialization.js +29 -0
- package/lib/rules/oas3/boolean-parameter-prefixes.d.ts +5 -0
- package/lib/rules/oas3/boolean-parameter-prefixes.js +24 -0
- package/lib/rules/oas3/component-name-unique.d.ts +2 -0
- package/lib/rules/oas3/component-name-unique.js +133 -0
- package/lib/rules/oas3/index.d.ts +3 -0
- package/lib/rules/oas3/index.js +122 -0
- package/lib/rules/oas3/no-empty-servers.d.ts +2 -0
- package/lib/rules/oas3/no-empty-servers.js +23 -0
- package/lib/rules/oas3/no-example-value-and-externalValue.d.ts +2 -0
- package/lib/rules/oas3/no-example-value-and-externalValue.js +16 -0
- package/lib/rules/oas3/no-invalid-media-type-examples.d.ts +2 -0
- package/lib/rules/oas3/no-invalid-media-type-examples.js +39 -0
- package/lib/rules/oas3/no-server-example.com.d.ts +2 -0
- package/lib/rules/oas3/no-server-example.com.js +18 -0
- package/lib/rules/oas3/no-server-trailing-slash.d.ts +2 -0
- package/lib/rules/oas3/no-server-trailing-slash.js +18 -0
- package/lib/rules/oas3/no-server-variables-empty-enum.d.ts +2 -0
- package/lib/rules/oas3/no-server-variables-empty-enum.js +66 -0
- package/lib/rules/oas3/no-undefined-server-variable.d.ts +2 -0
- package/lib/rules/oas3/no-undefined-server-variable.js +31 -0
- package/lib/rules/oas3/no-unused-components.d.ts +2 -0
- package/lib/rules/oas3/no-unused-components.js +73 -0
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.d.ts +5 -0
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js +36 -0
- package/lib/rules/oas3/request-mime-type.d.ts +2 -0
- package/lib/rules/oas3/request-mime-type.js +31 -0
- package/lib/rules/oas3/response-contains-property.d.ts +2 -0
- package/lib/rules/oas3/response-contains-property.js +39 -0
- package/lib/rules/oas3/response-mime-type.d.ts +2 -0
- package/lib/rules/oas3/response-mime-type.js +31 -0
- package/lib/rules/oas3/spec-components-invalid-map-name.d.ts +2 -0
- package/lib/rules/oas3/spec-components-invalid-map-name.js +62 -0
- package/lib/rules/other/stats.d.ts +41 -0
- package/lib/rules/other/stats.js +75 -0
- package/lib/rules/spot/no-criteria-xpath.d.ts +2 -0
- package/lib/rules/spot/no-criteria-xpath.js +21 -0
- package/lib/rules/spot/spot-supported-versions.d.ts +2 -0
- package/lib/rules/spot/spot-supported-versions.js +21 -0
- package/lib/rules/utils.d.ts +22 -0
- package/lib/rules/utils.js +183 -0
- package/lib/types/arazzo.d.ts +2 -0
- package/lib/types/arazzo.js +311 -0
- package/lib/types/asyncapi2.d.ts +17 -0
- package/lib/types/asyncapi2.js +1008 -0
- package/lib/types/asyncapi3.d.ts +2 -0
- package/lib/types/asyncapi3.js +347 -0
- package/lib/types/index.d.ts +57 -0
- package/lib/types/index.js +94 -0
- package/lib/types/json-schema-adapter.d.ts +3 -0
- package/lib/types/json-schema-adapter.js +159 -0
- package/lib/types/oas2.d.ts +3 -0
- package/lib/types/oas2.js +456 -0
- package/lib/types/oas3.d.ts +7 -0
- package/lib/types/oas3.js +554 -0
- package/lib/types/oas3_1.d.ts +6 -0
- package/lib/types/oas3_1.js +285 -0
- package/lib/types/redocly-yaml.d.ts +26 -0
- package/lib/types/redocly-yaml.js +1126 -0
- package/lib/typings/arazzo.d.ts +131 -0
- package/lib/typings/arazzo.js +5 -0
- package/lib/typings/asyncapi.d.ts +21 -0
- package/lib/typings/asyncapi.js +2 -0
- package/lib/typings/asyncapi3.d.ts +53 -0
- package/lib/typings/asyncapi3.js +2 -0
- package/lib/typings/common.d.ts +8 -0
- package/lib/typings/common.js +2 -0
- package/lib/typings/openapi.d.ts +355 -0
- package/lib/typings/openapi.js +2 -0
- package/lib/typings/swagger.d.ts +217 -0
- package/lib/typings/swagger.js +2 -0
- package/lib/utils.d.ts +70 -0
- package/lib/utils.js +301 -0
- package/lib/visitors.d.ts +229 -0
- package/lib/visitors.js +176 -0
- package/lib/walk.d.ts +78 -0
- package/lib/walk.js +290 -0
- package/package.json +59 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Oas3_1Types = exports.DependentRequired = exports.SchemaProperties = exports.Schema = void 0;
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
const oas3_1 = require("./oas3");
|
|
6
|
+
const Root = {
|
|
7
|
+
properties: {
|
|
8
|
+
openapi: null,
|
|
9
|
+
info: 'Info',
|
|
10
|
+
servers: 'ServerList',
|
|
11
|
+
security: 'SecurityRequirementList',
|
|
12
|
+
tags: 'TagList',
|
|
13
|
+
externalDocs: 'ExternalDocs',
|
|
14
|
+
paths: 'Paths',
|
|
15
|
+
webhooks: 'WebhooksMap',
|
|
16
|
+
components: 'Components',
|
|
17
|
+
jsonSchemaDialect: { type: 'string' },
|
|
18
|
+
},
|
|
19
|
+
required: ['openapi', 'info'],
|
|
20
|
+
requiredOneOf: ['paths', 'components', 'webhooks'],
|
|
21
|
+
extensionsPrefix: 'x-',
|
|
22
|
+
};
|
|
23
|
+
const License = {
|
|
24
|
+
properties: {
|
|
25
|
+
name: { type: 'string' },
|
|
26
|
+
url: { type: 'string' },
|
|
27
|
+
identifier: { type: 'string' },
|
|
28
|
+
},
|
|
29
|
+
required: ['name'],
|
|
30
|
+
extensionsPrefix: 'x-',
|
|
31
|
+
};
|
|
32
|
+
const Info = {
|
|
33
|
+
properties: {
|
|
34
|
+
title: { type: 'string' },
|
|
35
|
+
version: { type: 'string' },
|
|
36
|
+
description: { type: 'string' },
|
|
37
|
+
termsOfService: { type: 'string' },
|
|
38
|
+
summary: { type: 'string' },
|
|
39
|
+
contact: 'Contact',
|
|
40
|
+
license: 'License',
|
|
41
|
+
'x-logo': 'Logo',
|
|
42
|
+
},
|
|
43
|
+
required: ['title', 'version'],
|
|
44
|
+
extensionsPrefix: 'x-',
|
|
45
|
+
};
|
|
46
|
+
const Components = {
|
|
47
|
+
properties: {
|
|
48
|
+
parameters: 'NamedParameters',
|
|
49
|
+
schemas: 'NamedSchemas',
|
|
50
|
+
responses: 'NamedResponses',
|
|
51
|
+
examples: 'NamedExamples',
|
|
52
|
+
requestBodies: 'NamedRequestBodies',
|
|
53
|
+
headers: 'NamedHeaders',
|
|
54
|
+
securitySchemes: 'NamedSecuritySchemes',
|
|
55
|
+
links: 'NamedLinks',
|
|
56
|
+
callbacks: 'NamedCallbacks',
|
|
57
|
+
pathItems: 'NamedPathItems',
|
|
58
|
+
},
|
|
59
|
+
extensionsPrefix: 'x-',
|
|
60
|
+
};
|
|
61
|
+
const Operation = {
|
|
62
|
+
properties: {
|
|
63
|
+
tags: {
|
|
64
|
+
type: 'array',
|
|
65
|
+
items: { type: 'string' },
|
|
66
|
+
},
|
|
67
|
+
summary: { type: 'string' },
|
|
68
|
+
description: { type: 'string' },
|
|
69
|
+
externalDocs: 'ExternalDocs',
|
|
70
|
+
operationId: { type: 'string' },
|
|
71
|
+
parameters: 'ParameterList',
|
|
72
|
+
security: 'SecurityRequirementList',
|
|
73
|
+
servers: 'ServerList',
|
|
74
|
+
requestBody: 'RequestBody',
|
|
75
|
+
responses: 'Responses',
|
|
76
|
+
deprecated: { type: 'boolean' },
|
|
77
|
+
callbacks: 'CallbacksMap',
|
|
78
|
+
'x-codeSamples': 'XCodeSampleList',
|
|
79
|
+
'x-code-samples': 'XCodeSampleList', // deprecated
|
|
80
|
+
'x-hideTryItPanel': { type: 'boolean' },
|
|
81
|
+
},
|
|
82
|
+
extensionsPrefix: 'x-',
|
|
83
|
+
};
|
|
84
|
+
exports.Schema = {
|
|
85
|
+
properties: {
|
|
86
|
+
$id: { type: 'string' },
|
|
87
|
+
$anchor: { type: 'string' },
|
|
88
|
+
id: { type: 'string' },
|
|
89
|
+
$schema: { type: 'string' },
|
|
90
|
+
definitions: 'NamedSchemas',
|
|
91
|
+
$defs: 'NamedSchemas',
|
|
92
|
+
$vocabulary: { type: 'string' },
|
|
93
|
+
externalDocs: 'ExternalDocs',
|
|
94
|
+
discriminator: 'Discriminator',
|
|
95
|
+
title: { type: 'string' },
|
|
96
|
+
multipleOf: { type: 'number', minimum: 0 },
|
|
97
|
+
maximum: { type: 'number' },
|
|
98
|
+
minimum: { type: 'number' },
|
|
99
|
+
exclusiveMaximum: { type: 'number' },
|
|
100
|
+
exclusiveMinimum: { type: 'number' },
|
|
101
|
+
maxLength: { type: 'integer', minimum: 0 },
|
|
102
|
+
minLength: { type: 'integer', minimum: 0 },
|
|
103
|
+
pattern: { type: 'string' },
|
|
104
|
+
maxItems: { type: 'integer', minimum: 0 },
|
|
105
|
+
minItems: { type: 'integer', minimum: 0 },
|
|
106
|
+
uniqueItems: { type: 'boolean' },
|
|
107
|
+
maxProperties: { type: 'integer', minimum: 0 },
|
|
108
|
+
minProperties: { type: 'integer', minimum: 0 },
|
|
109
|
+
required: { type: 'array', items: { type: 'string' } },
|
|
110
|
+
enum: { type: 'array' },
|
|
111
|
+
type: (value) => {
|
|
112
|
+
if (Array.isArray(value)) {
|
|
113
|
+
return {
|
|
114
|
+
type: 'array',
|
|
115
|
+
items: { enum: ['object', 'array', 'string', 'number', 'integer', 'boolean', 'null'] },
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
return {
|
|
120
|
+
enum: ['object', 'array', 'string', 'number', 'integer', 'boolean', 'null'],
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
allOf: (0, _1.listOf)('Schema'),
|
|
125
|
+
anyOf: (0, _1.listOf)('Schema'),
|
|
126
|
+
oneOf: (0, _1.listOf)('Schema'),
|
|
127
|
+
not: 'Schema',
|
|
128
|
+
if: 'Schema',
|
|
129
|
+
then: 'Schema',
|
|
130
|
+
else: 'Schema',
|
|
131
|
+
dependentSchemas: (0, _1.mapOf)('Schema'),
|
|
132
|
+
dependentRequired: 'DependentRequired',
|
|
133
|
+
prefixItems: (0, _1.listOf)('Schema'),
|
|
134
|
+
contains: 'Schema',
|
|
135
|
+
minContains: { type: 'integer', minimum: 0 },
|
|
136
|
+
maxContains: { type: 'integer', minimum: 0 },
|
|
137
|
+
patternProperties: 'PatternProperties',
|
|
138
|
+
propertyNames: 'Schema',
|
|
139
|
+
unevaluatedItems: (value) => {
|
|
140
|
+
if (typeof value === 'boolean') {
|
|
141
|
+
return { type: 'boolean' };
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
return 'Schema';
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
unevaluatedProperties: (value) => {
|
|
148
|
+
if (typeof value === 'boolean') {
|
|
149
|
+
return { type: 'boolean' };
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
return 'Schema';
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
summary: { type: 'string' },
|
|
156
|
+
properties: 'SchemaProperties',
|
|
157
|
+
items: (value) => {
|
|
158
|
+
if (typeof value === 'boolean') {
|
|
159
|
+
return { type: 'boolean' };
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
return 'Schema';
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
additionalProperties: (value) => {
|
|
166
|
+
return typeof value === 'boolean' ? { type: 'boolean' } : 'Schema';
|
|
167
|
+
},
|
|
168
|
+
description: { type: 'string' },
|
|
169
|
+
format: { type: 'string' },
|
|
170
|
+
contentEncoding: { type: 'string' },
|
|
171
|
+
contentMediaType: { type: 'string' },
|
|
172
|
+
contentSchema: 'Schema',
|
|
173
|
+
default: null,
|
|
174
|
+
readOnly: { type: 'boolean' },
|
|
175
|
+
writeOnly: { type: 'boolean' },
|
|
176
|
+
xml: 'Xml',
|
|
177
|
+
examples: { type: 'array' },
|
|
178
|
+
example: { isExample: true },
|
|
179
|
+
deprecated: { type: 'boolean' },
|
|
180
|
+
const: null,
|
|
181
|
+
$comment: { type: 'string' },
|
|
182
|
+
'x-tags': { type: 'array', items: { type: 'string' } },
|
|
183
|
+
$dynamicAnchor: { type: 'string' },
|
|
184
|
+
$dynamicRef: { type: 'string' },
|
|
185
|
+
},
|
|
186
|
+
extensionsPrefix: 'x-',
|
|
187
|
+
};
|
|
188
|
+
exports.SchemaProperties = {
|
|
189
|
+
properties: {},
|
|
190
|
+
additionalProperties: (value) => {
|
|
191
|
+
if (typeof value === 'boolean') {
|
|
192
|
+
return { type: 'boolean' };
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
return 'Schema';
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
};
|
|
199
|
+
const SecurityScheme = {
|
|
200
|
+
properties: {
|
|
201
|
+
type: { enum: ['apiKey', 'http', 'oauth2', 'openIdConnect', 'mutualTLS'] },
|
|
202
|
+
description: { type: 'string' },
|
|
203
|
+
name: { type: 'string' },
|
|
204
|
+
in: { type: 'string', enum: ['query', 'header', 'cookie'] },
|
|
205
|
+
scheme: { type: 'string' },
|
|
206
|
+
bearerFormat: { type: 'string' },
|
|
207
|
+
flows: 'OAuth2Flows',
|
|
208
|
+
openIdConnectUrl: { type: 'string' },
|
|
209
|
+
},
|
|
210
|
+
required(value) {
|
|
211
|
+
switch (value?.type) {
|
|
212
|
+
case 'apiKey':
|
|
213
|
+
return ['type', 'name', 'in'];
|
|
214
|
+
case 'http':
|
|
215
|
+
return ['type', 'scheme'];
|
|
216
|
+
case 'oauth2':
|
|
217
|
+
return ['type', 'flows'];
|
|
218
|
+
case 'openIdConnect':
|
|
219
|
+
return ['type', 'openIdConnectUrl'];
|
|
220
|
+
default:
|
|
221
|
+
return ['type'];
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
allowed(value) {
|
|
225
|
+
switch (value?.type) {
|
|
226
|
+
case 'apiKey':
|
|
227
|
+
return ['type', 'name', 'in', 'description'];
|
|
228
|
+
case 'http':
|
|
229
|
+
return ['type', 'scheme', 'bearerFormat', 'description'];
|
|
230
|
+
case 'oauth2':
|
|
231
|
+
switch (value?.flows) {
|
|
232
|
+
case 'implicit':
|
|
233
|
+
return ['type', 'flows', 'authorizationUrl', 'refreshUrl', 'description', 'scopes'];
|
|
234
|
+
case 'password':
|
|
235
|
+
case 'clientCredentials':
|
|
236
|
+
return ['type', 'flows', 'tokenUrl', 'refreshUrl', 'description', 'scopes'];
|
|
237
|
+
case 'authorizationCode':
|
|
238
|
+
return [
|
|
239
|
+
'type',
|
|
240
|
+
'flows',
|
|
241
|
+
'authorizationUrl',
|
|
242
|
+
'refreshUrl',
|
|
243
|
+
'tokenUrl',
|
|
244
|
+
'description',
|
|
245
|
+
'scopes',
|
|
246
|
+
];
|
|
247
|
+
default:
|
|
248
|
+
return [
|
|
249
|
+
'type',
|
|
250
|
+
'flows',
|
|
251
|
+
'authorizationUrl',
|
|
252
|
+
'refreshUrl',
|
|
253
|
+
'tokenUrl',
|
|
254
|
+
'description',
|
|
255
|
+
'scopes',
|
|
256
|
+
];
|
|
257
|
+
}
|
|
258
|
+
case 'openIdConnect':
|
|
259
|
+
return ['type', 'openIdConnectUrl', 'description'];
|
|
260
|
+
case 'mutualTLS':
|
|
261
|
+
return ['type', 'description'];
|
|
262
|
+
default:
|
|
263
|
+
return ['type', 'description'];
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
extensionsPrefix: 'x-',
|
|
267
|
+
};
|
|
268
|
+
exports.DependentRequired = {
|
|
269
|
+
properties: {},
|
|
270
|
+
additionalProperties: { type: 'array', items: { type: 'string' } },
|
|
271
|
+
};
|
|
272
|
+
exports.Oas3_1Types = {
|
|
273
|
+
...oas3_1.Oas3Types,
|
|
274
|
+
Info,
|
|
275
|
+
Root,
|
|
276
|
+
Schema: exports.Schema,
|
|
277
|
+
SchemaProperties: exports.SchemaProperties,
|
|
278
|
+
PatternProperties: exports.SchemaProperties,
|
|
279
|
+
License,
|
|
280
|
+
Components,
|
|
281
|
+
NamedPathItems: (0, _1.mapOf)('PathItem'),
|
|
282
|
+
SecurityScheme,
|
|
283
|
+
Operation,
|
|
284
|
+
DependentRequired: exports.DependentRequired,
|
|
285
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { JSONSchema } from 'json-schema-to-ts';
|
|
2
|
+
import type { NodeType } from '.';
|
|
3
|
+
import type { Config } from '../config';
|
|
4
|
+
declare const builtInOAS2Rules: readonly ["info-contact", "operation-operationId", "tag-description", "tags-alphabetical", "info-license-url", "info-license-strict", "info-license", "no-ambiguous-paths", "no-enum-type-mismatch", "no-http-verbs-in-paths", "no-identical-paths", "no-invalid-parameter-examples", "no-invalid-schema-examples", "no-path-trailing-slash", "operation-2xx-response", "operation-4xx-response", "operation-description", "operation-operationId-unique", "operation-operationId-url-safe", "operation-parameters-unique", "operation-singular-tag", "operation-summary", "operation-tag-defined", "parameter-description", "path-declaration-must-exist", "path-excludes-patterns", "path-http-verbs-order", "path-not-include-query", "path-params-defined", "path-parameters-defined", "path-segment-plural", "paths-kebab-case", "required-string-property-missing-min-length", "response-contains-header", "scalar-property-missing-example", "security-defined", "spec-strict-refs", "no-unresolved-refs", "no-required-schema-properties-undefined", "boolean-parameter-prefixes", "request-mime-type", "response-contains-property", "response-mime-type"];
|
|
5
|
+
export type BuiltInOAS2RuleId = typeof builtInOAS2Rules[number];
|
|
6
|
+
declare const builtInOAS3Rules: readonly ["info-contact", "operation-operationId", "tag-description", "tags-alphabetical", "info-license-url", "info-license-strict", "info-license", "no-ambiguous-paths", "no-enum-type-mismatch", "no-http-verbs-in-paths", "no-identical-paths", "no-invalid-parameter-examples", "no-invalid-schema-examples", "no-path-trailing-slash", "operation-2xx-response", "operation-4xx-response", "operation-description", "operation-operationId-unique", "operation-operationId-url-safe", "operation-parameters-unique", "operation-singular-tag", "operation-summary", "operation-tag-defined", "parameter-description", "path-declaration-must-exist", "path-excludes-patterns", "path-http-verbs-order", "path-not-include-query", "path-params-defined", "path-parameters-defined", "path-segment-plural", "paths-kebab-case", "required-string-property-missing-min-length", "response-contains-header", "scalar-property-missing-example", "security-defined", "spec-strict-refs", "no-unresolved-refs", "no-required-schema-properties-undefined", "boolean-parameter-prefixes", "component-name-unique", "no-empty-servers", "no-example-value-and-externalValue", "no-invalid-media-type-examples", "no-server-example.com", "no-server-trailing-slash", "no-server-variables-empty-enum", "no-undefined-server-variable", "no-unused-components", "operation-4xx-problem-details-rfc7807", "request-mime-type", "response-contains-property", "response-mime-type", "spec-components-invalid-map-name", "array-parameter-serialization"];
|
|
7
|
+
export type BuiltInOAS3RuleId = typeof builtInOAS3Rules[number];
|
|
8
|
+
declare const builtInAsync2Rules: readonly ["info-contact", "info-license-strict", "operation-operationId", "tag-description", "tags-alphabetical", "channels-kebab-case", "no-channel-trailing-slash"];
|
|
9
|
+
declare const builtInAsync3Rules: readonly ["info-contact", "info-license-strict", "operation-operationId", "tag-description", "tags-alphabetical", "channels-kebab-case", "no-channel-trailing-slash"];
|
|
10
|
+
export type BuiltInAsync2RuleId = typeof builtInAsync2Rules[number];
|
|
11
|
+
export type BuiltInAsync3RuleId = typeof builtInAsync3Rules[number];
|
|
12
|
+
declare const builtInArazzo1Rules: readonly ["sourceDescription-type", "workflowId-unique", "stepId-unique", "sourceDescription-name-unique", "sourceDescriptions-not-empty", "workflow-dependsOn", "parameters-unique", "step-onSuccess-unique", "step-onFailure-unique", "spot-supported-versions", "requestBody-replacements-unique", "no-criteria-xpath", "criteria-unique"];
|
|
13
|
+
export type BuiltInArazzo1RuleId = typeof builtInArazzo1Rules[number];
|
|
14
|
+
declare const oas2NodeTypesList: readonly ["Root", "Tag", "TagList", "ExternalDocs", "SecurityRequirement", "SecurityRequirementList", "Info", "Contact", "License", "Paths", "PathItem", "Parameter", "ParameterList", "ParameterItems", "Operation", "Example", "ExamplesMap", "Examples", "Header", "Responses", "Response", "Schema", "Xml", "SchemaProperties", "NamedSchemas", "NamedResponses", "NamedParameters", "NamedSecuritySchemes", "SecurityScheme", "TagGroup", "TagGroups", "EnumDescriptions", "Logo", "XCodeSample", "XCodeSampleList", "XServer", "XServerList"];
|
|
15
|
+
export type Oas2NodeType = typeof oas2NodeTypesList[number];
|
|
16
|
+
declare const oas3NodeTypesList: readonly ["Root", "Tag", "TagList", "ExternalDocs", "Server", "ServerList", "ServerVariable", "ServerVariablesMap", "SecurityRequirement", "SecurityRequirementList", "Info", "Contact", "License", "Paths", "PathItem", "Parameter", "ParameterList", "Operation", "Callback", "CallbacksMap", "RequestBody", "MediaTypesMap", "MediaType", "Example", "ExamplesMap", "Encoding", "EncodingMap", "Header", "HeadersMap", "Responses", "Response", "Link", "LinksMap", "Schema", "Xml", "SchemaProperties", "DiscriminatorMapping", "Discriminator", "Components", "NamedSchemas", "NamedResponses", "NamedParameters", "NamedExamples", "NamedRequestBodies", "NamedHeaders", "NamedSecuritySchemes", "NamedLinks", "NamedCallbacks", "ImplicitFlow", "PasswordFlow", "ClientCredentials", "AuthorizationCode", "OAuth2Flows", "SecurityScheme", "TagGroup", "TagGroups", "EnumDescriptions", "Logo", "XCodeSample", "XCodeSampleList", "XUsePkce", "WebhooksMap"];
|
|
17
|
+
export type Oas3NodeType = typeof oas3NodeTypesList[number];
|
|
18
|
+
declare const oas3_1NodeTypesList: readonly ["Root", "Schema", "SchemaProperties", "PatternProperties", "Info", "License", "Components", "NamedPathItems", "SecurityScheme", "Operation", "DependentRequired"];
|
|
19
|
+
export type Oas3_1NodeType = typeof oas3_1NodeTypesList[number];
|
|
20
|
+
export declare function createConfigTypes(extraSchemas: JSONSchema, config?: Config): {
|
|
21
|
+
ConfigRoot: NodeType;
|
|
22
|
+
ConfigApisProperties: NodeType;
|
|
23
|
+
AssertionDefinitionSubject: NodeType;
|
|
24
|
+
};
|
|
25
|
+
export declare const ConfigTypes: Record<string, NodeType>;
|
|
26
|
+
export {};
|