@redocly/openapi-core 1.25.14 → 1.26.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/__tests__/utils.ts +0 -3
- package/lib/bundle.js +3 -3
- package/lib/config/all.js +130 -48
- package/lib/config/builtIn.d.ts +1 -1
- package/lib/config/builtIn.js +5 -3
- package/lib/config/config-resolvers.js +9 -9
- package/lib/config/config.d.ts +2 -2
- package/lib/config/config.js +38 -20
- package/lib/config/minimal.js +125 -49
- package/lib/config/recommended-strict.js +124 -48
- package/lib/config/recommended.js +123 -47
- package/lib/config/rules.d.ts +2 -2
- package/lib/config/spec.d.ts +3 -0
- package/lib/config/spec.js +31 -0
- package/lib/config/types.d.ts +23 -23
- package/lib/config/utils.d.ts +1 -1
- package/lib/config/utils.js +33 -23
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/lib/lint.js +3 -3
- package/lib/oas-types.d.ts +11 -11
- package/lib/oas-types.js +6 -6
- package/lib/rules/arazzo/criteria-unique.d.ts +2 -2
- package/lib/rules/arazzo/index.d.ts +2 -2
- package/lib/rules/arazzo/index.js +6 -4
- package/lib/rules/arazzo/parameters-unique.d.ts +2 -2
- package/lib/rules/arazzo/requestBody-replacements-unique.d.ts +2 -2
- package/lib/rules/arazzo/sourceDescription-type.d.ts +2 -0
- package/lib/rules/arazzo/{source-description-type.js → sourceDescription-type.js} +5 -3
- package/lib/rules/arazzo/sourceDescriptions-name-unique.d.ts +2 -2
- 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 -2
- package/lib/rules/arazzo/step-onSuccess-unique.d.ts +2 -2
- package/lib/rules/arazzo/stepId-unique.d.ts +2 -2
- package/lib/rules/arazzo/workflow-dependsOn.d.ts +2 -2
- package/lib/rules/arazzo/workflowId-unique.d.ts +2 -2
- package/lib/rules/async2/index.js +5 -2
- package/lib/rules/async3/index.js +5 -2
- package/lib/rules/common/assertions/index.d.ts +2 -2
- package/lib/rules/common/struct.d.ts +2 -0
- package/lib/rules/common/{spec.js → struct.js} +3 -3
- package/lib/rules/oas2/index.js +5 -2
- package/lib/rules/oas3/index.js +5 -2
- package/lib/rules/spot/no-actions-type-end.d.ts +2 -2
- package/lib/rules/spot/no-criteria-xpath.d.ts +2 -2
- package/lib/rules/spot/parameters-not-in-body.d.ts +2 -2
- package/lib/rules/spot/version-enum.d.ts +2 -2
- package/lib/types/arazzo.d.ts +1 -1
- package/lib/types/arazzo.js +3 -27
- package/lib/types/redocly-yaml.d.ts +6 -8
- package/lib/types/redocly-yaml.js +47 -12
- package/lib/typings/arazzo.d.ts +1 -15
- package/lib/utils.d.ts +1 -1
- package/lib/utils.js +3 -2
- package/lib/visitors.d.ts +5 -7
- package/package.json +2 -2
- package/src/__tests__/lint.test.ts +3 -3
- package/src/bundle.ts +3 -3
- package/src/config/__tests__/__snapshots__/config-resolvers.test.ts.snap +228 -70
- package/src/config/__tests__/__snapshots__/config.test.ts.snap +16 -3
- package/src/config/__tests__/config-resolvers.test.ts +14 -2
- package/src/config/__tests__/config.test.ts +11 -6
- package/src/config/all.ts +130 -48
- package/src/config/builtIn.ts +10 -8
- package/src/config/config-resolvers.ts +9 -9
- package/src/config/config.ts +46 -22
- package/src/config/minimal.ts +125 -49
- package/src/config/recommended-strict.ts +124 -48
- package/src/config/recommended.ts +123 -47
- package/src/config/rules.ts +2 -2
- package/src/config/spec.ts +32 -0
- package/src/config/types.ts +27 -33
- package/src/config/utils.ts +38 -26
- package/src/index.ts +1 -1
- package/src/lint.ts +6 -6
- package/src/oas-types.ts +19 -20
- package/src/rules/arazzo/__tests__/criteria-unique.test.ts +1 -2
- package/src/rules/arazzo/__tests__/no-actions-type-end.test.ts +1 -2
- package/src/rules/arazzo/__tests__/no-criteria-xpath.test.ts +1 -2
- package/src/rules/arazzo/__tests__/parameters-not-in-body.test.ts +1 -2
- package/src/rules/arazzo/__tests__/parameters-unique.test.ts +1 -2
- package/src/rules/arazzo/__tests__/requestBody-replacements-unique.test.ts +1 -2
- package/src/rules/arazzo/__tests__/source-description-type.test.ts +2 -4
- package/src/rules/arazzo/__tests__/sourceDescription-name-unique.test.ts +1 -2
- package/src/rules/arazzo/__tests__/sourceDescriptions-not-empty.test.ts +104 -0
- package/src/rules/arazzo/__tests__/step-onFailure-unique.test.ts +1 -2
- package/src/rules/arazzo/__tests__/step-onSuccess-unique.test.ts +1 -2
- package/src/rules/arazzo/__tests__/stepId-unique.test.ts +1 -2
- package/src/rules/arazzo/__tests__/version-enum.test.ts +1 -2
- package/src/rules/arazzo/__tests__/workflow-dependsOn.test.ts +3 -6
- package/src/rules/arazzo/__tests__/workflowId-unique.test.ts +2 -4
- package/src/rules/arazzo/criteria-unique.ts +2 -2
- package/src/rules/arazzo/index.ts +23 -21
- package/src/rules/arazzo/parameters-unique.ts +2 -2
- package/src/rules/arazzo/requestBody-replacements-unique.ts +2 -2
- package/src/rules/arazzo/{source-description-type.ts → sourceDescription-type.ts} +6 -5
- package/src/rules/arazzo/sourceDescriptions-name-unique.ts +2 -2
- package/src/rules/arazzo/sourceDescriptions-not-empty.ts +17 -0
- package/src/rules/arazzo/step-onFailure-unique.ts +2 -2
- package/src/rules/arazzo/step-onSuccess-unique.ts +2 -2
- package/src/rules/arazzo/stepId-unique.ts +2 -2
- package/src/rules/arazzo/workflow-dependsOn.ts +2 -2
- package/src/rules/arazzo/workflowId-unique.ts +2 -2
- package/src/rules/async2/index.ts +5 -2
- package/src/rules/async3/index.ts +5 -2
- package/src/rules/common/__tests__/no-enum-type-mismatch.test.ts +1 -1
- package/src/rules/common/__tests__/{spec.test.ts → struct.test.ts} +35 -35
- package/src/rules/common/assertions/index.ts +2 -2
- package/src/rules/common/{spec.ts → struct.ts} +2 -2
- package/src/rules/oas2/index.ts +5 -2
- package/src/rules/oas3/__tests__/spec/spec.test.ts +10 -10
- package/src/rules/oas3/index.ts +5 -2
- package/src/rules/spot/no-actions-type-end.ts +2 -2
- package/src/rules/spot/no-criteria-xpath.ts +2 -2
- package/src/rules/spot/parameters-not-in-body.ts +2 -2
- package/src/rules/spot/version-enum.ts +2 -2
- package/src/types/arazzo.ts +2 -25
- package/src/types/redocly-yaml.ts +48 -16
- package/src/typings/arazzo.ts +1 -20
- package/src/utils.ts +4 -2
- package/src/visitors.ts +4 -8
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/rules/arazzo/source-description-type.d.ts +0 -2
- package/lib/rules/common/spec.d.ts +0 -2
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`resolveConfig should ignore minimal from the root and read local file 1`] = `
|
|
4
4
|
{
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
5
|
+
"arazzo1Decorators": {},
|
|
6
|
+
"arazzo1Preprocessors": {},
|
|
7
|
+
"arazzo1Rules": {
|
|
8
8
|
"criteria-unique": "warn",
|
|
9
9
|
"no-actions-type-end": "warn",
|
|
10
10
|
"no-criteria-xpath": "warn",
|
|
@@ -13,7 +13,7 @@ exports[`resolveConfig should ignore minimal from the root and read local file 1
|
|
|
13
13
|
"requestBody-replacements-unique": "warn",
|
|
14
14
|
"sourceDescription-name-unique": "error",
|
|
15
15
|
"sourceDescription-type": "error",
|
|
16
|
-
"
|
|
16
|
+
"sourceDescriptions-not-empty": "error",
|
|
17
17
|
"step-onFailure-unique": "warn",
|
|
18
18
|
"step-onSuccess-unique": "warn",
|
|
19
19
|
"stepId-unique": "error",
|
|
@@ -29,7 +29,6 @@ exports[`resolveConfig should ignore minimal from the root and read local file 1
|
|
|
29
29
|
"info-license-strict": "warn",
|
|
30
30
|
"no-channel-trailing-slash": "off",
|
|
31
31
|
"operation-operationId": "warn",
|
|
32
|
-
"spec": "error",
|
|
33
32
|
"tag-description": "warn",
|
|
34
33
|
"tags-alphabetical": "off",
|
|
35
34
|
},
|
|
@@ -41,7 +40,6 @@ exports[`resolveConfig should ignore minimal from the root and read local file 1
|
|
|
41
40
|
"info-license-strict": "warn",
|
|
42
41
|
"no-channel-trailing-slash": "off",
|
|
43
42
|
"operation-operationId": "warn",
|
|
44
|
-
"spec": "error",
|
|
45
43
|
"tag-description": "warn",
|
|
46
44
|
"tags-alphabetical": "off",
|
|
47
45
|
},
|
|
@@ -51,9 +49,48 @@ exports[`resolveConfig should ignore minimal from the root and read local file 1
|
|
|
51
49
|
"oas2Preprocessors": {},
|
|
52
50
|
"oas2Rules": {
|
|
53
51
|
"boolean-parameter-prefixes": "error",
|
|
52
|
+
"info-contact": "off",
|
|
53
|
+
"info-license": "warn",
|
|
54
|
+
"info-license-strict": "warn",
|
|
55
|
+
"info-license-url": "off",
|
|
56
|
+
"no-ambiguous-paths": "warn",
|
|
57
|
+
"no-enum-type-mismatch": "error",
|
|
58
|
+
"no-http-verbs-in-paths": "off",
|
|
59
|
+
"no-identical-paths": "error",
|
|
60
|
+
"no-invalid-parameter-examples": "off",
|
|
61
|
+
"no-invalid-schema-examples": "off",
|
|
62
|
+
"no-path-trailing-slash": "error",
|
|
63
|
+
"no-required-schema-properties-undefined": "off",
|
|
64
|
+
"no-unresolved-refs": "error",
|
|
65
|
+
"operation-2xx-response": "warn",
|
|
66
|
+
"operation-4xx-response": "error",
|
|
67
|
+
"operation-description": "error",
|
|
68
|
+
"operation-operationId": "warn",
|
|
69
|
+
"operation-operationId-unique": "error",
|
|
70
|
+
"operation-operationId-url-safe": "error",
|
|
71
|
+
"operation-parameters-unique": "error",
|
|
72
|
+
"operation-singular-tag": "off",
|
|
73
|
+
"operation-summary": "error",
|
|
74
|
+
"operation-tag-defined": "off",
|
|
75
|
+
"parameter-description": "off",
|
|
76
|
+
"path-declaration-must-exist": "error",
|
|
77
|
+
"path-excludes-patterns": "off",
|
|
78
|
+
"path-http-verbs-order": "error",
|
|
79
|
+
"path-not-include-query": "error",
|
|
80
|
+
"path-parameters-defined": "error",
|
|
81
|
+
"path-params-defined": "off",
|
|
82
|
+
"path-segment-plural": "off",
|
|
83
|
+
"paths-kebab-case": "off",
|
|
54
84
|
"request-mime-type": "off",
|
|
85
|
+
"required-string-property-missing-min-length": "off",
|
|
86
|
+
"response-contains-header": "off",
|
|
55
87
|
"response-contains-property": "off",
|
|
56
88
|
"response-mime-type": "off",
|
|
89
|
+
"scalar-property-missing-example": "off",
|
|
90
|
+
"security-defined": "error",
|
|
91
|
+
"spec-strict-refs": "off",
|
|
92
|
+
"tag-description": "warn",
|
|
93
|
+
"tags-alphabetical": "off",
|
|
57
94
|
},
|
|
58
95
|
"oas3_0Decorators": {},
|
|
59
96
|
"oas3_0Preprocessors": {},
|
|
@@ -61,22 +98,61 @@ exports[`resolveConfig should ignore minimal from the root and read local file 1
|
|
|
61
98
|
"array-parameter-serialization": "off",
|
|
62
99
|
"boolean-parameter-prefixes": "error",
|
|
63
100
|
"component-name-unique": "off",
|
|
101
|
+
"info-contact": "off",
|
|
102
|
+
"info-license": "warn",
|
|
103
|
+
"info-license-strict": "warn",
|
|
104
|
+
"info-license-url": "off",
|
|
105
|
+
"no-ambiguous-paths": "warn",
|
|
64
106
|
"no-empty-servers": "error",
|
|
107
|
+
"no-enum-type-mismatch": "error",
|
|
65
108
|
"no-example-value-and-externalValue": "error",
|
|
109
|
+
"no-http-verbs-in-paths": "off",
|
|
110
|
+
"no-identical-paths": "error",
|
|
66
111
|
"no-invalid-media-type-examples": {
|
|
67
112
|
"allowAdditionalProperties": false,
|
|
68
113
|
"severity": "error",
|
|
69
114
|
},
|
|
115
|
+
"no-invalid-parameter-examples": "off",
|
|
116
|
+
"no-invalid-schema-examples": "off",
|
|
117
|
+
"no-path-trailing-slash": "error",
|
|
118
|
+
"no-required-schema-properties-undefined": "off",
|
|
70
119
|
"no-server-example.com": "warn",
|
|
71
120
|
"no-server-trailing-slash": "error",
|
|
72
121
|
"no-server-variables-empty-enum": "error",
|
|
73
122
|
"no-undefined-server-variable": "error",
|
|
123
|
+
"no-unresolved-refs": "error",
|
|
74
124
|
"no-unused-components": "warn",
|
|
125
|
+
"operation-2xx-response": "warn",
|
|
75
126
|
"operation-4xx-problem-details-rfc7807": "off",
|
|
127
|
+
"operation-4xx-response": "error",
|
|
128
|
+
"operation-description": "error",
|
|
129
|
+
"operation-operationId": "warn",
|
|
130
|
+
"operation-operationId-unique": "error",
|
|
131
|
+
"operation-operationId-url-safe": "error",
|
|
132
|
+
"operation-parameters-unique": "error",
|
|
133
|
+
"operation-singular-tag": "off",
|
|
134
|
+
"operation-summary": "error",
|
|
135
|
+
"operation-tag-defined": "off",
|
|
136
|
+
"parameter-description": "off",
|
|
137
|
+
"path-declaration-must-exist": "error",
|
|
138
|
+
"path-excludes-patterns": "off",
|
|
139
|
+
"path-http-verbs-order": "error",
|
|
140
|
+
"path-not-include-query": "error",
|
|
141
|
+
"path-parameters-defined": "error",
|
|
142
|
+
"path-params-defined": "off",
|
|
143
|
+
"path-segment-plural": "off",
|
|
144
|
+
"paths-kebab-case": "off",
|
|
76
145
|
"request-mime-type": "off",
|
|
146
|
+
"required-string-property-missing-min-length": "off",
|
|
147
|
+
"response-contains-header": "off",
|
|
77
148
|
"response-contains-property": "off",
|
|
78
149
|
"response-mime-type": "off",
|
|
150
|
+
"scalar-property-missing-example": "off",
|
|
151
|
+
"security-defined": "error",
|
|
79
152
|
"spec-components-invalid-map-name": "error",
|
|
153
|
+
"spec-strict-refs": "off",
|
|
154
|
+
"tag-description": "warn",
|
|
155
|
+
"tags-alphabetical": "off",
|
|
80
156
|
},
|
|
81
157
|
"oas3_1Decorators": {},
|
|
82
158
|
"oas3_1Preprocessors": {},
|
|
@@ -84,31 +160,14 @@ exports[`resolveConfig should ignore minimal from the root and read local file 1
|
|
|
84
160
|
"array-parameter-serialization": "off",
|
|
85
161
|
"boolean-parameter-prefixes": "error",
|
|
86
162
|
"component-name-unique": "off",
|
|
87
|
-
"no-empty-servers": "error",
|
|
88
|
-
"no-example-value-and-externalValue": "error",
|
|
89
|
-
"no-invalid-media-type-examples": "error",
|
|
90
|
-
"no-server-example.com": "warn",
|
|
91
|
-
"no-server-trailing-slash": "error",
|
|
92
|
-
"no-server-variables-empty-enum": "error",
|
|
93
|
-
"no-undefined-server-variable": "error",
|
|
94
|
-
"no-unused-components": "warn",
|
|
95
|
-
"operation-4xx-problem-details-rfc7807": "off",
|
|
96
|
-
"request-mime-type": "off",
|
|
97
|
-
"response-contains-property": "off",
|
|
98
|
-
"response-mime-type": "off",
|
|
99
|
-
"spec-components-invalid-map-name": "error",
|
|
100
|
-
},
|
|
101
|
-
"preprocessors": {},
|
|
102
|
-
"recommendedFallback": false,
|
|
103
|
-
"rules": {
|
|
104
|
-
"boolean-parameter-prefixes": "error",
|
|
105
163
|
"info-contact": "off",
|
|
106
164
|
"info-license": "warn",
|
|
107
165
|
"info-license-strict": "warn",
|
|
108
166
|
"info-license-url": "off",
|
|
109
|
-
"local/operation-id-not-test": "error",
|
|
110
167
|
"no-ambiguous-paths": "warn",
|
|
168
|
+
"no-empty-servers": "error",
|
|
111
169
|
"no-enum-type-mismatch": "error",
|
|
170
|
+
"no-example-value-and-externalValue": "error",
|
|
112
171
|
"no-http-verbs-in-paths": "off",
|
|
113
172
|
"no-identical-paths": "error",
|
|
114
173
|
"no-invalid-media-type-examples": "error",
|
|
@@ -116,8 +175,14 @@ exports[`resolveConfig should ignore minimal from the root and read local file 1
|
|
|
116
175
|
"no-invalid-schema-examples": "off",
|
|
117
176
|
"no-path-trailing-slash": "error",
|
|
118
177
|
"no-required-schema-properties-undefined": "off",
|
|
178
|
+
"no-server-example.com": "warn",
|
|
179
|
+
"no-server-trailing-slash": "error",
|
|
180
|
+
"no-server-variables-empty-enum": "error",
|
|
181
|
+
"no-undefined-server-variable": "error",
|
|
119
182
|
"no-unresolved-refs": "error",
|
|
183
|
+
"no-unused-components": "warn",
|
|
120
184
|
"operation-2xx-response": "warn",
|
|
185
|
+
"operation-4xx-problem-details-rfc7807": "off",
|
|
121
186
|
"operation-4xx-response": "error",
|
|
122
187
|
"operation-description": "error",
|
|
123
188
|
"operation-operationId": "warn",
|
|
@@ -136,23 +201,38 @@ exports[`resolveConfig should ignore minimal from the root and read local file 1
|
|
|
136
201
|
"path-params-defined": "off",
|
|
137
202
|
"path-segment-plural": "off",
|
|
138
203
|
"paths-kebab-case": "off",
|
|
204
|
+
"request-mime-type": "off",
|
|
139
205
|
"required-string-property-missing-min-length": "off",
|
|
140
206
|
"response-contains-header": "off",
|
|
207
|
+
"response-contains-property": "off",
|
|
208
|
+
"response-mime-type": "off",
|
|
141
209
|
"scalar-property-missing-example": "off",
|
|
142
210
|
"security-defined": "error",
|
|
143
|
-
"spec": "error",
|
|
211
|
+
"spec-components-invalid-map-name": "error",
|
|
144
212
|
"spec-strict-refs": "off",
|
|
145
213
|
"tag-description": "warn",
|
|
146
214
|
"tags-alphabetical": "off",
|
|
147
215
|
},
|
|
216
|
+
"preprocessors": {},
|
|
217
|
+
"recommendedFallback": false,
|
|
218
|
+
"rules": {
|
|
219
|
+
"boolean-parameter-prefixes": "error",
|
|
220
|
+
"local/operation-id-not-test": "error",
|
|
221
|
+
"no-invalid-media-type-examples": "error",
|
|
222
|
+
"operation-2xx-response": "warn",
|
|
223
|
+
"operation-4xx-response": "error",
|
|
224
|
+
"operation-description": "error",
|
|
225
|
+
"path-http-verbs-order": "error",
|
|
226
|
+
"struct": "error",
|
|
227
|
+
},
|
|
148
228
|
}
|
|
149
229
|
`;
|
|
150
230
|
|
|
151
231
|
exports[`resolveStyleguideConfig should resolve extends with local file config which contains path to nested config 1`] = `
|
|
152
232
|
{
|
|
153
|
-
"
|
|
154
|
-
"
|
|
155
|
-
"
|
|
233
|
+
"arazzo1Decorators": {},
|
|
234
|
+
"arazzo1Preprocessors": {},
|
|
235
|
+
"arazzo1Rules": {
|
|
156
236
|
"criteria-unique": "warn",
|
|
157
237
|
"no-actions-type-end": "warn",
|
|
158
238
|
"no-criteria-xpath": "warn",
|
|
@@ -161,7 +241,7 @@ exports[`resolveStyleguideConfig should resolve extends with local file config w
|
|
|
161
241
|
"requestBody-replacements-unique": "warn",
|
|
162
242
|
"sourceDescription-name-unique": "error",
|
|
163
243
|
"sourceDescription-type": "error",
|
|
164
|
-
"
|
|
244
|
+
"sourceDescriptions-not-empty": "error",
|
|
165
245
|
"step-onFailure-unique": "warn",
|
|
166
246
|
"step-onSuccess-unique": "warn",
|
|
167
247
|
"stepId-unique": "error",
|
|
@@ -177,7 +257,6 @@ exports[`resolveStyleguideConfig should resolve extends with local file config w
|
|
|
177
257
|
"info-license-strict": "warn",
|
|
178
258
|
"no-channel-trailing-slash": "off",
|
|
179
259
|
"operation-operationId": "warn",
|
|
180
|
-
"spec": "error",
|
|
181
260
|
"tag-description": "warn",
|
|
182
261
|
"tags-alphabetical": "off",
|
|
183
262
|
},
|
|
@@ -189,7 +268,6 @@ exports[`resolveStyleguideConfig should resolve extends with local file config w
|
|
|
189
268
|
"info-license-strict": "warn",
|
|
190
269
|
"no-channel-trailing-slash": "off",
|
|
191
270
|
"operation-operationId": "warn",
|
|
192
|
-
"spec": "error",
|
|
193
271
|
"tag-description": "warn",
|
|
194
272
|
"tags-alphabetical": "off",
|
|
195
273
|
},
|
|
@@ -199,9 +277,48 @@ exports[`resolveStyleguideConfig should resolve extends with local file config w
|
|
|
199
277
|
"oas2Preprocessors": {},
|
|
200
278
|
"oas2Rules": {
|
|
201
279
|
"boolean-parameter-prefixes": "error",
|
|
280
|
+
"info-contact": "off",
|
|
281
|
+
"info-license": "warn",
|
|
282
|
+
"info-license-strict": "warn",
|
|
283
|
+
"info-license-url": "off",
|
|
284
|
+
"no-ambiguous-paths": "warn",
|
|
285
|
+
"no-enum-type-mismatch": "error",
|
|
286
|
+
"no-http-verbs-in-paths": "off",
|
|
287
|
+
"no-identical-paths": "error",
|
|
288
|
+
"no-invalid-parameter-examples": "off",
|
|
289
|
+
"no-invalid-schema-examples": "off",
|
|
290
|
+
"no-path-trailing-slash": "error",
|
|
291
|
+
"no-required-schema-properties-undefined": "off",
|
|
292
|
+
"no-unresolved-refs": "error",
|
|
293
|
+
"operation-2xx-response": "error",
|
|
294
|
+
"operation-4xx-response": "off",
|
|
295
|
+
"operation-description": "off",
|
|
296
|
+
"operation-operationId": "warn",
|
|
297
|
+
"operation-operationId-unique": "error",
|
|
298
|
+
"operation-operationId-url-safe": "error",
|
|
299
|
+
"operation-parameters-unique": "error",
|
|
300
|
+
"operation-singular-tag": "off",
|
|
301
|
+
"operation-summary": "error",
|
|
302
|
+
"operation-tag-defined": "off",
|
|
303
|
+
"parameter-description": "off",
|
|
304
|
+
"path-declaration-must-exist": "error",
|
|
305
|
+
"path-excludes-patterns": "off",
|
|
306
|
+
"path-http-verbs-order": "off",
|
|
307
|
+
"path-not-include-query": "error",
|
|
308
|
+
"path-parameters-defined": "error",
|
|
309
|
+
"path-params-defined": "off",
|
|
310
|
+
"path-segment-plural": "off",
|
|
311
|
+
"paths-kebab-case": "off",
|
|
202
312
|
"request-mime-type": "off",
|
|
313
|
+
"required-string-property-missing-min-length": "off",
|
|
314
|
+
"response-contains-header": "off",
|
|
203
315
|
"response-contains-property": "off",
|
|
204
316
|
"response-mime-type": "off",
|
|
317
|
+
"scalar-property-missing-example": "off",
|
|
318
|
+
"security-defined": "error",
|
|
319
|
+
"spec-strict-refs": "off",
|
|
320
|
+
"tag-description": "warn",
|
|
321
|
+
"tags-alphabetical": "off",
|
|
205
322
|
},
|
|
206
323
|
"oas3_0Decorators": {},
|
|
207
324
|
"oas3_0Preprocessors": {},
|
|
@@ -209,22 +326,61 @@ exports[`resolveStyleguideConfig should resolve extends with local file config w
|
|
|
209
326
|
"array-parameter-serialization": "off",
|
|
210
327
|
"boolean-parameter-prefixes": "error",
|
|
211
328
|
"component-name-unique": "off",
|
|
329
|
+
"info-contact": "off",
|
|
330
|
+
"info-license": "warn",
|
|
331
|
+
"info-license-strict": "warn",
|
|
332
|
+
"info-license-url": "off",
|
|
333
|
+
"no-ambiguous-paths": "warn",
|
|
212
334
|
"no-empty-servers": "error",
|
|
335
|
+
"no-enum-type-mismatch": "error",
|
|
213
336
|
"no-example-value-and-externalValue": "error",
|
|
337
|
+
"no-http-verbs-in-paths": "off",
|
|
338
|
+
"no-identical-paths": "error",
|
|
214
339
|
"no-invalid-media-type-examples": {
|
|
215
340
|
"allowAdditionalProperties": false,
|
|
216
341
|
"severity": "warn",
|
|
217
342
|
},
|
|
343
|
+
"no-invalid-parameter-examples": "off",
|
|
344
|
+
"no-invalid-schema-examples": "off",
|
|
345
|
+
"no-path-trailing-slash": "error",
|
|
346
|
+
"no-required-schema-properties-undefined": "off",
|
|
218
347
|
"no-server-example.com": "warn",
|
|
219
348
|
"no-server-trailing-slash": "error",
|
|
220
349
|
"no-server-variables-empty-enum": "error",
|
|
221
350
|
"no-undefined-server-variable": "error",
|
|
351
|
+
"no-unresolved-refs": "error",
|
|
222
352
|
"no-unused-components": "warn",
|
|
353
|
+
"operation-2xx-response": "error",
|
|
223
354
|
"operation-4xx-problem-details-rfc7807": "off",
|
|
355
|
+
"operation-4xx-response": "off",
|
|
356
|
+
"operation-description": "off",
|
|
357
|
+
"operation-operationId": "warn",
|
|
358
|
+
"operation-operationId-unique": "error",
|
|
359
|
+
"operation-operationId-url-safe": "error",
|
|
360
|
+
"operation-parameters-unique": "error",
|
|
361
|
+
"operation-singular-tag": "off",
|
|
362
|
+
"operation-summary": "error",
|
|
363
|
+
"operation-tag-defined": "off",
|
|
364
|
+
"parameter-description": "off",
|
|
365
|
+
"path-declaration-must-exist": "error",
|
|
366
|
+
"path-excludes-patterns": "off",
|
|
367
|
+
"path-http-verbs-order": "off",
|
|
368
|
+
"path-not-include-query": "error",
|
|
369
|
+
"path-parameters-defined": "error",
|
|
370
|
+
"path-params-defined": "off",
|
|
371
|
+
"path-segment-plural": "off",
|
|
372
|
+
"paths-kebab-case": "off",
|
|
224
373
|
"request-mime-type": "off",
|
|
374
|
+
"required-string-property-missing-min-length": "off",
|
|
375
|
+
"response-contains-header": "off",
|
|
225
376
|
"response-contains-property": "off",
|
|
226
377
|
"response-mime-type": "off",
|
|
378
|
+
"scalar-property-missing-example": "off",
|
|
379
|
+
"security-defined": "error",
|
|
227
380
|
"spec-components-invalid-map-name": "error",
|
|
381
|
+
"spec-strict-refs": "off",
|
|
382
|
+
"tag-description": "warn",
|
|
383
|
+
"tags-alphabetical": "off",
|
|
228
384
|
},
|
|
229
385
|
"oas3_1Decorators": {},
|
|
230
386
|
"oas3_1Preprocessors": {},
|
|
@@ -232,49 +388,14 @@ exports[`resolveStyleguideConfig should resolve extends with local file config w
|
|
|
232
388
|
"array-parameter-serialization": "off",
|
|
233
389
|
"boolean-parameter-prefixes": "error",
|
|
234
390
|
"component-name-unique": "off",
|
|
235
|
-
"no-empty-servers": "error",
|
|
236
|
-
"no-example-value-and-externalValue": "error",
|
|
237
|
-
"no-invalid-media-type-examples": "warn",
|
|
238
|
-
"no-server-example.com": "warn",
|
|
239
|
-
"no-server-trailing-slash": "error",
|
|
240
|
-
"no-server-variables-empty-enum": "error",
|
|
241
|
-
"no-undefined-server-variable": "error",
|
|
242
|
-
"no-unused-components": "warn",
|
|
243
|
-
"operation-4xx-problem-details-rfc7807": "off",
|
|
244
|
-
"request-mime-type": "off",
|
|
245
|
-
"response-contains-property": "off",
|
|
246
|
-
"response-mime-type": "off",
|
|
247
|
-
"spec-components-invalid-map-name": "error",
|
|
248
|
-
},
|
|
249
|
-
"preprocessors": {},
|
|
250
|
-
"recommendedFallback": undefined,
|
|
251
|
-
"rules": {
|
|
252
|
-
"assertions": [
|
|
253
|
-
{
|
|
254
|
-
"assertionId": "rule/path-item-get-defined",
|
|
255
|
-
"defined": true,
|
|
256
|
-
"message": "Every path item must have a GET operation.",
|
|
257
|
-
"property": "get",
|
|
258
|
-
"subject": "PathItem",
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
"assertionId": "rule/tag-description",
|
|
262
|
-
"message": "Tag description must be at least 13 characters and end with a full stop.",
|
|
263
|
-
"minLength": 13,
|
|
264
|
-
"pattern": "/\\.$/",
|
|
265
|
-
"property": "description",
|
|
266
|
-
"severity": "error",
|
|
267
|
-
"subject": "Tag",
|
|
268
|
-
},
|
|
269
|
-
],
|
|
270
|
-
"boolean-parameter-prefixes": "error",
|
|
271
391
|
"info-contact": "off",
|
|
272
392
|
"info-license": "warn",
|
|
273
393
|
"info-license-strict": "warn",
|
|
274
394
|
"info-license-url": "off",
|
|
275
|
-
"local/operation-id-not-test": "error",
|
|
276
395
|
"no-ambiguous-paths": "warn",
|
|
396
|
+
"no-empty-servers": "error",
|
|
277
397
|
"no-enum-type-mismatch": "error",
|
|
398
|
+
"no-example-value-and-externalValue": "error",
|
|
278
399
|
"no-http-verbs-in-paths": "off",
|
|
279
400
|
"no-identical-paths": "error",
|
|
280
401
|
"no-invalid-media-type-examples": "warn",
|
|
@@ -282,8 +403,14 @@ exports[`resolveStyleguideConfig should resolve extends with local file config w
|
|
|
282
403
|
"no-invalid-schema-examples": "off",
|
|
283
404
|
"no-path-trailing-slash": "error",
|
|
284
405
|
"no-required-schema-properties-undefined": "off",
|
|
406
|
+
"no-server-example.com": "warn",
|
|
407
|
+
"no-server-trailing-slash": "error",
|
|
408
|
+
"no-server-variables-empty-enum": "error",
|
|
409
|
+
"no-undefined-server-variable": "error",
|
|
285
410
|
"no-unresolved-refs": "error",
|
|
411
|
+
"no-unused-components": "warn",
|
|
286
412
|
"operation-2xx-response": "error",
|
|
413
|
+
"operation-4xx-problem-details-rfc7807": "off",
|
|
287
414
|
"operation-4xx-response": "off",
|
|
288
415
|
"operation-description": "off",
|
|
289
416
|
"operation-operationId": "warn",
|
|
@@ -302,14 +429,45 @@ exports[`resolveStyleguideConfig should resolve extends with local file config w
|
|
|
302
429
|
"path-params-defined": "off",
|
|
303
430
|
"path-segment-plural": "off",
|
|
304
431
|
"paths-kebab-case": "off",
|
|
432
|
+
"request-mime-type": "off",
|
|
305
433
|
"required-string-property-missing-min-length": "off",
|
|
306
434
|
"response-contains-header": "off",
|
|
435
|
+
"response-contains-property": "off",
|
|
436
|
+
"response-mime-type": "off",
|
|
307
437
|
"scalar-property-missing-example": "off",
|
|
308
438
|
"security-defined": "error",
|
|
309
|
-
"spec": "error",
|
|
439
|
+
"spec-components-invalid-map-name": "error",
|
|
310
440
|
"spec-strict-refs": "off",
|
|
311
441
|
"tag-description": "warn",
|
|
312
442
|
"tags-alphabetical": "off",
|
|
313
443
|
},
|
|
444
|
+
"preprocessors": {},
|
|
445
|
+
"recommendedFallback": undefined,
|
|
446
|
+
"rules": {
|
|
447
|
+
"assertions": [
|
|
448
|
+
{
|
|
449
|
+
"assertionId": "rule/path-item-get-defined",
|
|
450
|
+
"defined": true,
|
|
451
|
+
"message": "Every path item must have a GET operation.",
|
|
452
|
+
"property": "get",
|
|
453
|
+
"subject": "PathItem",
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
"assertionId": "rule/tag-description",
|
|
457
|
+
"message": "Tag description must be at least 13 characters and end with a full stop.",
|
|
458
|
+
"minLength": 13,
|
|
459
|
+
"pattern": "/\\.$/",
|
|
460
|
+
"property": "description",
|
|
461
|
+
"severity": "error",
|
|
462
|
+
"subject": "Tag",
|
|
463
|
+
},
|
|
464
|
+
],
|
|
465
|
+
"boolean-parameter-prefixes": "error",
|
|
466
|
+
"local/operation-id-not-test": "error",
|
|
467
|
+
"no-invalid-media-type-examples": "warn",
|
|
468
|
+
"operation-2xx-response": "error",
|
|
469
|
+
"operation-4xx-response": "off",
|
|
470
|
+
"struct": "error",
|
|
471
|
+
},
|
|
314
472
|
}
|
|
315
473
|
`;
|
|
@@ -6,7 +6,7 @@ StyleguideConfig {
|
|
|
6
6
|
"_usedVersions": Set {},
|
|
7
7
|
"configFile": undefined,
|
|
8
8
|
"decorators": {
|
|
9
|
-
"
|
|
9
|
+
"arazzo1": {},
|
|
10
10
|
"async2": {
|
|
11
11
|
"oas2": {},
|
|
12
12
|
"oas3_0": {},
|
|
@@ -50,7 +50,7 @@ StyleguideConfig {
|
|
|
50
50
|
"pluginPaths": [],
|
|
51
51
|
"plugins": [],
|
|
52
52
|
"preprocessors": {
|
|
53
|
-
"
|
|
53
|
+
"arazzo1": {},
|
|
54
54
|
"async2": {
|
|
55
55
|
"oas2": {},
|
|
56
56
|
"oas3_0": {},
|
|
@@ -119,7 +119,20 @@ StyleguideConfig {
|
|
|
119
119
|
},
|
|
120
120
|
"recommendedFallback": false,
|
|
121
121
|
"rules": {
|
|
122
|
-
"
|
|
122
|
+
"arazzo1": {
|
|
123
|
+
"oas2": {
|
|
124
|
+
"no-empty-servers": "error",
|
|
125
|
+
"operation-summary": "error",
|
|
126
|
+
},
|
|
127
|
+
"oas3_0": {
|
|
128
|
+
"no-empty-servers": "error",
|
|
129
|
+
"operation-summary": "error",
|
|
130
|
+
},
|
|
131
|
+
"oas3_1": {
|
|
132
|
+
"no-empty-servers": "error",
|
|
133
|
+
"operation-summary": "error",
|
|
134
|
+
},
|
|
135
|
+
},
|
|
123
136
|
"async2": {
|
|
124
137
|
"oas2": {
|
|
125
138
|
"no-empty-servers": "error",
|
|
@@ -389,11 +389,23 @@ describe('resolveStyleguideConfig', () => {
|
|
|
389
389
|
|
|
390
390
|
describe('resolveApis', () => {
|
|
391
391
|
it('should resolve apis styleguideConfig and merge minimal extends', async () => {
|
|
392
|
+
const baseStyleguideConfig: StyleguideRawConfig = {
|
|
393
|
+
oas3_1Rules: {
|
|
394
|
+
'operation-2xx-response': 'error',
|
|
395
|
+
},
|
|
396
|
+
};
|
|
397
|
+
const mergedStyleguidePreset = resolveStyleguideConfig({
|
|
398
|
+
styleguideConfig: { ...baseStyleguideConfig, extends: ['minimal'] },
|
|
399
|
+
});
|
|
392
400
|
const rawConfig: RawConfig = {
|
|
393
401
|
apis: {
|
|
394
402
|
petstore: {
|
|
395
403
|
root: 'some/path',
|
|
396
|
-
styleguide: {
|
|
404
|
+
styleguide: {
|
|
405
|
+
oas3_1Rules: {
|
|
406
|
+
'operation-2xx-response': 'error',
|
|
407
|
+
},
|
|
408
|
+
},
|
|
397
409
|
},
|
|
398
410
|
},
|
|
399
411
|
styleguide: {
|
|
@@ -401,7 +413,7 @@ describe('resolveApis', () => {
|
|
|
401
413
|
},
|
|
402
414
|
};
|
|
403
415
|
const apisResult = await resolveApis({ rawConfig });
|
|
404
|
-
expect(apisResult['petstore'].styleguide).toEqual(await
|
|
416
|
+
expect(apisResult['petstore'].styleguide).toEqual(await mergedStyleguidePreset);
|
|
405
417
|
});
|
|
406
418
|
|
|
407
419
|
it('should not merge recommended extends by default by every level', async () => {
|
|
@@ -117,7 +117,7 @@ describe('getMergedConfig', () => {
|
|
|
117
117
|
"_usedVersions": Set {},
|
|
118
118
|
"configFile": "redocly.yaml",
|
|
119
119
|
"decorators": {
|
|
120
|
-
"
|
|
120
|
+
"arazzo1": {},
|
|
121
121
|
"async2": {},
|
|
122
122
|
"async3": {},
|
|
123
123
|
"oas2": {},
|
|
@@ -130,7 +130,7 @@ describe('getMergedConfig', () => {
|
|
|
130
130
|
"pluginPaths": [],
|
|
131
131
|
"plugins": [],
|
|
132
132
|
"preprocessors": {
|
|
133
|
-
"
|
|
133
|
+
"arazzo1": {},
|
|
134
134
|
"async2": {},
|
|
135
135
|
"async3": {},
|
|
136
136
|
"oas2": {},
|
|
@@ -146,7 +146,9 @@ describe('getMergedConfig', () => {
|
|
|
146
146
|
},
|
|
147
147
|
"recommendedFallback": false,
|
|
148
148
|
"rules": {
|
|
149
|
-
"
|
|
149
|
+
"arazzo1": {
|
|
150
|
+
"operation-summary": "warn",
|
|
151
|
+
},
|
|
150
152
|
"async2": {
|
|
151
153
|
"operation-summary": "warn",
|
|
152
154
|
},
|
|
@@ -230,7 +232,7 @@ describe('getMergedConfig', () => {
|
|
|
230
232
|
"_usedVersions": Set {},
|
|
231
233
|
"configFile": "redocly.yaml",
|
|
232
234
|
"decorators": {
|
|
233
|
-
"
|
|
235
|
+
"arazzo1": {},
|
|
234
236
|
"async2": {},
|
|
235
237
|
"async3": {},
|
|
236
238
|
"oas2": {},
|
|
@@ -243,7 +245,7 @@ describe('getMergedConfig', () => {
|
|
|
243
245
|
"pluginPaths": [],
|
|
244
246
|
"plugins": [],
|
|
245
247
|
"preprocessors": {
|
|
246
|
-
"
|
|
248
|
+
"arazzo1": {},
|
|
247
249
|
"async2": {},
|
|
248
250
|
"async3": {},
|
|
249
251
|
"oas2": {},
|
|
@@ -261,7 +263,10 @@ describe('getMergedConfig', () => {
|
|
|
261
263
|
},
|
|
262
264
|
"recommendedFallback": false,
|
|
263
265
|
"rules": {
|
|
264
|
-
"
|
|
266
|
+
"arazzo1": {
|
|
267
|
+
"no-empty-servers": "error",
|
|
268
|
+
"operation-summary": "error",
|
|
269
|
+
},
|
|
265
270
|
"async2": {
|
|
266
271
|
"no-empty-servers": "error",
|
|
267
272
|
"operation-summary": "error",
|