@redocly/openapi-core 1.0.0-beta.126 → 1.0.0-beta.128
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/lib/bundle.js +21 -4
- package/lib/config/all.js +1 -0
- package/lib/config/config-resolvers.js +8 -2
- package/lib/config/minimal.js +1 -0
- package/lib/config/recommended.js +1 -0
- package/lib/config/types.d.ts +1 -1
- package/lib/config/utils.js +15 -1
- package/lib/lint.js +17 -2
- 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/spec.js +1 -0
- package/lib/rules/oas2/index.d.ts +1 -0
- package/lib/rules/oas2/index.js +2 -0
- package/lib/rules/oas2/request-mime-type.d.ts +1 -1
- package/lib/rules/oas2/response-mime-type.d.ts +1 -1
- package/lib/rules/oas3/index.js +2 -0
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.d.ts +2 -2
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js +3 -3
- package/lib/rules/oas3/request-mime-type.d.ts +1 -1
- package/lib/rules/oas3/response-mime-type.d.ts +1 -1
- package/lib/rules/oas3/spec-components-invalid-map-name.js +0 -5
- package/lib/types/redocly-yaml.js +6 -1
- package/lib/walk.d.ts +6 -5
- package/lib/walk.js +26 -31
- package/package.json +1 -1
- package/__tests__/utils.ts +0 -88
- package/src/__tests__/__snapshots__/bundle.test.ts.snap +0 -437
- package/src/__tests__/bundle.test.ts +0 -236
- package/src/__tests__/codeframes.test.ts +0 -530
- package/src/__tests__/fixtures/.redocly.lint-ignore.yaml +0 -5
- package/src/__tests__/fixtures/extension.js +0 -24
- package/src/__tests__/fixtures/refs/definitions.yaml +0 -3
- package/src/__tests__/fixtures/refs/examples.yaml +0 -8
- package/src/__tests__/fixtures/refs/external-request-body.yaml +0 -13
- package/src/__tests__/fixtures/refs/externalref.yaml +0 -35
- package/src/__tests__/fixtures/refs/hosted.yaml +0 -35
- package/src/__tests__/fixtures/refs/openapi-with-external-refs-conflicting-names.yaml +0 -21
- package/src/__tests__/fixtures/refs/openapi-with-external-refs.yaml +0 -33
- package/src/__tests__/fixtures/refs/openapi-with-url-refs.yaml +0 -18
- package/src/__tests__/fixtures/refs/param-b.yaml +0 -1
- package/src/__tests__/fixtures/refs/param-c.yaml +0 -1
- package/src/__tests__/fixtures/refs/rename.yaml +0 -1
- package/src/__tests__/fixtures/refs/requestBody.yaml +0 -9
- package/src/__tests__/fixtures/refs/schema-a.yaml +0 -1
- package/src/__tests__/fixtures/refs/simple.yaml +0 -1
- package/src/__tests__/fixtures/refs/vendor.schema.yaml +0 -20
- package/src/__tests__/fixtures/resolve/External.yaml +0 -10
- package/src/__tests__/fixtures/resolve/External2.yaml +0 -4
- package/src/__tests__/fixtures/resolve/description.md +0 -3
- package/src/__tests__/fixtures/resolve/externalInfo.yaml +0 -4
- package/src/__tests__/fixtures/resolve/externalLicense.yaml +0 -1
- package/src/__tests__/fixtures/resolve/openapi-with-back.yaml +0 -13
- package/src/__tests__/fixtures/resolve/openapi-with-md-description.yaml +0 -5
- package/src/__tests__/fixtures/resolve/openapi.yaml +0 -28
- package/src/__tests__/fixtures/resolve/schemas/type-a.yaml +0 -10
- package/src/__tests__/fixtures/resolve/schemas/type-b.yaml +0 -6
- package/src/__tests__/fixtures/resolve/transitive/a.yaml +0 -1
- package/src/__tests__/fixtures/resolve/transitive/components.yaml +0 -5
- package/src/__tests__/fixtures/resolve/transitive/schemas.yaml +0 -3
- package/src/__tests__/format.test.ts +0 -76
- package/src/__tests__/js-yaml.test.ts +0 -73
- package/src/__tests__/lint.test.ts +0 -388
- package/src/__tests__/logger-browser.test.ts +0 -53
- package/src/__tests__/logger.test.ts +0 -47
- package/src/__tests__/login.test.ts +0 -17
- package/src/__tests__/normalizeVisitors.test.ts +0 -151
- package/src/__tests__/output-browser.test.ts +0 -18
- package/src/__tests__/output.test.ts +0 -15
- package/src/__tests__/ref-utils.test.ts +0 -120
- package/src/__tests__/resolve-http.test.ts +0 -77
- package/src/__tests__/resolve.test.ts +0 -430
- package/src/__tests__/utils-browser.test.ts +0 -11
- package/src/__tests__/utils.test.ts +0 -144
- package/src/__tests__/walk.test.ts +0 -1545
- package/src/benchmark/benches/lint-with-many-rules.bench.ts +0 -35
- package/src/benchmark/benches/lint-with-nested-rule.bench.ts +0 -39
- package/src/benchmark/benches/lint-with-no-rules.bench.ts +0 -20
- package/src/benchmark/benches/lint-with-top-level-rule-report.bench.ts +0 -35
- package/src/benchmark/benches/lint-with-top-level-rule.bench.ts +0 -32
- package/src/benchmark/benches/rebilly.yaml +0 -32275
- package/src/benchmark/benches/recommended-oas3.bench.ts +0 -22
- package/src/benchmark/benches/resolve-with-no-external.bench.ts +0 -23
- package/src/benchmark/benchmark.js +0 -311
- package/src/benchmark/colors.js +0 -29
- package/src/benchmark/fork.js +0 -83
- package/src/benchmark/utils.ts +0 -36
- package/src/bundle.ts +0 -399
- package/src/config/__tests__/__snapshots__/config-resolvers.test.ts.snap +0 -161
- package/src/config/__tests__/__snapshots__/config.test.ts.snap +0 -144
- package/src/config/__tests__/config-resolvers.test.ts +0 -491
- package/src/config/__tests__/config.test.ts +0 -307
- package/src/config/__tests__/fixtures/ingore-file.ts +0 -8
- package/src/config/__tests__/fixtures/load-redocly.yaml +0 -2
- package/src/config/__tests__/fixtures/plugin-config.yaml +0 -2
- package/src/config/__tests__/fixtures/plugin.js +0 -56
- package/src/config/__tests__/fixtures/resolve-config/api/nested-config.yaml +0 -11
- package/src/config/__tests__/fixtures/resolve-config/api/plugin.js +0 -69
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-circular.yaml +0 -7
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-custom-function.yaml +0 -17
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-file.yaml +0 -18
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-wrong-custom-function.yaml +0 -15
- package/src/config/__tests__/fixtures/resolve-config/local-config.yaml +0 -9
- package/src/config/__tests__/fixtures/resolve-config/plugin.js +0 -80
- package/src/config/__tests__/fixtures/resolve-remote-configs/nested-remote-config.yaml +0 -3
- package/src/config/__tests__/fixtures/resolve-remote-configs/remote-config.yaml +0 -4
- package/src/config/__tests__/load.test.ts +0 -167
- package/src/config/__tests__/resolve-plugins.test.ts +0 -27
- package/src/config/__tests__/utils.test.ts +0 -204
- package/src/config/all.ts +0 -73
- package/src/config/builtIn.ts +0 -37
- package/src/config/config-resolvers.ts +0 -465
- package/src/config/config.ts +0 -330
- package/src/config/index.ts +0 -7
- package/src/config/load.ts +0 -144
- package/src/config/minimal.ts +0 -60
- package/src/config/recommended.ts +0 -60
- package/src/config/rules.ts +0 -54
- package/src/config/types.ts +0 -216
- package/src/config/utils.ts +0 -333
- package/src/decorators/__tests__/filter-in.test.ts +0 -310
- package/src/decorators/__tests__/filter-out.test.ts +0 -335
- package/src/decorators/__tests__/media-type-examples-override.test.ts +0 -665
- package/src/decorators/__tests__/remove-x-internal.test.ts +0 -316
- package/src/decorators/__tests__/resources/request.yaml +0 -3
- package/src/decorators/__tests__/resources/response.yaml +0 -3
- package/src/decorators/common/filters/filter-helper.ts +0 -72
- package/src/decorators/common/filters/filter-in.ts +0 -18
- package/src/decorators/common/filters/filter-out.ts +0 -18
- package/src/decorators/common/info-description-override.ts +0 -24
- package/src/decorators/common/info-override.ts +0 -15
- package/src/decorators/common/media-type-examples-override.ts +0 -79
- package/src/decorators/common/operation-description-override.ts +0 -30
- package/src/decorators/common/registry-dependencies.ts +0 -25
- package/src/decorators/common/remove-x-internal.ts +0 -59
- package/src/decorators/common/tag-description-override.ts +0 -25
- package/src/decorators/oas2/index.ts +0 -20
- package/src/decorators/oas3/index.ts +0 -22
- package/src/env.ts +0 -5
- package/src/format/codeframes.ts +0 -216
- package/src/format/format.ts +0 -375
- package/src/index.ts +0 -71
- package/src/js-yaml/index.ts +0 -14
- package/src/lint.ts +0 -130
- package/src/logger.ts +0 -34
- package/src/oas-types.ts +0 -57
- package/src/output.ts +0 -7
- package/src/redocly/__tests__/redocly-client.test.ts +0 -146
- package/src/redocly/index.ts +0 -187
- package/src/redocly/redocly-client-types.ts +0 -10
- package/src/redocly/registry-api-types.ts +0 -32
- package/src/redocly/registry-api.ts +0 -149
- package/src/ref-utils.ts +0 -85
- package/src/resolve.ts +0 -417
- package/src/rules/__tests__/fixtures/code-sample.php +0 -9
- package/src/rules/__tests__/fixtures/invalid-yaml.yaml +0 -1
- package/src/rules/__tests__/fixtures/ref.yaml +0 -1
- package/src/rules/__tests__/no-unresolved-refs.test.ts +0 -257
- package/src/rules/__tests__/utils.test.ts +0 -160
- package/src/rules/ajv.ts +0 -102
- package/src/rules/common/__tests__/info-license.test.ts +0 -62
- package/src/rules/common/__tests__/license-url.test.ts +0 -63
- package/src/rules/common/__tests__/no-ambiguous-paths.test.ts +0 -96
- package/src/rules/common/__tests__/no-enum-type-mismatch.test.ts +0 -210
- package/src/rules/common/__tests__/no-identical-paths.test.ts +0 -58
- package/src/rules/common/__tests__/no-path-trailing-slash.test.ts +0 -85
- package/src/rules/common/__tests__/operation-2xx-response.test.ts +0 -192
- package/src/rules/common/__tests__/operation-4xx-response.test.ts +0 -231
- package/src/rules/common/__tests__/operation-operationId-unique.test.ts +0 -76
- package/src/rules/common/__tests__/operation-operationId-url-safe.test.ts +0 -45
- package/src/rules/common/__tests__/operation-parameters-unique.test.ts +0 -167
- package/src/rules/common/__tests__/operation-singular-tag.test.ts +0 -72
- package/src/rules/common/__tests__/path-http-verbs-order.test.ts +0 -95
- package/src/rules/common/__tests__/path-not-include-query.test.ts +0 -64
- package/src/rules/common/__tests__/path-params-defined.test.ts +0 -202
- package/src/rules/common/__tests__/paths-kebab-case.test.ts +0 -108
- package/src/rules/common/__tests__/scalar-property-missing-example.test.ts +0 -264
- package/src/rules/common/__tests__/security-defined.test.ts +0 -175
- package/src/rules/common/__tests__/spec.test.ts +0 -555
- package/src/rules/common/__tests__/tag-description.test.ts +0 -65
- package/src/rules/common/__tests__/tags-alphabetical.test.ts +0 -64
- package/src/rules/common/assertions/__tests__/asserts.test.ts +0 -869
- package/src/rules/common/assertions/__tests__/index.test.ts +0 -100
- package/src/rules/common/assertions/__tests__/utils.test.ts +0 -236
- package/src/rules/common/assertions/asserts.ts +0 -357
- package/src/rules/common/assertions/index.ts +0 -56
- package/src/rules/common/assertions/utils.ts +0 -331
- package/src/rules/common/info-contact.ts +0 -15
- package/src/rules/common/info-license-url.ts +0 -10
- package/src/rules/common/info-license.ts +0 -15
- package/src/rules/common/no-ambiguous-paths.ts +0 -50
- package/src/rules/common/no-enum-type-mismatch.ts +0 -52
- package/src/rules/common/no-http-verbs-in-paths.ts +0 -36
- package/src/rules/common/no-identical-paths.ts +0 -24
- package/src/rules/common/no-invalid-parameter-examples.ts +0 -36
- package/src/rules/common/no-invalid-schema-examples.ts +0 -27
- package/src/rules/common/no-path-trailing-slash.ts +0 -15
- package/src/rules/common/operation-2xx-response.ts +0 -24
- package/src/rules/common/operation-4xx-response.ts +0 -24
- package/src/rules/common/operation-description.ts +0 -13
- package/src/rules/common/operation-operationId-unique.ts +0 -21
- package/src/rules/common/operation-operationId-url-safe.ts +0 -19
- package/src/rules/common/operation-operationId.ts +0 -17
- package/src/rules/common/operation-parameters-unique.ts +0 -48
- package/src/rules/common/operation-singular-tag.ts +0 -17
- package/src/rules/common/operation-summary.ts +0 -13
- package/src/rules/common/operation-tag-defined.ts +0 -26
- package/src/rules/common/parameter-description.ts +0 -22
- package/src/rules/common/path-declaration-must-exist.ts +0 -15
- package/src/rules/common/path-excludes-patterns.ts +0 -23
- package/src/rules/common/path-http-verbs-order.ts +0 -30
- package/src/rules/common/path-not-include-query.ts +0 -17
- package/src/rules/common/path-params-defined.ts +0 -65
- package/src/rules/common/path-segment-plural.ts +0 -31
- package/src/rules/common/paths-kebab-case.ts +0 -19
- package/src/rules/common/required-string-property-missing-min-length.ts +0 -44
- package/src/rules/common/response-contains-header.ts +0 -35
- package/src/rules/common/scalar-property-missing-example.ts +0 -58
- package/src/rules/common/security-defined.ts +0 -65
- package/src/rules/common/spec.ts +0 -174
- package/src/rules/common/tag-description.ts +0 -10
- package/src/rules/common/tags-alphabetical.ts +0 -20
- package/src/rules/no-unresolved-refs.ts +0 -51
- package/src/rules/oas2/__tests__/boolean-parameter-prefixes.test.ts +0 -110
- package/src/rules/oas2/__tests__/response-contains-header.test.ts +0 -174
- package/src/rules/oas2/__tests__/response-contains-property.test.ts +0 -155
- package/src/rules/oas2/__tests__/spec/fixtures/description.md +0 -1
- package/src/rules/oas2/__tests__/spec/info.test.ts +0 -355
- package/src/rules/oas2/__tests__/spec/operation.test.ts +0 -123
- package/src/rules/oas2/__tests__/spec/paths.test.ts +0 -245
- package/src/rules/oas2/__tests__/spec/referenceableScalars.test.ts +0 -35
- package/src/rules/oas2/__tests__/spec/utils.ts +0 -32
- package/src/rules/oas2/boolean-parameter-prefixes.ts +0 -26
- package/src/rules/oas2/index.ts +0 -89
- package/src/rules/oas2/remove-unused-components.ts +0 -81
- package/src/rules/oas2/request-mime-type.ts +0 -17
- package/src/rules/oas2/response-contains-property.ts +0 -36
- package/src/rules/oas2/response-mime-type.ts +0 -17
- package/src/rules/oas3/__tests__/boolean-parameter-prefixes.test.ts +0 -111
- package/src/rules/oas3/__tests__/fixtures/common.yaml +0 -11
- package/src/rules/oas3/__tests__/no-empty-enum-servers.com.test.ts +0 -205
- package/src/rules/oas3/__tests__/no-example-value-and-externalValue.test.ts +0 -65
- package/src/rules/oas3/__tests__/no-invalid-media-type-examples.test.ts +0 -473
- package/src/rules/oas3/__tests__/no-server-example.com.test.ts +0 -60
- package/src/rules/oas3/__tests__/no-server-trailing-slash.test.ts +0 -79
- package/src/rules/oas3/__tests__/no-unused-components.test.ts +0 -131
- package/src/rules/oas3/__tests__/operation-4xx-problem-details-rfc7807.test.ts +0 -145
- package/src/rules/oas3/__tests__/response-contains-header.test.ts +0 -389
- package/src/rules/oas3/__tests__/response-contains-property.test.ts +0 -403
- package/src/rules/oas3/__tests__/spec/callbacks.test.ts +0 -41
- package/src/rules/oas3/__tests__/spec/fixtures/description.md +0 -1
- package/src/rules/oas3/__tests__/spec/info.test.ts +0 -391
- package/src/rules/oas3/__tests__/spec/operation.test.ts +0 -253
- package/src/rules/oas3/__tests__/spec/paths.test.ts +0 -284
- package/src/rules/oas3/__tests__/spec/referenceableScalars.test.ts +0 -77
- package/src/rules/oas3/__tests__/spec/servers.test.ts +0 -505
- package/src/rules/oas3/__tests__/spec/spec.test.ts +0 -298
- package/src/rules/oas3/__tests__/spec/utils.ts +0 -32
- package/src/rules/oas3/__tests__/spec-components-invalid-map-name.test.ts +0 -305
- package/src/rules/oas3/boolean-parameter-prefixes.ts +0 -28
- package/src/rules/oas3/index.ts +0 -109
- package/src/rules/oas3/no-empty-servers.ts +0 -22
- package/src/rules/oas3/no-example-value-and-externalValue.ts +0 -14
- package/src/rules/oas3/no-invalid-media-type-examples.ts +0 -49
- package/src/rules/oas3/no-server-example.com.ts +0 -14
- package/src/rules/oas3/no-server-trailing-slash.ts +0 -15
- package/src/rules/oas3/no-server-variables-empty-enum.ts +0 -66
- package/src/rules/oas3/no-undefined-server-variable.ts +0 -30
- package/src/rules/oas3/no-unused-components.ts +0 -75
- package/src/rules/oas3/operation-4xx-problem-details-rfc7807.ts +0 -36
- package/src/rules/oas3/remove-unused-components.ts +0 -95
- package/src/rules/oas3/request-mime-type.ts +0 -31
- package/src/rules/oas3/response-contains-property.ts +0 -38
- package/src/rules/oas3/response-mime-type.ts +0 -31
- package/src/rules/oas3/spec-components-invalid-map-name.ts +0 -74
- package/src/rules/other/stats.ts +0 -73
- package/src/rules/utils.ts +0 -191
- package/src/types/index.ts +0 -149
- package/src/types/oas2.ts +0 -478
- package/src/types/oas3.ts +0 -597
- package/src/types/oas3_1.ts +0 -258
- package/src/types/redocly-yaml.ts +0 -1010
- package/src/typings/common.ts +0 -17
- package/src/typings/openapi.ts +0 -298
- package/src/typings/swagger.ts +0 -236
- package/src/utils.ts +0 -276
- package/src/visitors.ts +0 -491
- package/src/walk.ts +0 -453
- package/tsconfig.json +0 -8
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -1,1010 +0,0 @@
|
|
|
1
|
-
import { NodeType, listOf } from '.';
|
|
2
|
-
import { omitObjectProps, pickObjectProps, isCustomRuleId } from '../utils';
|
|
3
|
-
|
|
4
|
-
const builtInRulesList = [
|
|
5
|
-
'spec',
|
|
6
|
-
'info-contact',
|
|
7
|
-
'info-license',
|
|
8
|
-
'info-license-url',
|
|
9
|
-
'operation-2xx-response',
|
|
10
|
-
'operation-4xx-response',
|
|
11
|
-
'operation-4xx-problem-details-rfc7807',
|
|
12
|
-
'assertions',
|
|
13
|
-
'operation-operationId-unique',
|
|
14
|
-
'operation-parameters-unique',
|
|
15
|
-
'path-parameters-defined',
|
|
16
|
-
'operation-tag-defined',
|
|
17
|
-
'no-example-value-and-externalValue',
|
|
18
|
-
'no-enum-type-mismatch',
|
|
19
|
-
'no-path-trailing-slash',
|
|
20
|
-
'no-empty-servers',
|
|
21
|
-
'path-declaration-must-exist',
|
|
22
|
-
'operation-operationId-url-safe',
|
|
23
|
-
'operation-operationId',
|
|
24
|
-
'operation-summary',
|
|
25
|
-
'tags-alphabetical',
|
|
26
|
-
'no-server-example.com',
|
|
27
|
-
'no-server-trailing-slash',
|
|
28
|
-
'tag-description',
|
|
29
|
-
'operation-description',
|
|
30
|
-
'no-unused-components',
|
|
31
|
-
'path-not-include-query',
|
|
32
|
-
'path-params-defined',
|
|
33
|
-
'parameter-description',
|
|
34
|
-
'operation-singular-tag',
|
|
35
|
-
'security-defined',
|
|
36
|
-
'no-unresolved-refs',
|
|
37
|
-
'paths-kebab-case',
|
|
38
|
-
'boolean-parameter-prefixes',
|
|
39
|
-
'path-http-verbs-order',
|
|
40
|
-
'no-invalid-media-type-examples',
|
|
41
|
-
'no-identical-paths',
|
|
42
|
-
'no-ambiguous-paths',
|
|
43
|
-
'no-undefined-server-variable',
|
|
44
|
-
'no-server-variables-empty-enum',
|
|
45
|
-
'no-http-verbs-in-paths',
|
|
46
|
-
'path-excludes-patterns',
|
|
47
|
-
'request-mime-type',
|
|
48
|
-
'response-mime-type',
|
|
49
|
-
'path-segment-plural',
|
|
50
|
-
'no-invalid-schema-examples',
|
|
51
|
-
'no-invalid-parameter-examples',
|
|
52
|
-
'response-contains-header',
|
|
53
|
-
'response-contains-property',
|
|
54
|
-
'scalar-property-missing-example',
|
|
55
|
-
'spec-components-invalid-map-name',
|
|
56
|
-
'required-string-property-missing-min-length',
|
|
57
|
-
];
|
|
58
|
-
const nodeTypesList = [
|
|
59
|
-
'any',
|
|
60
|
-
'Root',
|
|
61
|
-
'Tag',
|
|
62
|
-
'TagList',
|
|
63
|
-
'ExternalDocs',
|
|
64
|
-
'Server',
|
|
65
|
-
'ServerList',
|
|
66
|
-
'ServerVariable',
|
|
67
|
-
'ServerVariablesMap',
|
|
68
|
-
'SecurityRequirement',
|
|
69
|
-
'SecurityRequirementList',
|
|
70
|
-
'Info',
|
|
71
|
-
'Contact',
|
|
72
|
-
'License',
|
|
73
|
-
'Paths',
|
|
74
|
-
'PathItem',
|
|
75
|
-
'Parameter',
|
|
76
|
-
'ParameterList',
|
|
77
|
-
'Operation',
|
|
78
|
-
'Callback',
|
|
79
|
-
'CallbacksMap',
|
|
80
|
-
'RequestBody',
|
|
81
|
-
'MediaTypesMap',
|
|
82
|
-
'MediaType',
|
|
83
|
-
'Example',
|
|
84
|
-
'ExamplesMap',
|
|
85
|
-
'Encoding',
|
|
86
|
-
'EncodingMap',
|
|
87
|
-
'Header',
|
|
88
|
-
'HeadersMap',
|
|
89
|
-
'Responses',
|
|
90
|
-
'Response',
|
|
91
|
-
'Link',
|
|
92
|
-
'LinksMap',
|
|
93
|
-
'Schema',
|
|
94
|
-
'Xml',
|
|
95
|
-
'SchemaProperties',
|
|
96
|
-
'DiscriminatorMapping',
|
|
97
|
-
'Discriminator',
|
|
98
|
-
'Components',
|
|
99
|
-
'NamedSchemas',
|
|
100
|
-
'NamedResponses',
|
|
101
|
-
'NamedParameters',
|
|
102
|
-
'NamedExamples',
|
|
103
|
-
'NamedRequestBodies',
|
|
104
|
-
'NamedHeaders',
|
|
105
|
-
'NamedSecuritySchemes',
|
|
106
|
-
'NamedLinks',
|
|
107
|
-
'NamedCallbacks',
|
|
108
|
-
'ImplicitFlow',
|
|
109
|
-
'PasswordFlow',
|
|
110
|
-
'ClientCredentials',
|
|
111
|
-
'AuthorizationCode',
|
|
112
|
-
'OAuth2Flows',
|
|
113
|
-
'SecurityScheme',
|
|
114
|
-
'XCodeSample',
|
|
115
|
-
'XCodeSampleList',
|
|
116
|
-
'WebhooksMap',
|
|
117
|
-
'SpecExtension',
|
|
118
|
-
];
|
|
119
|
-
|
|
120
|
-
const ConfigStyleguide: NodeType = {
|
|
121
|
-
properties: {
|
|
122
|
-
extends: {
|
|
123
|
-
type: 'array',
|
|
124
|
-
items: {
|
|
125
|
-
type: 'string',
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
rules: 'Rules',
|
|
129
|
-
oas2Rules: 'Rules',
|
|
130
|
-
oas3_0Rules: 'Rules',
|
|
131
|
-
oas3_1Rules: 'Rules',
|
|
132
|
-
preprocessors: { type: 'object' },
|
|
133
|
-
oas2Preprocessors: { type: 'object' },
|
|
134
|
-
oas3_0Preprocessors: { type: 'object' },
|
|
135
|
-
oas3_1Preprocessors: { type: 'object' },
|
|
136
|
-
decorators: { type: 'object' },
|
|
137
|
-
oas2Decorators: { type: 'object' },
|
|
138
|
-
oas3_0Decorators: { type: 'object' },
|
|
139
|
-
oas3_1Decorators: { type: 'object' },
|
|
140
|
-
},
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
const RootConfigStyleguide: NodeType = {
|
|
144
|
-
properties: {
|
|
145
|
-
plugins: {
|
|
146
|
-
type: 'array',
|
|
147
|
-
items: { type: 'string' },
|
|
148
|
-
},
|
|
149
|
-
...ConfigStyleguide.properties,
|
|
150
|
-
},
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
const ConfigRoot: NodeType = {
|
|
154
|
-
properties: {
|
|
155
|
-
organization: { type: 'string' },
|
|
156
|
-
apis: 'ConfigApis',
|
|
157
|
-
...RootConfigStyleguide.properties,
|
|
158
|
-
theme: 'ConfigRootTheme',
|
|
159
|
-
'features.openapi': 'ConfigReferenceDocs', // deprecated
|
|
160
|
-
'features.mockServer': 'ConfigMockServer', // deprecated
|
|
161
|
-
region: { enum: ['us', 'eu'] },
|
|
162
|
-
resolve: {
|
|
163
|
-
properties: {
|
|
164
|
-
http: 'ConfigHTTP',
|
|
165
|
-
doNotResolveExamples: { type: 'boolean' },
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
files: {
|
|
169
|
-
type: 'array',
|
|
170
|
-
items: {
|
|
171
|
-
type: 'string',
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
|
-
},
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
const ConfigApis: NodeType = {
|
|
178
|
-
properties: {},
|
|
179
|
-
additionalProperties: 'ConfigApisProperties',
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
const ConfigApisProperties: NodeType = {
|
|
183
|
-
properties: {
|
|
184
|
-
root: { type: 'string' },
|
|
185
|
-
labels: {
|
|
186
|
-
type: 'array',
|
|
187
|
-
items: {
|
|
188
|
-
type: 'string',
|
|
189
|
-
},
|
|
190
|
-
},
|
|
191
|
-
lint: 'ConfigStyleguide', // deprecated
|
|
192
|
-
styleguide: 'ConfigStyleguide', // deprecated
|
|
193
|
-
...ConfigStyleguide.properties,
|
|
194
|
-
'features.openapi': 'ConfigReferenceDocs', // deprecated
|
|
195
|
-
'features.mockServer': 'ConfigMockServer', // deprecated
|
|
196
|
-
theme: 'ConfigRootTheme',
|
|
197
|
-
files: {
|
|
198
|
-
type: 'array',
|
|
199
|
-
items: {
|
|
200
|
-
type: 'string',
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
|
-
},
|
|
204
|
-
required: ['root'],
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
const ConfigHTTP: NodeType = {
|
|
208
|
-
properties: {
|
|
209
|
-
headers: {
|
|
210
|
-
type: 'array',
|
|
211
|
-
items: {
|
|
212
|
-
type: 'string',
|
|
213
|
-
},
|
|
214
|
-
},
|
|
215
|
-
},
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
const ConfigRootTheme: NodeType = {
|
|
219
|
-
properties: {
|
|
220
|
-
openapi: 'ConfigReferenceDocs',
|
|
221
|
-
mockServer: 'ConfigMockServer',
|
|
222
|
-
},
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
const Rules: NodeType = {
|
|
226
|
-
properties: {},
|
|
227
|
-
additionalProperties: (value: unknown, key: string) => {
|
|
228
|
-
if (key.startsWith('assert/')) {
|
|
229
|
-
return 'Assert';
|
|
230
|
-
} else if (builtInRulesList.includes(key) || isCustomRuleId(key)) {
|
|
231
|
-
if (typeof value === 'string') {
|
|
232
|
-
return { enum: ['error', 'warn', 'off'] };
|
|
233
|
-
} else {
|
|
234
|
-
return 'ObjectRule';
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
// Otherwise is considered as invalid
|
|
238
|
-
return;
|
|
239
|
-
},
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
const ObjectRule: NodeType = {
|
|
243
|
-
properties: {
|
|
244
|
-
severity: { enum: ['error', 'warn', 'off'] },
|
|
245
|
-
},
|
|
246
|
-
additionalProperties: {},
|
|
247
|
-
required: ['severity'],
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
const AssertionDefinitionSubject: NodeType = {
|
|
251
|
-
properties: {
|
|
252
|
-
type: { enum: nodeTypesList },
|
|
253
|
-
property: (value: unknown) => {
|
|
254
|
-
if (Array.isArray(value)) {
|
|
255
|
-
return { type: 'array', items: { type: 'string' } };
|
|
256
|
-
} else if (value === null) {
|
|
257
|
-
return null;
|
|
258
|
-
} else {
|
|
259
|
-
return { type: 'string' };
|
|
260
|
-
}
|
|
261
|
-
},
|
|
262
|
-
filterInParentKeys: { type: 'array', items: { type: 'string' } },
|
|
263
|
-
filterOutParentKeys: { type: 'array', items: { type: 'string' } },
|
|
264
|
-
matchParentKeys: { type: 'string' },
|
|
265
|
-
},
|
|
266
|
-
required: ['type'],
|
|
267
|
-
};
|
|
268
|
-
|
|
269
|
-
const AssertionDefinitionAssertions: NodeType = {
|
|
270
|
-
properties: {
|
|
271
|
-
enum: { type: 'array', items: { type: 'string' } },
|
|
272
|
-
pattern: { type: 'string' },
|
|
273
|
-
notPattern: { type: 'string' },
|
|
274
|
-
casing: {
|
|
275
|
-
enum: [
|
|
276
|
-
'camelCase',
|
|
277
|
-
'kebab-case',
|
|
278
|
-
'snake_case',
|
|
279
|
-
'PascalCase',
|
|
280
|
-
'MACRO_CASE',
|
|
281
|
-
'COBOL-CASE',
|
|
282
|
-
'flatcase',
|
|
283
|
-
],
|
|
284
|
-
},
|
|
285
|
-
mutuallyExclusive: { type: 'array', items: { type: 'string' } },
|
|
286
|
-
mutuallyRequired: { type: 'array', items: { type: 'string' } },
|
|
287
|
-
required: { type: 'array', items: { type: 'string' } },
|
|
288
|
-
requireAny: { type: 'array', items: { type: 'string' } },
|
|
289
|
-
disallowed: { type: 'array', items: { type: 'string' } },
|
|
290
|
-
defined: { type: 'boolean' },
|
|
291
|
-
// undefined: { type: 'boolean' }, // TODO: Remove `undefined` assertion from codebase overall
|
|
292
|
-
nonEmpty: { type: 'boolean' },
|
|
293
|
-
minLength: { type: 'integer' },
|
|
294
|
-
maxLength: { type: 'integer' },
|
|
295
|
-
ref: (value: string | boolean) =>
|
|
296
|
-
typeof value === 'string' ? { type: 'string' } : { type: 'boolean' },
|
|
297
|
-
const: (value: string | boolean | number) => {
|
|
298
|
-
if (typeof value === 'string') {
|
|
299
|
-
return { type: 'string' };
|
|
300
|
-
}
|
|
301
|
-
if (typeof value === 'number') {
|
|
302
|
-
return { type: 'number' };
|
|
303
|
-
}
|
|
304
|
-
if (typeof value === 'boolean') {
|
|
305
|
-
return { type: 'boolean' };
|
|
306
|
-
} else {
|
|
307
|
-
return;
|
|
308
|
-
}
|
|
309
|
-
},
|
|
310
|
-
},
|
|
311
|
-
additionalProperties: (_value: unknown, key: string) => {
|
|
312
|
-
if (/^\w+\/\w+$/.test(key)) return { type: 'object' };
|
|
313
|
-
return;
|
|
314
|
-
},
|
|
315
|
-
};
|
|
316
|
-
|
|
317
|
-
const AssertDefinition: NodeType = {
|
|
318
|
-
properties: {
|
|
319
|
-
subject: 'AssertionDefinitionSubject',
|
|
320
|
-
assertions: 'AssertionDefinitionAssertions',
|
|
321
|
-
},
|
|
322
|
-
required: ['subject', 'assertions'],
|
|
323
|
-
};
|
|
324
|
-
|
|
325
|
-
const Assert: NodeType = {
|
|
326
|
-
properties: {
|
|
327
|
-
subject: 'AssertionDefinitionSubject',
|
|
328
|
-
assertions: 'AssertionDefinitionAssertions',
|
|
329
|
-
where: listOf('AssertDefinition'),
|
|
330
|
-
message: { type: 'string' },
|
|
331
|
-
suggest: { type: 'array', items: { type: 'string' } },
|
|
332
|
-
severity: { enum: ['error', 'warn', 'off'] },
|
|
333
|
-
},
|
|
334
|
-
required: ['subject', 'assertions'],
|
|
335
|
-
};
|
|
336
|
-
|
|
337
|
-
const ConfigLanguage: NodeType = {
|
|
338
|
-
properties: {
|
|
339
|
-
label: { type: 'string' },
|
|
340
|
-
lang: {
|
|
341
|
-
enum: [
|
|
342
|
-
'curl',
|
|
343
|
-
'C#',
|
|
344
|
-
'Go',
|
|
345
|
-
'Java',
|
|
346
|
-
'Java8+Apache',
|
|
347
|
-
'JavaScript',
|
|
348
|
-
'Node.js',
|
|
349
|
-
'PHP',
|
|
350
|
-
'Python',
|
|
351
|
-
'R',
|
|
352
|
-
'Ruby',
|
|
353
|
-
],
|
|
354
|
-
},
|
|
355
|
-
},
|
|
356
|
-
required: ['lang'],
|
|
357
|
-
};
|
|
358
|
-
|
|
359
|
-
const ConfigLabels: NodeType = {
|
|
360
|
-
properties: {
|
|
361
|
-
enum: { type: 'string' },
|
|
362
|
-
enumSingleValue: { type: 'string' },
|
|
363
|
-
enumArray: { type: 'string' },
|
|
364
|
-
default: { type: 'string' },
|
|
365
|
-
deprecated: { type: 'string' },
|
|
366
|
-
example: { type: 'string' },
|
|
367
|
-
examples: { type: 'string' },
|
|
368
|
-
nullable: { type: 'string' },
|
|
369
|
-
recursive: { type: 'string' },
|
|
370
|
-
arrayOf: { type: 'string' },
|
|
371
|
-
webhook: { type: 'string' },
|
|
372
|
-
authorizations: { type: 'string' },
|
|
373
|
-
tryItAuthBasicUsername: { type: 'string' },
|
|
374
|
-
tryItAuthBasicPassword: { type: 'string' },
|
|
375
|
-
},
|
|
376
|
-
};
|
|
377
|
-
|
|
378
|
-
const ConfigSidebarLinks: NodeType = {
|
|
379
|
-
properties: {
|
|
380
|
-
beforeInfo: listOf('CommonConfigSidebarLinks'),
|
|
381
|
-
end: listOf('CommonConfigSidebarLinks'),
|
|
382
|
-
},
|
|
383
|
-
};
|
|
384
|
-
|
|
385
|
-
const CommonConfigSidebarLinks: NodeType = {
|
|
386
|
-
properties: {
|
|
387
|
-
label: { type: 'string' },
|
|
388
|
-
link: { type: 'string' },
|
|
389
|
-
target: { type: 'string' },
|
|
390
|
-
},
|
|
391
|
-
required: ['label', 'link'],
|
|
392
|
-
};
|
|
393
|
-
|
|
394
|
-
const CommonThemeColors: NodeType = {
|
|
395
|
-
properties: {
|
|
396
|
-
main: { type: 'string' },
|
|
397
|
-
light: { type: 'string' },
|
|
398
|
-
dark: { type: 'string' },
|
|
399
|
-
contrastText: { type: 'string' },
|
|
400
|
-
},
|
|
401
|
-
};
|
|
402
|
-
|
|
403
|
-
const CommonColorProps: NodeType = {
|
|
404
|
-
properties: {
|
|
405
|
-
backgroundColor: { type: 'string' },
|
|
406
|
-
borderColor: { type: 'string' },
|
|
407
|
-
color: { type: 'string' },
|
|
408
|
-
tabTextColor: { type: 'string' },
|
|
409
|
-
},
|
|
410
|
-
};
|
|
411
|
-
|
|
412
|
-
const BorderThemeColors: NodeType = {
|
|
413
|
-
properties: pickObjectProps(CommonThemeColors.properties, ['light', 'dark']),
|
|
414
|
-
};
|
|
415
|
-
|
|
416
|
-
const HttpColors: NodeType = {
|
|
417
|
-
properties: {
|
|
418
|
-
basic: { type: 'string' },
|
|
419
|
-
delete: { type: 'string' },
|
|
420
|
-
get: { type: 'string' },
|
|
421
|
-
head: { type: 'string' },
|
|
422
|
-
link: { type: 'string' },
|
|
423
|
-
options: { type: 'string' },
|
|
424
|
-
patch: { type: 'string' },
|
|
425
|
-
post: { type: 'string' },
|
|
426
|
-
put: { type: 'string' },
|
|
427
|
-
},
|
|
428
|
-
};
|
|
429
|
-
|
|
430
|
-
const ResponseColors: NodeType = {
|
|
431
|
-
properties: {
|
|
432
|
-
error: 'CommonColorProps',
|
|
433
|
-
info: 'CommonColorProps',
|
|
434
|
-
redirect: 'CommonColorProps',
|
|
435
|
-
success: 'CommonColorProps',
|
|
436
|
-
},
|
|
437
|
-
};
|
|
438
|
-
|
|
439
|
-
const SecondaryColors: NodeType = {
|
|
440
|
-
properties: omitObjectProps(CommonThemeColors.properties, ['dark']),
|
|
441
|
-
};
|
|
442
|
-
|
|
443
|
-
const TextThemeColors: NodeType = {
|
|
444
|
-
properties: {
|
|
445
|
-
primary: { type: 'string' },
|
|
446
|
-
secondary: { type: 'string' },
|
|
447
|
-
light: { type: 'string' },
|
|
448
|
-
},
|
|
449
|
-
};
|
|
450
|
-
|
|
451
|
-
const ThemeColors: NodeType = {
|
|
452
|
-
properties: {
|
|
453
|
-
accent: 'CommonThemeColors',
|
|
454
|
-
border: 'BorderThemeColors',
|
|
455
|
-
error: 'CommonThemeColors',
|
|
456
|
-
http: 'HttpColors',
|
|
457
|
-
primary: 'CommonThemeColors',
|
|
458
|
-
responses: 'ResponseColors',
|
|
459
|
-
secondary: 'SecondaryColors',
|
|
460
|
-
success: 'CommonThemeColors',
|
|
461
|
-
text: 'TextThemeColors',
|
|
462
|
-
tonalOffset: { type: 'number' },
|
|
463
|
-
warning: 'CommonThemeColors',
|
|
464
|
-
},
|
|
465
|
-
};
|
|
466
|
-
|
|
467
|
-
const SizeProps: NodeType = {
|
|
468
|
-
properties: {
|
|
469
|
-
fontSize: { type: 'string' },
|
|
470
|
-
padding: { type: 'string' },
|
|
471
|
-
minWidth: { type: 'string' },
|
|
472
|
-
},
|
|
473
|
-
};
|
|
474
|
-
|
|
475
|
-
const Sizes: NodeType = {
|
|
476
|
-
properties: {
|
|
477
|
-
small: 'SizeProps',
|
|
478
|
-
medium: 'SizeProps',
|
|
479
|
-
large: 'SizeProps',
|
|
480
|
-
xlarge: 'SizeProps',
|
|
481
|
-
},
|
|
482
|
-
};
|
|
483
|
-
|
|
484
|
-
const FontConfig: NodeType = {
|
|
485
|
-
properties: {
|
|
486
|
-
fontFamily: { type: 'string' },
|
|
487
|
-
fontSize: { type: 'string' },
|
|
488
|
-
fontWeight: { type: 'string' },
|
|
489
|
-
lineHeight: { type: 'string' },
|
|
490
|
-
},
|
|
491
|
-
};
|
|
492
|
-
|
|
493
|
-
const ButtonsConfig: NodeType = {
|
|
494
|
-
properties: {
|
|
495
|
-
...omitObjectProps(FontConfig.properties, ['fontSize', 'lineHeight']),
|
|
496
|
-
borderRadius: { type: 'string' },
|
|
497
|
-
hoverStyle: { type: 'string' },
|
|
498
|
-
boxShadow: { type: 'string' },
|
|
499
|
-
hoverBoxShadow: { type: 'string' },
|
|
500
|
-
sizes: 'Sizes',
|
|
501
|
-
},
|
|
502
|
-
};
|
|
503
|
-
|
|
504
|
-
const BadgeFontConfig: NodeType = {
|
|
505
|
-
properties: pickObjectProps(FontConfig.properties, ['fontSize', 'lineHeight']),
|
|
506
|
-
};
|
|
507
|
-
|
|
508
|
-
const BadgeSizes: NodeType = {
|
|
509
|
-
properties: {
|
|
510
|
-
medium: 'BadgeFontConfig',
|
|
511
|
-
small: 'BadgeFontConfig',
|
|
512
|
-
},
|
|
513
|
-
};
|
|
514
|
-
|
|
515
|
-
const HttpBadgesConfig: NodeType = {
|
|
516
|
-
properties: {
|
|
517
|
-
...omitObjectProps(FontConfig.properties, ['fontSize', 'lineHeight']),
|
|
518
|
-
borderRadius: { type: 'string' },
|
|
519
|
-
color: { type: 'string' },
|
|
520
|
-
sizes: 'BadgeSizes',
|
|
521
|
-
},
|
|
522
|
-
};
|
|
523
|
-
|
|
524
|
-
const LabelControls: NodeType = {
|
|
525
|
-
properties: {
|
|
526
|
-
top: { type: 'string' },
|
|
527
|
-
width: { type: 'string' },
|
|
528
|
-
height: { type: 'string' },
|
|
529
|
-
},
|
|
530
|
-
};
|
|
531
|
-
|
|
532
|
-
const Panels: NodeType = {
|
|
533
|
-
properties: {
|
|
534
|
-
borderRadius: { type: 'string' },
|
|
535
|
-
backgroundColor: { type: 'string' },
|
|
536
|
-
},
|
|
537
|
-
};
|
|
538
|
-
|
|
539
|
-
const TryItButton: NodeType = {
|
|
540
|
-
properties: {
|
|
541
|
-
fullWidth: { type: 'boolean' },
|
|
542
|
-
},
|
|
543
|
-
};
|
|
544
|
-
|
|
545
|
-
const Components: NodeType = {
|
|
546
|
-
properties: {
|
|
547
|
-
buttons: 'ButtonsConfig',
|
|
548
|
-
httpBadges: 'HttpBadgesConfig',
|
|
549
|
-
layoutControls: 'LabelControls',
|
|
550
|
-
panels: 'Panels',
|
|
551
|
-
tryItButton: 'TryItButton',
|
|
552
|
-
tryItSendButton: 'TryItButton',
|
|
553
|
-
},
|
|
554
|
-
};
|
|
555
|
-
|
|
556
|
-
const Breakpoints: NodeType = {
|
|
557
|
-
properties: {
|
|
558
|
-
small: { type: 'string' },
|
|
559
|
-
medium: { type: 'string' },
|
|
560
|
-
large: { type: 'string' },
|
|
561
|
-
},
|
|
562
|
-
};
|
|
563
|
-
|
|
564
|
-
const StackedConfig: NodeType = {
|
|
565
|
-
properties: {
|
|
566
|
-
maxWidth: 'Breakpoints',
|
|
567
|
-
},
|
|
568
|
-
};
|
|
569
|
-
|
|
570
|
-
const ThreePanelConfig: NodeType = {
|
|
571
|
-
properties: {
|
|
572
|
-
maxWidth: 'Breakpoints',
|
|
573
|
-
middlePanelMaxWidth: 'Breakpoints',
|
|
574
|
-
},
|
|
575
|
-
};
|
|
576
|
-
|
|
577
|
-
const Layout: NodeType = {
|
|
578
|
-
properties: {
|
|
579
|
-
showDarkRightPanel: { type: 'boolean' },
|
|
580
|
-
stacked: 'StackedConfig',
|
|
581
|
-
'three-panel': 'ThreePanelConfig',
|
|
582
|
-
},
|
|
583
|
-
};
|
|
584
|
-
|
|
585
|
-
const SchemaColorsConfig: NodeType = {
|
|
586
|
-
properties: {
|
|
587
|
-
backgroundColor: { type: 'string' },
|
|
588
|
-
border: { type: 'string' },
|
|
589
|
-
},
|
|
590
|
-
};
|
|
591
|
-
|
|
592
|
-
const Schema: NodeType = {
|
|
593
|
-
properties: {
|
|
594
|
-
breakFieldNames: { type: 'boolean' },
|
|
595
|
-
caretColor: { type: 'string' },
|
|
596
|
-
caretSize: { type: 'string' },
|
|
597
|
-
constraints: 'SchemaColorsConfig',
|
|
598
|
-
defaultDetailsWidth: { type: 'string' },
|
|
599
|
-
examples: 'SchemaColorsConfig',
|
|
600
|
-
labelsTextSize: { type: 'string' },
|
|
601
|
-
linesColor: { type: 'string' },
|
|
602
|
-
nestedBackground: { type: 'string' },
|
|
603
|
-
nestingSpacing: { type: 'string' },
|
|
604
|
-
requireLabelColor: { type: 'string' },
|
|
605
|
-
typeNameColor: { type: 'string' },
|
|
606
|
-
typeTitleColor: { type: 'string' },
|
|
607
|
-
},
|
|
608
|
-
};
|
|
609
|
-
|
|
610
|
-
const GroupItemsConfig: NodeType = {
|
|
611
|
-
properties: {
|
|
612
|
-
subItemsColor: { type: 'string' },
|
|
613
|
-
textTransform: { type: 'string' },
|
|
614
|
-
fontWeight: { type: 'string' },
|
|
615
|
-
},
|
|
616
|
-
};
|
|
617
|
-
|
|
618
|
-
const Level1Items: NodeType = {
|
|
619
|
-
properties: pickObjectProps(GroupItemsConfig.properties, ['textTransform']),
|
|
620
|
-
};
|
|
621
|
-
|
|
622
|
-
const SpacingConfig: NodeType = {
|
|
623
|
-
properties: {
|
|
624
|
-
unit: { type: 'number' },
|
|
625
|
-
paddingHorizontal: { type: 'string' },
|
|
626
|
-
paddingVertical: { type: 'string' },
|
|
627
|
-
offsetTop: { type: 'string' },
|
|
628
|
-
offsetLeft: { type: 'string' },
|
|
629
|
-
offsetNesting: { type: 'string' },
|
|
630
|
-
},
|
|
631
|
-
};
|
|
632
|
-
|
|
633
|
-
const Sidebar: NodeType = {
|
|
634
|
-
properties: {
|
|
635
|
-
...omitObjectProps(FontConfig.properties, ['fontWeight', 'lineHeight']),
|
|
636
|
-
activeBgColor: { type: 'string' },
|
|
637
|
-
activeTextColor: { type: 'string' },
|
|
638
|
-
backgroundColor: { type: 'string' },
|
|
639
|
-
borderRadius: { type: 'string' },
|
|
640
|
-
breakPath: { type: 'boolean' },
|
|
641
|
-
caretColor: { type: 'string' },
|
|
642
|
-
caretSize: { type: 'string' },
|
|
643
|
-
groupItems: 'GroupItemsConfig',
|
|
644
|
-
level1items: 'Level1Items',
|
|
645
|
-
rightLineColor: { type: 'string' },
|
|
646
|
-
separatorLabelColor: { type: 'string' },
|
|
647
|
-
showAtBreakpoint: { type: 'string' },
|
|
648
|
-
spacing: 'SpacingConfig',
|
|
649
|
-
textColor: { type: 'string' },
|
|
650
|
-
width: { type: 'string' },
|
|
651
|
-
},
|
|
652
|
-
};
|
|
653
|
-
|
|
654
|
-
const Heading: NodeType = {
|
|
655
|
-
properties: {
|
|
656
|
-
...FontConfig.properties,
|
|
657
|
-
color: { type: 'string' },
|
|
658
|
-
transform: { type: 'string' },
|
|
659
|
-
},
|
|
660
|
-
};
|
|
661
|
-
|
|
662
|
-
const CodeConfig: NodeType = {
|
|
663
|
-
properties: {
|
|
664
|
-
...FontConfig.properties,
|
|
665
|
-
backgroundColor: { type: 'string' },
|
|
666
|
-
color: { type: 'string' },
|
|
667
|
-
wordBreak: {
|
|
668
|
-
enum: [
|
|
669
|
-
'break-all',
|
|
670
|
-
'break-word',
|
|
671
|
-
'keep-all',
|
|
672
|
-
'normal',
|
|
673
|
-
'revert',
|
|
674
|
-
'unset',
|
|
675
|
-
'inherit',
|
|
676
|
-
'initial',
|
|
677
|
-
],
|
|
678
|
-
},
|
|
679
|
-
wrap: { type: 'boolean' },
|
|
680
|
-
},
|
|
681
|
-
};
|
|
682
|
-
|
|
683
|
-
const HeadingsConfig: NodeType = {
|
|
684
|
-
properties: omitObjectProps(FontConfig.properties, ['fontSize']),
|
|
685
|
-
};
|
|
686
|
-
|
|
687
|
-
const LinksConfig: NodeType = {
|
|
688
|
-
properties: {
|
|
689
|
-
color: { type: 'string' },
|
|
690
|
-
hover: { type: 'string' },
|
|
691
|
-
textDecoration: { type: 'string' },
|
|
692
|
-
hoverTextDecoration: { type: 'string' },
|
|
693
|
-
visited: { type: 'string' },
|
|
694
|
-
},
|
|
695
|
-
};
|
|
696
|
-
|
|
697
|
-
const Typography: NodeType = {
|
|
698
|
-
properties: {
|
|
699
|
-
code: 'CodeConfig',
|
|
700
|
-
fieldName: 'FontConfig',
|
|
701
|
-
...pickObjectProps(FontConfig.properties, ['fontSize', 'fontFamily']),
|
|
702
|
-
fontWeightBold: { type: 'string' },
|
|
703
|
-
fontWeightLight: { type: 'string' },
|
|
704
|
-
fontWeightRegular: { type: 'string' },
|
|
705
|
-
heading1: 'Heading',
|
|
706
|
-
heading2: 'Heading',
|
|
707
|
-
heading3: 'Heading',
|
|
708
|
-
headings: 'HeadingsConfig',
|
|
709
|
-
lineHeight: { type: 'string' },
|
|
710
|
-
links: 'LinksConfig',
|
|
711
|
-
optimizeSpeed: { type: 'boolean' },
|
|
712
|
-
rightPanelHeading: 'Heading',
|
|
713
|
-
smoothing: { enum: ['auto', 'none', 'antialiased', 'subpixel-antialiased', 'grayscale'] },
|
|
714
|
-
},
|
|
715
|
-
};
|
|
716
|
-
|
|
717
|
-
const TokenProps: NodeType = {
|
|
718
|
-
properties: {
|
|
719
|
-
color: { type: 'string' },
|
|
720
|
-
...omitObjectProps(FontConfig.properties, ['fontWeight']),
|
|
721
|
-
},
|
|
722
|
-
};
|
|
723
|
-
|
|
724
|
-
const CodeBlock: NodeType = {
|
|
725
|
-
properties: {
|
|
726
|
-
backgroundColor: { type: 'string' },
|
|
727
|
-
borderRadius: { type: 'string' },
|
|
728
|
-
tokens: 'TokenProps',
|
|
729
|
-
},
|
|
730
|
-
};
|
|
731
|
-
|
|
732
|
-
const Logo: NodeType = {
|
|
733
|
-
properties: {
|
|
734
|
-
gutter: { type: 'string' },
|
|
735
|
-
maxHeight: { type: 'string' },
|
|
736
|
-
maxWidth: { type: 'string' },
|
|
737
|
-
},
|
|
738
|
-
};
|
|
739
|
-
|
|
740
|
-
const Fab: NodeType = {
|
|
741
|
-
properties: {
|
|
742
|
-
backgroundColor: { type: 'string' },
|
|
743
|
-
color: { type: 'string' },
|
|
744
|
-
},
|
|
745
|
-
};
|
|
746
|
-
|
|
747
|
-
const ButtonOverrides: NodeType = {
|
|
748
|
-
properties: {
|
|
749
|
-
custom: { type: 'string' },
|
|
750
|
-
},
|
|
751
|
-
};
|
|
752
|
-
|
|
753
|
-
const Overrides: NodeType = {
|
|
754
|
-
properties: {
|
|
755
|
-
DownloadButton: 'ButtonOverrides',
|
|
756
|
-
NextSectionButton: 'ButtonOverrides',
|
|
757
|
-
},
|
|
758
|
-
};
|
|
759
|
-
|
|
760
|
-
const RightPanel: NodeType = {
|
|
761
|
-
properties: {
|
|
762
|
-
backgroundColor: { type: 'string' },
|
|
763
|
-
panelBackgroundColor: { type: 'string' },
|
|
764
|
-
panelControlsBackgroundColor: { type: 'string' },
|
|
765
|
-
showAtBreakpoint: { type: 'string' },
|
|
766
|
-
textColor: { type: 'string' },
|
|
767
|
-
width: { type: 'string' },
|
|
768
|
-
},
|
|
769
|
-
};
|
|
770
|
-
|
|
771
|
-
const Shape: NodeType = {
|
|
772
|
-
properties: { borderRadius: { type: 'string' } },
|
|
773
|
-
};
|
|
774
|
-
|
|
775
|
-
const ThemeSpacing: NodeType = {
|
|
776
|
-
properties: {
|
|
777
|
-
sectionHorizontal: { type: 'number' },
|
|
778
|
-
sectionVertical: { type: 'number' },
|
|
779
|
-
unit: { type: 'number' },
|
|
780
|
-
},
|
|
781
|
-
};
|
|
782
|
-
|
|
783
|
-
const ConfigTheme: NodeType = {
|
|
784
|
-
properties: {
|
|
785
|
-
breakpoints: 'Breakpoints',
|
|
786
|
-
codeBlock: 'CodeBlock',
|
|
787
|
-
colors: 'ThemeColors',
|
|
788
|
-
components: 'Components',
|
|
789
|
-
layout: 'Layout',
|
|
790
|
-
logo: 'Logo',
|
|
791
|
-
fab: 'Fab',
|
|
792
|
-
overrides: 'Overrides',
|
|
793
|
-
rightPanel: 'RightPanel',
|
|
794
|
-
schema: 'Schema',
|
|
795
|
-
shape: 'Shape',
|
|
796
|
-
sidebar: 'Sidebar',
|
|
797
|
-
spacing: 'ThemeSpacing',
|
|
798
|
-
typography: 'Typography',
|
|
799
|
-
links: { properties: { color: { type: 'string' } } }, // deprecated
|
|
800
|
-
codeSample: { properties: { backgroundColor: { type: 'string' } } }, // deprecated
|
|
801
|
-
},
|
|
802
|
-
};
|
|
803
|
-
|
|
804
|
-
const GenerateCodeSamples: NodeType = {
|
|
805
|
-
properties: {
|
|
806
|
-
skipOptionalParameters: { type: 'boolean' },
|
|
807
|
-
languages: listOf('ConfigLanguage'),
|
|
808
|
-
},
|
|
809
|
-
required: ['languages'],
|
|
810
|
-
};
|
|
811
|
-
|
|
812
|
-
const ConfigReferenceDocs: NodeType = {
|
|
813
|
-
properties: {
|
|
814
|
-
theme: 'ConfigTheme',
|
|
815
|
-
corsProxyUrl: { type: 'string' },
|
|
816
|
-
ctrlFHijack: { type: 'boolean' },
|
|
817
|
-
defaultSampleLanguage: { type: 'string' },
|
|
818
|
-
disableDeepLinks: { type: 'boolean' },
|
|
819
|
-
disableSearch: { type: 'boolean' },
|
|
820
|
-
disableSidebar: { type: 'boolean' },
|
|
821
|
-
downloadDefinitionUrl: { type: 'string' },
|
|
822
|
-
expandDefaultServerVariables: { type: 'boolean' },
|
|
823
|
-
enumSkipQuotes: { type: 'boolean' },
|
|
824
|
-
expandDefaultRequest: { type: 'boolean' },
|
|
825
|
-
expandDefaultResponse: { type: 'boolean' },
|
|
826
|
-
expandResponses: { type: 'string' },
|
|
827
|
-
expandSingleSchemaField: { type: 'boolean' },
|
|
828
|
-
generateCodeSamples: 'GenerateCodeSamples',
|
|
829
|
-
generatedPayloadSamplesMaxDepth: { type: 'number' },
|
|
830
|
-
hideDownloadButton: { type: 'boolean' },
|
|
831
|
-
hideHostname: { type: 'boolean' },
|
|
832
|
-
hideInfoSection: { type: 'boolean' },
|
|
833
|
-
hideLoading: { type: 'boolean' },
|
|
834
|
-
hideLogo: { type: 'boolean' },
|
|
835
|
-
hideRequestPayloadSample: { type: 'boolean' },
|
|
836
|
-
hideRightPanel: { type: 'boolean' },
|
|
837
|
-
hideSchemaPattern: { type: 'boolean' },
|
|
838
|
-
hideSchemaTitles: { type: 'boolean' },
|
|
839
|
-
hideSingleRequestSampleTab: { type: 'boolean' },
|
|
840
|
-
hideSecuritySection: { type: 'boolean' },
|
|
841
|
-
hideTryItPanel: { type: 'boolean' },
|
|
842
|
-
hideFab: { type: 'boolean' },
|
|
843
|
-
hideOneOfDescription: { type: 'boolean' },
|
|
844
|
-
htmlTemplate: { type: 'string' },
|
|
845
|
-
jsonSampleExpandLevel: (value: unknown) => {
|
|
846
|
-
if (typeof value === 'number') {
|
|
847
|
-
return { type: 'number', minimum: 1 };
|
|
848
|
-
} else {
|
|
849
|
-
return { type: 'string' };
|
|
850
|
-
}
|
|
851
|
-
},
|
|
852
|
-
labels: 'ConfigLabels',
|
|
853
|
-
layout: { enum: ['stacked', 'three-panel'] },
|
|
854
|
-
maxDisplayedEnumValues: { type: 'number' },
|
|
855
|
-
menuToggle: { type: 'boolean' },
|
|
856
|
-
nativeScrollbars: { type: 'boolean' },
|
|
857
|
-
noAutoAuth: { type: 'boolean' }, // deprecated
|
|
858
|
-
oAuth2RedirectURI: { type: 'string' },
|
|
859
|
-
onDeepLinkClick: { type: 'object' },
|
|
860
|
-
onlyRequiredInSamples: { type: 'boolean' },
|
|
861
|
-
pagination: { enum: ['none', 'section', 'item'] },
|
|
862
|
-
pathInMiddlePanel: { type: 'boolean' },
|
|
863
|
-
payloadSampleIdx: { type: 'number', minimum: 0 },
|
|
864
|
-
requestInterceptor: { type: 'object' },
|
|
865
|
-
requiredPropsFirst: { type: 'boolean' },
|
|
866
|
-
routingBasePath: { type: 'string' },
|
|
867
|
-
routingStrategy: { type: 'string' }, // deprecated
|
|
868
|
-
samplesTabsMaxCount: { type: 'number' },
|
|
869
|
-
schemaExpansionLevel: (value: unknown) => {
|
|
870
|
-
if (typeof value === 'number') {
|
|
871
|
-
return { type: 'number', minimum: 0 };
|
|
872
|
-
} else {
|
|
873
|
-
return { type: 'string' };
|
|
874
|
-
}
|
|
875
|
-
},
|
|
876
|
-
schemaDefinitionsTagName: { type: 'string' },
|
|
877
|
-
minCharacterLengthToInitSearch: { type: 'number', minimum: 1 },
|
|
878
|
-
maxResponseHeadersToShowInTryIt: { type: 'number', minimum: 0 },
|
|
879
|
-
scrollYOffset: (value: unknown) => {
|
|
880
|
-
if (typeof value === 'number') {
|
|
881
|
-
return { type: 'number' };
|
|
882
|
-
} else {
|
|
883
|
-
return { type: 'string' };
|
|
884
|
-
}
|
|
885
|
-
},
|
|
886
|
-
searchAutoExpand: { type: 'boolean' },
|
|
887
|
-
searchFieldLevelBoost: { type: 'number', minimum: 0 },
|
|
888
|
-
searchMaxDepth: { type: 'number', minimum: 1 },
|
|
889
|
-
searchMode: { enum: ['default', 'path-only'] },
|
|
890
|
-
searchOperationTitleBoost: { type: 'number' },
|
|
891
|
-
searchTagTitleBoost: { type: 'number' },
|
|
892
|
-
sendXUserAgentInTryIt: { type: 'boolean' },
|
|
893
|
-
showChangeLayoutButton: { type: 'boolean' },
|
|
894
|
-
showConsole: { type: 'boolean' }, // deprecated
|
|
895
|
-
showExtensions: (value: unknown) => {
|
|
896
|
-
if (typeof value === 'boolean') {
|
|
897
|
-
return { type: 'boolean' };
|
|
898
|
-
} else {
|
|
899
|
-
return {
|
|
900
|
-
type: 'array',
|
|
901
|
-
items: {
|
|
902
|
-
type: 'string',
|
|
903
|
-
},
|
|
904
|
-
};
|
|
905
|
-
}
|
|
906
|
-
},
|
|
907
|
-
showNextButton: { type: 'boolean' },
|
|
908
|
-
showRightPanelToggle: { type: 'boolean' },
|
|
909
|
-
showSecuritySchemeType: { type: 'boolean' },
|
|
910
|
-
showWebhookVerb: { type: 'boolean' },
|
|
911
|
-
showObjectSchemaExamples: { type: 'boolean' },
|
|
912
|
-
disableTryItRequestUrlEncoding: { type: 'boolean' },
|
|
913
|
-
sidebarLinks: 'ConfigSidebarLinks',
|
|
914
|
-
sideNavStyle: { enum: ['summary-only', 'path-first', 'id-only'] },
|
|
915
|
-
simpleOneOfTypeLabel: { type: 'boolean' },
|
|
916
|
-
sortEnumValuesAlphabetically: { type: 'boolean' },
|
|
917
|
-
sortOperationsAlphabetically: { type: 'boolean' },
|
|
918
|
-
sortPropsAlphabetically: { type: 'boolean' },
|
|
919
|
-
sortTagsAlphabetically: { type: 'boolean' },
|
|
920
|
-
suppressWarnings: { type: 'boolean' }, // deprecated
|
|
921
|
-
unstable_externalDescription: { type: 'boolean' }, // deprecated
|
|
922
|
-
unstable_ignoreMimeParameters: { type: 'boolean' },
|
|
923
|
-
untrustedDefinition: { type: 'boolean' },
|
|
924
|
-
mockServer: {
|
|
925
|
-
properties: {
|
|
926
|
-
url: { type: 'string' },
|
|
927
|
-
position: { enum: ['first', 'last', 'replace', 'off'] },
|
|
928
|
-
description: { type: 'string' },
|
|
929
|
-
},
|
|
930
|
-
},
|
|
931
|
-
showAccessMode: { type: 'boolean' },
|
|
932
|
-
preserveOriginalExtensionsName: { type: 'boolean' },
|
|
933
|
-
markdownHeadingsAnchorLevel: { type: 'number' },
|
|
934
|
-
},
|
|
935
|
-
additionalProperties: { type: 'string' },
|
|
936
|
-
};
|
|
937
|
-
|
|
938
|
-
const ConfigMockServer: NodeType = {
|
|
939
|
-
properties: {
|
|
940
|
-
strictExamples: { type: 'boolean' },
|
|
941
|
-
errorIfForcedExampleNotFound: { type: 'boolean' },
|
|
942
|
-
},
|
|
943
|
-
};
|
|
944
|
-
|
|
945
|
-
export const ConfigTypes: Record<string, NodeType> = {
|
|
946
|
-
Assert,
|
|
947
|
-
ConfigRoot,
|
|
948
|
-
ConfigApis,
|
|
949
|
-
ConfigApisProperties,
|
|
950
|
-
RootConfigStyleguide,
|
|
951
|
-
ConfigStyleguide,
|
|
952
|
-
ConfigReferenceDocs,
|
|
953
|
-
ConfigMockServer,
|
|
954
|
-
ConfigHTTP,
|
|
955
|
-
ConfigLanguage,
|
|
956
|
-
ConfigLabels,
|
|
957
|
-
ConfigSidebarLinks,
|
|
958
|
-
CommonConfigSidebarLinks,
|
|
959
|
-
ConfigTheme,
|
|
960
|
-
ConfigRootTheme,
|
|
961
|
-
AssertDefinition,
|
|
962
|
-
ThemeColors,
|
|
963
|
-
CommonThemeColors,
|
|
964
|
-
BorderThemeColors,
|
|
965
|
-
HttpColors,
|
|
966
|
-
ResponseColors,
|
|
967
|
-
SecondaryColors,
|
|
968
|
-
TextThemeColors,
|
|
969
|
-
Sizes,
|
|
970
|
-
ButtonsConfig,
|
|
971
|
-
CommonColorProps,
|
|
972
|
-
BadgeFontConfig,
|
|
973
|
-
BadgeSizes,
|
|
974
|
-
HttpBadgesConfig,
|
|
975
|
-
LabelControls,
|
|
976
|
-
Panels,
|
|
977
|
-
TryItButton,
|
|
978
|
-
Breakpoints,
|
|
979
|
-
StackedConfig,
|
|
980
|
-
ThreePanelConfig,
|
|
981
|
-
SchemaColorsConfig,
|
|
982
|
-
SizeProps,
|
|
983
|
-
Level1Items,
|
|
984
|
-
SpacingConfig,
|
|
985
|
-
FontConfig,
|
|
986
|
-
CodeConfig,
|
|
987
|
-
HeadingsConfig,
|
|
988
|
-
LinksConfig,
|
|
989
|
-
TokenProps,
|
|
990
|
-
CodeBlock,
|
|
991
|
-
Logo,
|
|
992
|
-
Fab,
|
|
993
|
-
ButtonOverrides,
|
|
994
|
-
Overrides,
|
|
995
|
-
ObjectRule,
|
|
996
|
-
RightPanel,
|
|
997
|
-
Rules,
|
|
998
|
-
Shape,
|
|
999
|
-
ThemeSpacing,
|
|
1000
|
-
GenerateCodeSamples,
|
|
1001
|
-
GroupItemsConfig,
|
|
1002
|
-
Components,
|
|
1003
|
-
Layout,
|
|
1004
|
-
Schema,
|
|
1005
|
-
Sidebar,
|
|
1006
|
-
Heading,
|
|
1007
|
-
Typography,
|
|
1008
|
-
AssertionDefinitionAssertions,
|
|
1009
|
-
AssertionDefinitionSubject,
|
|
1010
|
-
};
|