@redocly/openapi-core 1.28.5 → 1.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/lib/config/all.js +3 -0
- package/lib/config/minimal.js +3 -0
- package/lib/config/recommended-strict.js +3 -0
- package/lib/config/recommended.js +3 -0
- package/lib/rules/common/no-schema-type-mismatch.d.ts +2 -0
- package/lib/rules/common/no-schema-type-mismatch.js +22 -0
- package/lib/rules/common/operation-tag-defined.js +7 -1
- package/lib/rules/oas2/index.js +2 -0
- package/lib/rules/oas3/index.js +2 -0
- package/lib/rules/oas3/no-invalid-media-type-examples.js +1 -1
- package/lib/types/overlay.d.ts +2 -0
- package/lib/types/overlay.js +39 -0
- package/lib/types/redocly-yaml.d.ts +2 -2
- package/lib/types/redocly-yaml.js +3 -1
- package/lib/typings/arazzo.d.ts +1 -1
- package/lib/typings/arazzo.js +1 -1
- package/lib/typings/overlay.d.ts +17 -0
- package/lib/typings/overlay.js +4 -0
- package/package.json +1 -1
- package/src/config/__tests__/__snapshots__/config-resolvers.test.ts.snap +6 -0
- package/src/config/all.ts +3 -0
- package/src/config/minimal.ts +3 -0
- package/src/config/recommended-strict.ts +3 -0
- package/src/config/recommended.ts +3 -0
- package/src/rules/arazzo/__tests__/criteria-unique.test.ts +1 -1
- package/src/rules/arazzo/__tests__/no-criteria-xpath.test.ts +1 -1
- package/src/rules/arazzo/__tests__/parameters-unique.test.ts +1 -1
- package/src/rules/arazzo/__tests__/requestBody-replacements-unique.test.ts +1 -1
- package/src/rules/arazzo/__tests__/source-description-type.test.ts +1 -1
- package/src/rules/arazzo/__tests__/sourceDescription-name-unique.test.ts +1 -1
- package/src/rules/arazzo/__tests__/sourceDescriptions-not-empty.test.ts +2 -2
- package/src/rules/arazzo/__tests__/spot-supported-versions.test.ts +1 -1
- package/src/rules/arazzo/__tests__/step-onFailure-unique.test.ts +1 -1
- package/src/rules/arazzo/__tests__/step-onSuccess-unique.test.ts +1 -1
- package/src/rules/arazzo/__tests__/stepId-unique.test.ts +1 -1
- package/src/rules/arazzo/__tests__/workflow-dependsOn.test.ts +2 -2
- package/src/rules/arazzo/__tests__/workflowId-unique.test.ts +1 -1
- package/src/rules/common/__tests__/no-schema-type-mismatch.test.ts +126 -0
- package/src/rules/common/__tests__/operation-tag-defined.test.ts +68 -0
- package/src/rules/common/no-schema-type-mismatch.ts +24 -0
- package/src/rules/common/operation-tag-defined.ts +6 -1
- package/src/rules/oas2/index.ts +2 -0
- package/src/rules/oas3/__tests__/no-invalid-media-type-examples.test.ts +50 -0
- package/src/rules/oas3/index.ts +2 -0
- package/src/rules/oas3/no-invalid-media-type-examples.ts +1 -1
- package/src/types/overlay.ts +40 -0
- package/src/types/redocly-yaml.ts +4 -2
- package/src/typings/arazzo.ts +2 -2
- package/src/typings/overlay.ts +19 -0
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @redocly/openapi-core
|
|
2
2
|
|
|
3
|
+
## 1.30.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated `operation-tag-defined` built-in rule to verify tags are defined on the operation prior to matching them to a global tag.
|
|
8
|
+
|
|
9
|
+
## 1.29.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- Added the `no-schema-type-mismatch` rule.
|
|
14
|
+
- Added typings and interfaces for Overlay Specification v1.0.0.
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Added validation to ensure only Arazzo version 1.0.1 is used, helping users stay on the supported version.
|
|
19
|
+
- Fixed an issue where the `no-invalid-media-type-examples` rule crashed instead of reporting an error when it failed to resolve an example from a $ref.
|
|
20
|
+
|
|
3
21
|
## 1.28.5
|
|
4
22
|
|
|
5
23
|
## 1.28.4
|
package/lib/config/all.js
CHANGED
|
@@ -19,6 +19,7 @@ const all = {
|
|
|
19
19
|
'no-enum-type-mismatch': 'error',
|
|
20
20
|
'no-unresolved-refs': 'error',
|
|
21
21
|
'no-required-schema-properties-undefined': 'error',
|
|
22
|
+
'no-schema-type-mismatch': 'error',
|
|
22
23
|
'operation-summary': 'error',
|
|
23
24
|
'operation-operationId': 'error',
|
|
24
25
|
'operation-operationId-unique': 'error',
|
|
@@ -75,6 +76,7 @@ const all = {
|
|
|
75
76
|
'no-enum-type-mismatch': 'error',
|
|
76
77
|
'no-unresolved-refs': 'error',
|
|
77
78
|
'no-required-schema-properties-undefined': 'error',
|
|
79
|
+
'no-schema-type-mismatch': 'error',
|
|
78
80
|
'no-invalid-media-type-examples': 'error',
|
|
79
81
|
'no-server-example.com': 'error',
|
|
80
82
|
'no-server-trailing-slash': 'error',
|
|
@@ -141,6 +143,7 @@ const all = {
|
|
|
141
143
|
'no-enum-type-mismatch': 'error',
|
|
142
144
|
'no-unresolved-refs': 'error',
|
|
143
145
|
'no-required-schema-properties-undefined': 'error',
|
|
146
|
+
'no-schema-type-mismatch': 'error',
|
|
144
147
|
'no-invalid-media-type-examples': 'error',
|
|
145
148
|
'no-server-example.com': 'error',
|
|
146
149
|
'no-server-trailing-slash': 'error',
|
package/lib/config/minimal.js
CHANGED
|
@@ -19,6 +19,7 @@ const minimal = {
|
|
|
19
19
|
'no-enum-type-mismatch': 'warn',
|
|
20
20
|
'no-unresolved-refs': 'error',
|
|
21
21
|
'no-required-schema-properties-undefined': 'off',
|
|
22
|
+
'no-schema-type-mismatch': 'off',
|
|
22
23
|
'operation-summary': 'warn',
|
|
23
24
|
'operation-operationId': 'warn',
|
|
24
25
|
'operation-operationId-unique': 'warn',
|
|
@@ -66,6 +67,7 @@ const minimal = {
|
|
|
66
67
|
'no-enum-type-mismatch': 'warn',
|
|
67
68
|
'no-unresolved-refs': 'error',
|
|
68
69
|
'no-required-schema-properties-undefined': 'off',
|
|
70
|
+
'no-schema-type-mismatch': 'off',
|
|
69
71
|
'no-invalid-media-type-examples': {
|
|
70
72
|
severity: 'warn',
|
|
71
73
|
allowAdditionalProperties: false,
|
|
@@ -126,6 +128,7 @@ const minimal = {
|
|
|
126
128
|
'no-enum-type-mismatch': 'warn',
|
|
127
129
|
'no-unresolved-refs': 'error',
|
|
128
130
|
'no-required-schema-properties-undefined': 'off',
|
|
131
|
+
'no-schema-type-mismatch': 'off',
|
|
129
132
|
'no-invalid-media-type-examples': 'warn',
|
|
130
133
|
'no-server-example.com': 'warn',
|
|
131
134
|
'no-server-trailing-slash': 'error',
|
|
@@ -19,6 +19,7 @@ const recommendedStrict = {
|
|
|
19
19
|
'no-enum-type-mismatch': 'error',
|
|
20
20
|
'no-unresolved-refs': 'error',
|
|
21
21
|
'no-required-schema-properties-undefined': 'off',
|
|
22
|
+
'no-schema-type-mismatch': 'error',
|
|
22
23
|
'operation-summary': 'error',
|
|
23
24
|
'operation-operationId': 'error',
|
|
24
25
|
'operation-operationId-unique': 'error',
|
|
@@ -66,6 +67,7 @@ const recommendedStrict = {
|
|
|
66
67
|
'no-enum-type-mismatch': 'error',
|
|
67
68
|
'no-unresolved-refs': 'error',
|
|
68
69
|
'no-required-schema-properties-undefined': 'off',
|
|
70
|
+
'no-schema-type-mismatch': 'error',
|
|
69
71
|
'no-invalid-media-type-examples': {
|
|
70
72
|
severity: 'error',
|
|
71
73
|
allowAdditionalProperties: false,
|
|
@@ -126,6 +128,7 @@ const recommendedStrict = {
|
|
|
126
128
|
'no-enum-type-mismatch': 'error',
|
|
127
129
|
'no-unresolved-refs': 'error',
|
|
128
130
|
'no-required-schema-properties-undefined': 'off',
|
|
131
|
+
'no-schema-type-mismatch': 'error',
|
|
129
132
|
'no-invalid-media-type-examples': 'error',
|
|
130
133
|
'no-server-example.com': 'error',
|
|
131
134
|
'no-server-trailing-slash': 'error',
|
|
@@ -19,6 +19,7 @@ const recommended = {
|
|
|
19
19
|
'no-enum-type-mismatch': 'error',
|
|
20
20
|
'no-unresolved-refs': 'error',
|
|
21
21
|
'no-required-schema-properties-undefined': 'off',
|
|
22
|
+
'no-schema-type-mismatch': 'warn',
|
|
22
23
|
'operation-summary': 'error',
|
|
23
24
|
'operation-description': 'off',
|
|
24
25
|
'operation-operationId': 'warn',
|
|
@@ -66,6 +67,7 @@ const recommended = {
|
|
|
66
67
|
'no-enum-type-mismatch': 'error',
|
|
67
68
|
'no-unresolved-refs': 'error',
|
|
68
69
|
'no-required-schema-properties-undefined': 'off',
|
|
70
|
+
'no-schema-type-mismatch': 'warn',
|
|
69
71
|
'no-invalid-media-type-examples': {
|
|
70
72
|
severity: 'warn',
|
|
71
73
|
allowAdditionalProperties: false,
|
|
@@ -126,6 +128,7 @@ const recommended = {
|
|
|
126
128
|
'no-enum-type-mismatch': 'error',
|
|
127
129
|
'no-unresolved-refs': 'error',
|
|
128
130
|
'no-required-schema-properties-undefined': 'off',
|
|
131
|
+
'no-schema-type-mismatch': 'warn',
|
|
129
132
|
'no-invalid-media-type-examples': 'warn',
|
|
130
133
|
'no-server-example.com': 'warn',
|
|
131
134
|
'no-server-trailing-slash': 'error',
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NoSchemaTypeMismatch = void 0;
|
|
4
|
+
const NoSchemaTypeMismatch = () => {
|
|
5
|
+
return {
|
|
6
|
+
Schema(schema, { report, location }) {
|
|
7
|
+
if (schema.type === 'object' && schema.items) {
|
|
8
|
+
report({
|
|
9
|
+
message: "Schema type mismatch: 'object' type should not contain 'items' field.",
|
|
10
|
+
location: location.child('items'),
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
if (schema.type === 'array' && schema.properties) {
|
|
14
|
+
report({
|
|
15
|
+
message: "Schema type mismatch: 'array' type should not contain 'properties' field.",
|
|
16
|
+
location: location.child('properties'),
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
exports.NoSchemaTypeMismatch = NoSchemaTypeMismatch;
|
|
@@ -8,7 +8,7 @@ const OperationTagDefined = () => {
|
|
|
8
8
|
definedTags = new Set((root.tags ?? []).map((t) => t.name));
|
|
9
9
|
},
|
|
10
10
|
Operation(operation, { report, location }) {
|
|
11
|
-
if (operation
|
|
11
|
+
if (operation?.tags) {
|
|
12
12
|
for (let i = 0; i < operation.tags.length; i++) {
|
|
13
13
|
if (!definedTags.has(operation.tags[i])) {
|
|
14
14
|
report({
|
|
@@ -18,6 +18,12 @@ const OperationTagDefined = () => {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
+
else {
|
|
22
|
+
report({
|
|
23
|
+
message: `Operation tags should be defined`,
|
|
24
|
+
location: location.key(),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
21
27
|
},
|
|
22
28
|
};
|
|
23
29
|
};
|
package/lib/rules/oas2/index.js
CHANGED
|
@@ -45,6 +45,7 @@ const scalar_property_missing_example_1 = require("../common/scalar-property-mis
|
|
|
45
45
|
const required_string_property_missing_min_length_1 = require("../common/required-string-property-missing-min-length");
|
|
46
46
|
const spec_strict_refs_1 = require("../common/spec-strict-refs");
|
|
47
47
|
const no_required_schema_properties_undefined_1 = require("../common/no-required-schema-properties-undefined");
|
|
48
|
+
const no_schema_type_mismatch_1 = require("../common/no-schema-type-mismatch");
|
|
48
49
|
exports.rules = {
|
|
49
50
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
50
51
|
//@ts-ignore TODO: This is depricated property `spec` and should be removed in the future
|
|
@@ -94,5 +95,6 @@ exports.rules = {
|
|
|
94
95
|
'required-string-property-missing-min-length': required_string_property_missing_min_length_1.RequiredStringPropertyMissingMinLength,
|
|
95
96
|
'spec-strict-refs': spec_strict_refs_1.SpecStrictRefs,
|
|
96
97
|
'no-required-schema-properties-undefined': no_required_schema_properties_undefined_1.NoRequiredSchemaPropertiesUndefined,
|
|
98
|
+
'no-schema-type-mismatch': no_schema_type_mismatch_1.NoSchemaTypeMismatch,
|
|
97
99
|
};
|
|
98
100
|
exports.preprocessors = {};
|
package/lib/rules/oas3/index.js
CHANGED
|
@@ -57,6 +57,7 @@ const spec_strict_refs_1 = require("../common/spec-strict-refs");
|
|
|
57
57
|
const component_name_unique_1 = require("./component-name-unique");
|
|
58
58
|
const array_parameter_serialization_1 = require("./array-parameter-serialization");
|
|
59
59
|
const no_required_schema_properties_undefined_1 = require("../common/no-required-schema-properties-undefined");
|
|
60
|
+
const no_schema_type_mismatch_1 = require("../common/no-schema-type-mismatch");
|
|
60
61
|
exports.rules = {
|
|
61
62
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
62
63
|
//@ts-ignore TODO: This is depricated property `spec` and should be removed in the future
|
|
@@ -118,5 +119,6 @@ exports.rules = {
|
|
|
118
119
|
'component-name-unique': component_name_unique_1.ComponentNameUnique,
|
|
119
120
|
'array-parameter-serialization': array_parameter_serialization_1.ArrayParameterSerialization,
|
|
120
121
|
'no-required-schema-properties-undefined': no_required_schema_properties_undefined_1.NoRequiredSchemaPropertiesUndefined,
|
|
122
|
+
'no-schema-type-mismatch': no_schema_type_mismatch_1.NoSchemaTypeMismatch,
|
|
121
123
|
};
|
|
122
124
|
exports.preprocessors = {};
|
|
@@ -27,7 +27,7 @@ const ValidContentExamples = (opts) => {
|
|
|
27
27
|
location = isMultiple ? resolved.location.child('value') : resolved.location;
|
|
28
28
|
example = resolved.node;
|
|
29
29
|
}
|
|
30
|
-
if (isMultiple && typeof example
|
|
30
|
+
if (isMultiple && typeof example?.value === 'undefined') {
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
(0, utils_1.validateExample)(isMultiple ? example.value : example, mediaType.schema, location, ctx, allowAdditionalProperties);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Overlay1Types = void 0;
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
const Root = {
|
|
6
|
+
properties: {
|
|
7
|
+
overlay: { type: 'string' },
|
|
8
|
+
info: 'Info',
|
|
9
|
+
extends: { type: 'string' },
|
|
10
|
+
actions: 'Actions',
|
|
11
|
+
},
|
|
12
|
+
required: ['overlay', 'info', 'actions'],
|
|
13
|
+
extensionsPrefix: 'x-',
|
|
14
|
+
};
|
|
15
|
+
const Info = {
|
|
16
|
+
properties: {
|
|
17
|
+
title: { type: 'string' },
|
|
18
|
+
version: { type: 'string' },
|
|
19
|
+
},
|
|
20
|
+
required: ['title', 'version'],
|
|
21
|
+
extensionsPrefix: 'x-',
|
|
22
|
+
};
|
|
23
|
+
const Actions = (0, _1.listOf)('Action');
|
|
24
|
+
const Action = {
|
|
25
|
+
properties: {
|
|
26
|
+
target: { type: 'string' },
|
|
27
|
+
description: { type: 'string' },
|
|
28
|
+
update: {}, // any
|
|
29
|
+
remove: { type: 'boolean' },
|
|
30
|
+
},
|
|
31
|
+
required: ['target'],
|
|
32
|
+
extensionsPrefix: 'x-',
|
|
33
|
+
};
|
|
34
|
+
exports.Overlay1Types = {
|
|
35
|
+
Root,
|
|
36
|
+
Info,
|
|
37
|
+
Actions,
|
|
38
|
+
Action,
|
|
39
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { JSONSchema } from 'json-schema-to-ts';
|
|
2
2
|
import type { NodeType } from '.';
|
|
3
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"];
|
|
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", "no-schema-type-mismatch", "boolean-parameter-prefixes", "request-mime-type", "response-contains-property", "response-mime-type"];
|
|
5
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"];
|
|
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", "no-schema-type-mismatch", "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
7
|
export type BuiltInOAS3RuleId = typeof builtInOAS3Rules[number];
|
|
8
8
|
declare const builtInAsync2Rules: readonly ["info-contact", "info-license-strict", "operation-operationId", "tag-description", "tags-alphabetical", "channels-kebab-case", "no-channel-trailing-slash"];
|
|
9
9
|
declare const builtInAsync3Rules: readonly ["info-contact", "info-license-strict", "operation-operationId", "tag-description", "tags-alphabetical", "channels-kebab-case", "no-channel-trailing-slash"];
|
|
@@ -4,9 +4,9 @@ exports.ConfigTypes = void 0;
|
|
|
4
4
|
exports.createConfigTypes = createConfigTypes;
|
|
5
5
|
const config_1 = require("@redocly/config");
|
|
6
6
|
const _1 = require(".");
|
|
7
|
+
const oas_types_1 = require("../oas-types");
|
|
7
8
|
const utils_1 = require("../utils");
|
|
8
9
|
const json_schema_adapter_1 = require("./json-schema-adapter");
|
|
9
|
-
const oas_types_1 = require("../oas-types");
|
|
10
10
|
const builtInOAS2Rules = [
|
|
11
11
|
'info-contact',
|
|
12
12
|
'operation-operationId',
|
|
@@ -47,6 +47,7 @@ const builtInOAS2Rules = [
|
|
|
47
47
|
'spec-strict-refs',
|
|
48
48
|
'no-unresolved-refs',
|
|
49
49
|
'no-required-schema-properties-undefined',
|
|
50
|
+
'no-schema-type-mismatch',
|
|
50
51
|
'boolean-parameter-prefixes',
|
|
51
52
|
'request-mime-type',
|
|
52
53
|
'response-contains-property',
|
|
@@ -92,6 +93,7 @@ const builtInOAS3Rules = [
|
|
|
92
93
|
'spec-strict-refs',
|
|
93
94
|
'no-unresolved-refs',
|
|
94
95
|
'no-required-schema-properties-undefined',
|
|
96
|
+
'no-schema-type-mismatch',
|
|
95
97
|
'boolean-parameter-prefixes',
|
|
96
98
|
'component-name-unique',
|
|
97
99
|
'no-empty-servers',
|
package/lib/typings/arazzo.d.ts
CHANGED
package/lib/typings/arazzo.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ARAZZO_VERSIONS_SUPPORTED_BY_SPOT = exports.VERSION_PATTERN = void 0;
|
|
4
4
|
exports.VERSION_PATTERN = /^1\.0\.\d+(-.+)?$/;
|
|
5
|
-
exports.ARAZZO_VERSIONS_SUPPORTED_BY_SPOT = ['1.0.
|
|
5
|
+
exports.ARAZZO_VERSIONS_SUPPORTED_BY_SPOT = ['1.0.1'];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface InfoObject {
|
|
2
|
+
title: string;
|
|
3
|
+
version: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ActionObject {
|
|
6
|
+
target: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
update?: unknown;
|
|
9
|
+
remove?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface Overlay1Definition {
|
|
12
|
+
overlay: '1.0.0';
|
|
13
|
+
info: InfoObject;
|
|
14
|
+
extends?: string;
|
|
15
|
+
actions: ActionObject[];
|
|
16
|
+
}
|
|
17
|
+
export declare const VERSION_PATTERN: RegExp;
|
package/package.json
CHANGED
|
@@ -59,6 +59,7 @@ exports[`resolveConfig should ignore minimal from the root and read local file 1
|
|
|
59
59
|
"no-invalid-schema-examples": "off",
|
|
60
60
|
"no-path-trailing-slash": "error",
|
|
61
61
|
"no-required-schema-properties-undefined": "off",
|
|
62
|
+
"no-schema-type-mismatch": "warn",
|
|
62
63
|
"no-unresolved-refs": "error",
|
|
63
64
|
"operation-2xx-response": "warn",
|
|
64
65
|
"operation-4xx-response": "error",
|
|
@@ -114,6 +115,7 @@ exports[`resolveConfig should ignore minimal from the root and read local file 1
|
|
|
114
115
|
"no-invalid-schema-examples": "off",
|
|
115
116
|
"no-path-trailing-slash": "error",
|
|
116
117
|
"no-required-schema-properties-undefined": "off",
|
|
118
|
+
"no-schema-type-mismatch": "warn",
|
|
117
119
|
"no-server-example.com": "warn",
|
|
118
120
|
"no-server-trailing-slash": "error",
|
|
119
121
|
"no-server-variables-empty-enum": "error",
|
|
@@ -173,6 +175,7 @@ exports[`resolveConfig should ignore minimal from the root and read local file 1
|
|
|
173
175
|
"no-invalid-schema-examples": "off",
|
|
174
176
|
"no-path-trailing-slash": "error",
|
|
175
177
|
"no-required-schema-properties-undefined": "off",
|
|
178
|
+
"no-schema-type-mismatch": "warn",
|
|
176
179
|
"no-server-example.com": "warn",
|
|
177
180
|
"no-server-trailing-slash": "error",
|
|
178
181
|
"no-server-variables-empty-enum": "error",
|
|
@@ -285,6 +288,7 @@ exports[`resolveStyleguideConfig should resolve extends with local file config w
|
|
|
285
288
|
"no-invalid-schema-examples": "off",
|
|
286
289
|
"no-path-trailing-slash": "error",
|
|
287
290
|
"no-required-schema-properties-undefined": "off",
|
|
291
|
+
"no-schema-type-mismatch": "warn",
|
|
288
292
|
"no-unresolved-refs": "error",
|
|
289
293
|
"operation-2xx-response": "error",
|
|
290
294
|
"operation-4xx-response": "off",
|
|
@@ -340,6 +344,7 @@ exports[`resolveStyleguideConfig should resolve extends with local file config w
|
|
|
340
344
|
"no-invalid-schema-examples": "off",
|
|
341
345
|
"no-path-trailing-slash": "error",
|
|
342
346
|
"no-required-schema-properties-undefined": "off",
|
|
347
|
+
"no-schema-type-mismatch": "warn",
|
|
343
348
|
"no-server-example.com": "warn",
|
|
344
349
|
"no-server-trailing-slash": "error",
|
|
345
350
|
"no-server-variables-empty-enum": "error",
|
|
@@ -399,6 +404,7 @@ exports[`resolveStyleguideConfig should resolve extends with local file config w
|
|
|
399
404
|
"no-invalid-schema-examples": "off",
|
|
400
405
|
"no-path-trailing-slash": "error",
|
|
401
406
|
"no-required-schema-properties-undefined": "off",
|
|
407
|
+
"no-schema-type-mismatch": "warn",
|
|
402
408
|
"no-server-example.com": "warn",
|
|
403
409
|
"no-server-trailing-slash": "error",
|
|
404
410
|
"no-server-variables-empty-enum": "error",
|
package/src/config/all.ts
CHANGED
|
@@ -19,6 +19,7 @@ const all: PluginStyleguideConfig<'built-in'> = {
|
|
|
19
19
|
'no-enum-type-mismatch': 'error',
|
|
20
20
|
'no-unresolved-refs': 'error',
|
|
21
21
|
'no-required-schema-properties-undefined': 'error',
|
|
22
|
+
'no-schema-type-mismatch': 'error',
|
|
22
23
|
'operation-summary': 'error',
|
|
23
24
|
'operation-operationId': 'error',
|
|
24
25
|
'operation-operationId-unique': 'error',
|
|
@@ -75,6 +76,7 @@ const all: PluginStyleguideConfig<'built-in'> = {
|
|
|
75
76
|
'no-enum-type-mismatch': 'error',
|
|
76
77
|
'no-unresolved-refs': 'error',
|
|
77
78
|
'no-required-schema-properties-undefined': 'error',
|
|
79
|
+
'no-schema-type-mismatch': 'error',
|
|
78
80
|
'no-invalid-media-type-examples': 'error',
|
|
79
81
|
'no-server-example.com': 'error',
|
|
80
82
|
'no-server-trailing-slash': 'error',
|
|
@@ -141,6 +143,7 @@ const all: PluginStyleguideConfig<'built-in'> = {
|
|
|
141
143
|
'no-enum-type-mismatch': 'error',
|
|
142
144
|
'no-unresolved-refs': 'error',
|
|
143
145
|
'no-required-schema-properties-undefined': 'error',
|
|
146
|
+
'no-schema-type-mismatch': 'error',
|
|
144
147
|
'no-invalid-media-type-examples': 'error',
|
|
145
148
|
'no-server-example.com': 'error',
|
|
146
149
|
'no-server-trailing-slash': 'error',
|
package/src/config/minimal.ts
CHANGED
|
@@ -19,6 +19,7 @@ const minimal: PluginStyleguideConfig<'built-in'> = {
|
|
|
19
19
|
'no-enum-type-mismatch': 'warn',
|
|
20
20
|
'no-unresolved-refs': 'error',
|
|
21
21
|
'no-required-schema-properties-undefined': 'off',
|
|
22
|
+
'no-schema-type-mismatch': 'off',
|
|
22
23
|
'operation-summary': 'warn',
|
|
23
24
|
'operation-operationId': 'warn',
|
|
24
25
|
'operation-operationId-unique': 'warn',
|
|
@@ -66,6 +67,7 @@ const minimal: PluginStyleguideConfig<'built-in'> = {
|
|
|
66
67
|
'no-enum-type-mismatch': 'warn',
|
|
67
68
|
'no-unresolved-refs': 'error',
|
|
68
69
|
'no-required-schema-properties-undefined': 'off',
|
|
70
|
+
'no-schema-type-mismatch': 'off',
|
|
69
71
|
'no-invalid-media-type-examples': {
|
|
70
72
|
severity: 'warn',
|
|
71
73
|
allowAdditionalProperties: false,
|
|
@@ -126,6 +128,7 @@ const minimal: PluginStyleguideConfig<'built-in'> = {
|
|
|
126
128
|
'no-enum-type-mismatch': 'warn',
|
|
127
129
|
'no-unresolved-refs': 'error',
|
|
128
130
|
'no-required-schema-properties-undefined': 'off',
|
|
131
|
+
'no-schema-type-mismatch': 'off',
|
|
129
132
|
'no-invalid-media-type-examples': 'warn',
|
|
130
133
|
'no-server-example.com': 'warn',
|
|
131
134
|
'no-server-trailing-slash': 'error',
|
|
@@ -19,6 +19,7 @@ const recommendedStrict: PluginStyleguideConfig<'built-in'> = {
|
|
|
19
19
|
'no-enum-type-mismatch': 'error',
|
|
20
20
|
'no-unresolved-refs': 'error',
|
|
21
21
|
'no-required-schema-properties-undefined': 'off',
|
|
22
|
+
'no-schema-type-mismatch': 'error',
|
|
22
23
|
'operation-summary': 'error',
|
|
23
24
|
'operation-operationId': 'error',
|
|
24
25
|
'operation-operationId-unique': 'error',
|
|
@@ -66,6 +67,7 @@ const recommendedStrict: PluginStyleguideConfig<'built-in'> = {
|
|
|
66
67
|
'no-enum-type-mismatch': 'error',
|
|
67
68
|
'no-unresolved-refs': 'error',
|
|
68
69
|
'no-required-schema-properties-undefined': 'off',
|
|
70
|
+
'no-schema-type-mismatch': 'error',
|
|
69
71
|
'no-invalid-media-type-examples': {
|
|
70
72
|
severity: 'error',
|
|
71
73
|
allowAdditionalProperties: false,
|
|
@@ -126,6 +128,7 @@ const recommendedStrict: PluginStyleguideConfig<'built-in'> = {
|
|
|
126
128
|
'no-enum-type-mismatch': 'error',
|
|
127
129
|
'no-unresolved-refs': 'error',
|
|
128
130
|
'no-required-schema-properties-undefined': 'off',
|
|
131
|
+
'no-schema-type-mismatch': 'error',
|
|
129
132
|
'no-invalid-media-type-examples': 'error',
|
|
130
133
|
'no-server-example.com': 'error',
|
|
131
134
|
'no-server-trailing-slash': 'error',
|
|
@@ -19,6 +19,7 @@ const recommended: PluginStyleguideConfig<'built-in'> = {
|
|
|
19
19
|
'no-enum-type-mismatch': 'error',
|
|
20
20
|
'no-unresolved-refs': 'error',
|
|
21
21
|
'no-required-schema-properties-undefined': 'off',
|
|
22
|
+
'no-schema-type-mismatch': 'warn',
|
|
22
23
|
'operation-summary': 'error',
|
|
23
24
|
'operation-description': 'off',
|
|
24
25
|
'operation-operationId': 'warn',
|
|
@@ -66,6 +67,7 @@ const recommended: PluginStyleguideConfig<'built-in'> = {
|
|
|
66
67
|
'no-enum-type-mismatch': 'error',
|
|
67
68
|
'no-unresolved-refs': 'error',
|
|
68
69
|
'no-required-schema-properties-undefined': 'off',
|
|
70
|
+
'no-schema-type-mismatch': 'warn',
|
|
69
71
|
'no-invalid-media-type-examples': {
|
|
70
72
|
severity: 'warn',
|
|
71
73
|
allowAdditionalProperties: false,
|
|
@@ -126,6 +128,7 @@ const recommended: PluginStyleguideConfig<'built-in'> = {
|
|
|
126
128
|
'no-enum-type-mismatch': 'error',
|
|
127
129
|
'no-unresolved-refs': 'error',
|
|
128
130
|
'no-required-schema-properties-undefined': 'off',
|
|
131
|
+
'no-schema-type-mismatch': 'warn',
|
|
129
132
|
'no-invalid-media-type-examples': 'warn',
|
|
130
133
|
'no-server-example.com': 'warn',
|
|
131
134
|
'no-server-trailing-slash': 'error',
|
|
@@ -6,7 +6,7 @@ import { BaseResolver } from '../../../resolve';
|
|
|
6
6
|
describe('Arazzo sourceDescriptions-not-empty', () => {
|
|
7
7
|
const document1 = parseYamlToDocument(
|
|
8
8
|
outdent`
|
|
9
|
-
arazzo: '1.0.
|
|
9
|
+
arazzo: '1.0.1'
|
|
10
10
|
info:
|
|
11
11
|
title: Cool API
|
|
12
12
|
version: 1.0.0
|
|
@@ -38,7 +38,7 @@ describe('Arazzo sourceDescriptions-not-empty', () => {
|
|
|
38
38
|
|
|
39
39
|
const document2 = parseYamlToDocument(
|
|
40
40
|
outdent`
|
|
41
|
-
arazzo: '1.0.
|
|
41
|
+
arazzo: '1.0.1'
|
|
42
42
|
info:
|
|
43
43
|
title: Cool API
|
|
44
44
|
version: 1.0.0
|
|
@@ -81,7 +81,7 @@ describe('Arazzo spot-supported-versions', () => {
|
|
|
81
81
|
"source": "arazzo.yaml",
|
|
82
82
|
},
|
|
83
83
|
],
|
|
84
|
-
"message": "Only 1.0.
|
|
84
|
+
"message": "Only 1.0.1 Arazzo version is supported by Spot.",
|
|
85
85
|
"ruleId": "spot-supported-versions",
|
|
86
86
|
"severity": "error",
|
|
87
87
|
"suggest": [],
|