@redocly/openapi-core 1.25.15 → 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 +11 -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 -16
- package/lib/types/redocly-yaml.d.ts +6 -8
- package/lib/types/redocly-yaml.js +47 -12
- package/lib/typings/arazzo.d.ts +1 -6
- package/lib/utils.d.ts +1 -1
- package/lib/utils.js +3 -2
- package/lib/visitors.d.ts +5 -6
- package/package.json +1 -1
- 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 -14
- package/src/types/redocly-yaml.ts +48 -16
- package/src/typings/arazzo.ts +1 -10
- package/src/utils.ts +4 -2
- package/src/visitors.ts +4 -6
- 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
package/src/config/config.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as fs from 'fs';
|
|
2
2
|
import * as path from 'path';
|
|
3
3
|
import { parseYaml, stringifyYaml } from '../js-yaml';
|
|
4
|
-
import { slash, doesYamlFileExist } from '../utils';
|
|
4
|
+
import { slash, doesYamlFileExist, isPlainObject, showWarningForDeprecatedField } from '../utils';
|
|
5
5
|
import { SpecVersion, SpecMajorVersion } from '../oas-types';
|
|
6
6
|
import { isBrowser } from '../env';
|
|
7
7
|
import { getResolveConfig } from './utils';
|
|
@@ -13,7 +13,7 @@ import type {
|
|
|
13
13
|
Oas3RuleSet,
|
|
14
14
|
Async2RuleSet,
|
|
15
15
|
Async3RuleSet,
|
|
16
|
-
|
|
16
|
+
Arazzo1RuleSet,
|
|
17
17
|
} from '../oas-types';
|
|
18
18
|
import type { NodeType } from '../types';
|
|
19
19
|
import type {
|
|
@@ -67,16 +67,25 @@ export class StyleguideConfig {
|
|
|
67
67
|
this.doNotResolveExamples = !!rawConfig.doNotResolveExamples;
|
|
68
68
|
this.recommendedFallback = rawConfig.recommendedFallback || false;
|
|
69
69
|
|
|
70
|
+
const ruleGroups: (keyof ResolvedStyleguideConfig)[] = [
|
|
71
|
+
'rules',
|
|
72
|
+
'oas2Rules',
|
|
73
|
+
'oas3_0Rules',
|
|
74
|
+
'oas3_1Rules',
|
|
75
|
+
'async2Rules',
|
|
76
|
+
'async3Rules',
|
|
77
|
+
'arazzo1Rules',
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
replaceSpecWithStruct(ruleGroups, rawConfig);
|
|
81
|
+
|
|
70
82
|
this.rules = {
|
|
71
83
|
[SpecVersion.OAS2]: { ...rawConfig.rules, ...rawConfig.oas2Rules },
|
|
72
84
|
[SpecVersion.OAS3_0]: { ...rawConfig.rules, ...rawConfig.oas3_0Rules },
|
|
73
85
|
[SpecVersion.OAS3_1]: { ...rawConfig.rules, ...rawConfig.oas3_1Rules },
|
|
74
86
|
[SpecVersion.Async2]: { ...rawConfig.rules, ...rawConfig.async2Rules },
|
|
75
87
|
[SpecVersion.Async3]: { ...rawConfig.rules, ...rawConfig.async3Rules },
|
|
76
|
-
[SpecVersion.
|
|
77
|
-
...(rawConfig.arazzoRules || {}),
|
|
78
|
-
...(rawConfig.rules?.assertions ? { assertions: rawConfig.rules.assertions } : {}),
|
|
79
|
-
},
|
|
88
|
+
[SpecVersion.Arazzo1]: { ...rawConfig.rules, ...rawConfig.arazzo1Rules },
|
|
80
89
|
};
|
|
81
90
|
|
|
82
91
|
this.preprocessors = {
|
|
@@ -85,7 +94,7 @@ export class StyleguideConfig {
|
|
|
85
94
|
[SpecVersion.OAS3_1]: { ...rawConfig.preprocessors, ...rawConfig.oas3_1Preprocessors },
|
|
86
95
|
[SpecVersion.Async2]: { ...rawConfig.preprocessors, ...rawConfig.async2Preprocessors },
|
|
87
96
|
[SpecVersion.Async3]: { ...rawConfig.preprocessors, ...rawConfig.async3Preprocessors },
|
|
88
|
-
[SpecVersion.
|
|
97
|
+
[SpecVersion.Arazzo1]: { ...rawConfig.arazzo1Preprocessors },
|
|
89
98
|
};
|
|
90
99
|
|
|
91
100
|
this.decorators = {
|
|
@@ -94,7 +103,7 @@ export class StyleguideConfig {
|
|
|
94
103
|
[SpecVersion.OAS3_1]: { ...rawConfig.decorators, ...rawConfig.oas3_1Decorators },
|
|
95
104
|
[SpecVersion.Async2]: { ...rawConfig.decorators, ...rawConfig.async2Decorators },
|
|
96
105
|
[SpecVersion.Async3]: { ...rawConfig.decorators, ...rawConfig.async3Decorators },
|
|
97
|
-
[SpecVersion.
|
|
106
|
+
[SpecVersion.Arazzo1]: { ...rawConfig.arazzo1Decorators },
|
|
98
107
|
};
|
|
99
108
|
|
|
100
109
|
this.extendPaths = rawConfig.extendPaths || [];
|
|
@@ -111,6 +120,8 @@ export class StyleguideConfig {
|
|
|
111
120
|
Record<string, Set<string>>
|
|
112
121
|
>) || {};
|
|
113
122
|
|
|
123
|
+
replaceSpecWithStruct(Object.keys(this.ignore), this.ignore);
|
|
124
|
+
|
|
114
125
|
// resolve ignore paths
|
|
115
126
|
for (const fileName of Object.keys(this.ignore)) {
|
|
116
127
|
this.ignore[
|
|
@@ -192,9 +203,9 @@ export class StyleguideConfig {
|
|
|
192
203
|
if (!plugin.typeExtension.async3) continue;
|
|
193
204
|
extendedTypes = plugin.typeExtension.async3(extendedTypes, version);
|
|
194
205
|
break;
|
|
195
|
-
case SpecVersion.
|
|
196
|
-
if (!plugin.typeExtension.
|
|
197
|
-
extendedTypes = plugin.typeExtension.
|
|
206
|
+
case SpecVersion.Arazzo1:
|
|
207
|
+
if (!plugin.typeExtension.arazzo1) continue;
|
|
208
|
+
extendedTypes = plugin.typeExtension.arazzo1(extendedTypes, version);
|
|
198
209
|
break;
|
|
199
210
|
default:
|
|
200
211
|
throw new Error('Not implemented');
|
|
@@ -268,25 +279,25 @@ export class StyleguideConfig {
|
|
|
268
279
|
};
|
|
269
280
|
}
|
|
270
281
|
|
|
271
|
-
|
|
282
|
+
getRulesForSpecVersion(version: SpecMajorVersion) {
|
|
272
283
|
switch (version) {
|
|
273
284
|
case SpecMajorVersion.OAS3:
|
|
274
285
|
// eslint-disable-next-line no-case-declarations
|
|
275
|
-
const oas3Rules: Oas3RuleSet[] = [];
|
|
286
|
+
const oas3Rules: Oas3RuleSet[] = [];
|
|
276
287
|
this.plugins.forEach((p) => p.preprocessors?.oas3 && oas3Rules.push(p.preprocessors.oas3));
|
|
277
288
|
this.plugins.forEach((p) => p.rules?.oas3 && oas3Rules.push(p.rules.oas3));
|
|
278
289
|
this.plugins.forEach((p) => p.decorators?.oas3 && oas3Rules.push(p.decorators.oas3));
|
|
279
290
|
return oas3Rules;
|
|
280
291
|
case SpecMajorVersion.OAS2:
|
|
281
292
|
// eslint-disable-next-line no-case-declarations
|
|
282
|
-
const oas2Rules: Oas2RuleSet[] = [];
|
|
293
|
+
const oas2Rules: Oas2RuleSet[] = [];
|
|
283
294
|
this.plugins.forEach((p) => p.preprocessors?.oas2 && oas2Rules.push(p.preprocessors.oas2));
|
|
284
295
|
this.plugins.forEach((p) => p.rules?.oas2 && oas2Rules.push(p.rules.oas2));
|
|
285
296
|
this.plugins.forEach((p) => p.decorators?.oas2 && oas2Rules.push(p.decorators.oas2));
|
|
286
297
|
return oas2Rules;
|
|
287
298
|
case SpecMajorVersion.Async2:
|
|
288
299
|
// eslint-disable-next-line no-case-declarations
|
|
289
|
-
const asyncApi2Rules: Async2RuleSet[] = [];
|
|
300
|
+
const asyncApi2Rules: Async2RuleSet[] = [];
|
|
290
301
|
this.plugins.forEach(
|
|
291
302
|
(p) => p.preprocessors?.async2 && asyncApi2Rules.push(p.preprocessors.async2)
|
|
292
303
|
);
|
|
@@ -297,7 +308,7 @@ export class StyleguideConfig {
|
|
|
297
308
|
return asyncApi2Rules;
|
|
298
309
|
case SpecMajorVersion.Async3:
|
|
299
310
|
// eslint-disable-next-line no-case-declarations
|
|
300
|
-
const asyncApi3Rules: Async3RuleSet[] = [];
|
|
311
|
+
const asyncApi3Rules: Async3RuleSet[] = [];
|
|
301
312
|
this.plugins.forEach(
|
|
302
313
|
(p) => p.preprocessors?.async3 && asyncApi3Rules.push(p.preprocessors.async3)
|
|
303
314
|
);
|
|
@@ -306,15 +317,17 @@ export class StyleguideConfig {
|
|
|
306
317
|
(p) => p.decorators?.async3 && asyncApi3Rules.push(p.decorators.async3)
|
|
307
318
|
);
|
|
308
319
|
return asyncApi3Rules;
|
|
309
|
-
case SpecMajorVersion.
|
|
320
|
+
case SpecMajorVersion.Arazzo1:
|
|
310
321
|
// eslint-disable-next-line no-case-declarations
|
|
311
|
-
const
|
|
322
|
+
const arazzo1Rules: Arazzo1RuleSet[] = [];
|
|
323
|
+
this.plugins.forEach(
|
|
324
|
+
(p) => p.preprocessors?.arazzo1 && arazzo1Rules.push(p.preprocessors.arazzo1)
|
|
325
|
+
);
|
|
326
|
+
this.plugins.forEach((p) => p.rules?.arazzo1 && arazzo1Rules.push(p.rules.arazzo1));
|
|
312
327
|
this.plugins.forEach(
|
|
313
|
-
(p) => p.
|
|
328
|
+
(p) => p.decorators?.arazzo1 && arazzo1Rules.push(p.decorators.arazzo1)
|
|
314
329
|
);
|
|
315
|
-
|
|
316
|
-
this.plugins.forEach((p) => p.decorators?.arazzo && arazzoRules.push(p.decorators.arazzo));
|
|
317
|
-
return arazzoRules;
|
|
330
|
+
return arazzo1Rules;
|
|
318
331
|
}
|
|
319
332
|
}
|
|
320
333
|
|
|
@@ -356,6 +369,17 @@ export class StyleguideConfig {
|
|
|
356
369
|
}
|
|
357
370
|
}
|
|
358
371
|
|
|
372
|
+
// To support backwards compatibility with the old `spec` key we rename it to `struct`.
|
|
373
|
+
function replaceSpecWithStruct(ruleGroups: string[], config: Record<string, unknown>) {
|
|
374
|
+
for (const ruleGroup of ruleGroups) {
|
|
375
|
+
if (config[ruleGroup] && isPlainObject(config[ruleGroup]) && 'spec' in config[ruleGroup]) {
|
|
376
|
+
showWarningForDeprecatedField('spec', 'struct');
|
|
377
|
+
config[ruleGroup].struct = config[ruleGroup].spec;
|
|
378
|
+
delete config[ruleGroup].spec;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
359
383
|
export class Config {
|
|
360
384
|
apis: Record<string, ResolvedApi>;
|
|
361
385
|
styleguide: StyleguideConfig;
|
package/src/config/minimal.ts
CHANGED
|
@@ -2,54 +2,70 @@ import type { PluginStyleguideConfig } from './types';
|
|
|
2
2
|
|
|
3
3
|
const minimal: PluginStyleguideConfig<'built-in'> = {
|
|
4
4
|
rules: {
|
|
5
|
+
struct: 'error',
|
|
6
|
+
},
|
|
7
|
+
oas2Rules: {
|
|
8
|
+
'boolean-parameter-prefixes': 'off',
|
|
5
9
|
'info-contact': 'off',
|
|
6
10
|
'info-license': 'off',
|
|
7
11
|
'info-license-url': 'off',
|
|
8
12
|
'info-license-strict': 'off',
|
|
9
|
-
'tag-description': 'warn',
|
|
10
|
-
'tags-alphabetical': 'off',
|
|
11
|
-
'parameter-description': 'off',
|
|
12
13
|
'no-path-trailing-slash': 'warn',
|
|
13
14
|
'no-identical-paths': 'warn',
|
|
14
15
|
'no-ambiguous-paths': 'warn',
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
16
|
+
'no-invalid-schema-examples': 'off',
|
|
17
|
+
'no-invalid-parameter-examples': 'off',
|
|
18
|
+
'no-http-verbs-in-paths': 'off',
|
|
19
|
+
'no-enum-type-mismatch': 'warn',
|
|
20
|
+
'no-unresolved-refs': 'error',
|
|
21
|
+
'no-required-schema-properties-undefined': 'off',
|
|
22
|
+
'operation-summary': 'warn',
|
|
23
|
+
'operation-operationId': 'warn',
|
|
24
|
+
'operation-operationId-unique': 'warn',
|
|
25
|
+
'operation-operationId-url-safe': 'warn',
|
|
18
26
|
'operation-description': 'off',
|
|
19
27
|
'operation-2xx-response': 'warn',
|
|
20
28
|
'operation-4xx-response': 'off',
|
|
21
|
-
'operation-operationId': 'warn',
|
|
22
|
-
'operation-summary': 'warn',
|
|
23
|
-
'operation-operationId-unique': 'warn',
|
|
24
29
|
'operation-parameters-unique': 'warn',
|
|
25
30
|
'operation-tag-defined': 'off',
|
|
26
|
-
'security-defined': 'warn',
|
|
27
|
-
'operation-operationId-url-safe': 'warn',
|
|
28
31
|
'operation-singular-tag': 'off',
|
|
29
|
-
'
|
|
30
|
-
'
|
|
32
|
+
'parameter-description': 'off',
|
|
33
|
+
'path-declaration-must-exist': 'warn',
|
|
34
|
+
'path-not-include-query': 'warn',
|
|
35
|
+
'path-parameters-defined': 'warn',
|
|
31
36
|
'paths-kebab-case': 'off',
|
|
32
|
-
spec: 'error',
|
|
33
|
-
'spec-strict-refs': 'off',
|
|
34
|
-
'no-http-verbs-in-paths': 'off',
|
|
35
|
-
'no-invalid-parameter-examples': 'off',
|
|
36
|
-
'no-invalid-schema-examples': 'off',
|
|
37
37
|
'path-excludes-patterns': 'off',
|
|
38
38
|
'path-http-verbs-order': 'off',
|
|
39
39
|
'path-params-defined': 'off',
|
|
40
|
+
'path-segment-plural': 'off',
|
|
40
41
|
'required-string-property-missing-min-length': 'off',
|
|
41
42
|
'response-contains-header': 'off',
|
|
42
|
-
'path-segment-plural': 'off',
|
|
43
|
-
'scalar-property-missing-example': 'off',
|
|
44
|
-
'no-required-schema-properties-undefined': 'off',
|
|
45
|
-
},
|
|
46
|
-
oas2Rules: {
|
|
47
|
-
'boolean-parameter-prefixes': 'off',
|
|
48
43
|
'request-mime-type': 'off',
|
|
49
44
|
'response-contains-property': 'off',
|
|
50
45
|
'response-mime-type': 'off',
|
|
46
|
+
'security-defined': 'warn',
|
|
47
|
+
'spec-strict-refs': 'off',
|
|
48
|
+
'scalar-property-missing-example': 'off',
|
|
49
|
+
'tag-description': 'warn',
|
|
50
|
+
'tags-alphabetical': 'off',
|
|
51
51
|
},
|
|
52
52
|
oas3_0Rules: {
|
|
53
|
+
'array-parameter-serialization': 'off',
|
|
54
|
+
'boolean-parameter-prefixes': 'off',
|
|
55
|
+
'component-name-unique': 'off',
|
|
56
|
+
'info-contact': 'off',
|
|
57
|
+
'info-license': 'off',
|
|
58
|
+
'info-license-url': 'off',
|
|
59
|
+
'info-license-strict': 'off',
|
|
60
|
+
'no-ambiguous-paths': 'warn',
|
|
61
|
+
'no-path-trailing-slash': 'warn',
|
|
62
|
+
'no-identical-paths': 'warn',
|
|
63
|
+
'no-invalid-schema-examples': 'off',
|
|
64
|
+
'no-invalid-parameter-examples': 'off',
|
|
65
|
+
'no-http-verbs-in-paths': 'off',
|
|
66
|
+
'no-enum-type-mismatch': 'warn',
|
|
67
|
+
'no-unresolved-refs': 'error',
|
|
68
|
+
'no-required-schema-properties-undefined': 'off',
|
|
53
69
|
'no-invalid-media-type-examples': {
|
|
54
70
|
severity: 'warn',
|
|
55
71
|
allowAdditionalProperties: false,
|
|
@@ -61,16 +77,55 @@ const minimal: PluginStyleguideConfig<'built-in'> = {
|
|
|
61
77
|
'no-unused-components': 'warn',
|
|
62
78
|
'no-undefined-server-variable': 'warn',
|
|
63
79
|
'no-server-variables-empty-enum': 'error',
|
|
64
|
-
'
|
|
65
|
-
'
|
|
66
|
-
'
|
|
80
|
+
'operation-summary': 'warn',
|
|
81
|
+
'operation-operationId': 'warn',
|
|
82
|
+
'operation-operationId-unique': 'warn',
|
|
83
|
+
'operation-operationId-url-safe': 'warn',
|
|
84
|
+
'operation-description': 'off',
|
|
85
|
+
'operation-2xx-response': 'warn',
|
|
86
|
+
'operation-4xx-response': 'off',
|
|
67
87
|
'operation-4xx-problem-details-rfc7807': 'off',
|
|
88
|
+
'operation-parameters-unique': 'warn',
|
|
89
|
+
'operation-tag-defined': 'off',
|
|
90
|
+
'operation-singular-tag': 'off',
|
|
91
|
+
'parameter-description': 'off',
|
|
92
|
+
'path-declaration-must-exist': 'warn',
|
|
93
|
+
'path-not-include-query': 'warn',
|
|
94
|
+
'path-parameters-defined': 'warn',
|
|
95
|
+
'paths-kebab-case': 'off',
|
|
96
|
+
'path-excludes-patterns': 'off',
|
|
97
|
+
'path-http-verbs-order': 'off',
|
|
98
|
+
'path-params-defined': 'off',
|
|
99
|
+
'path-segment-plural': 'off',
|
|
100
|
+
'required-string-property-missing-min-length': 'off',
|
|
101
|
+
'response-contains-header': 'off',
|
|
68
102
|
'request-mime-type': 'off',
|
|
69
103
|
'response-contains-property': 'off',
|
|
70
104
|
'response-mime-type': 'off',
|
|
71
|
-
'
|
|
105
|
+
'security-defined': 'warn',
|
|
106
|
+
'spec-strict-refs': 'off',
|
|
107
|
+
'scalar-property-missing-example': 'off',
|
|
108
|
+
'spec-components-invalid-map-name': 'warn',
|
|
109
|
+
'tag-description': 'warn',
|
|
110
|
+
'tags-alphabetical': 'off',
|
|
72
111
|
},
|
|
73
112
|
oas3_1Rules: {
|
|
113
|
+
'array-parameter-serialization': 'off',
|
|
114
|
+
'boolean-parameter-prefixes': 'off',
|
|
115
|
+
'component-name-unique': 'off',
|
|
116
|
+
'info-contact': 'off',
|
|
117
|
+
'info-license': 'off',
|
|
118
|
+
'info-license-url': 'off',
|
|
119
|
+
'info-license-strict': 'off',
|
|
120
|
+
'no-path-trailing-slash': 'warn',
|
|
121
|
+
'no-identical-paths': 'warn',
|
|
122
|
+
'no-ambiguous-paths': 'warn',
|
|
123
|
+
'no-invalid-schema-examples': 'off',
|
|
124
|
+
'no-invalid-parameter-examples': 'off',
|
|
125
|
+
'no-http-verbs-in-paths': 'off',
|
|
126
|
+
'no-enum-type-mismatch': 'warn',
|
|
127
|
+
'no-unresolved-refs': 'error',
|
|
128
|
+
'no-required-schema-properties-undefined': 'off',
|
|
74
129
|
'no-invalid-media-type-examples': 'warn',
|
|
75
130
|
'no-server-example.com': 'warn',
|
|
76
131
|
'no-server-trailing-slash': 'error',
|
|
@@ -79,51 +134,72 @@ const minimal: PluginStyleguideConfig<'built-in'> = {
|
|
|
79
134
|
'no-unused-components': 'warn',
|
|
80
135
|
'no-undefined-server-variable': 'warn',
|
|
81
136
|
'no-server-variables-empty-enum': 'error',
|
|
82
|
-
'
|
|
83
|
-
'
|
|
84
|
-
'
|
|
137
|
+
'operation-summary': 'warn',
|
|
138
|
+
'operation-operationId': 'warn',
|
|
139
|
+
'operation-operationId-unique': 'warn',
|
|
140
|
+
'operation-operationId-url-safe': 'warn',
|
|
141
|
+
'operation-description': 'off',
|
|
142
|
+
'operation-2xx-response': 'warn',
|
|
143
|
+
'operation-4xx-response': 'off',
|
|
85
144
|
'operation-4xx-problem-details-rfc7807': 'off',
|
|
145
|
+
'operation-parameters-unique': 'warn',
|
|
146
|
+
'operation-tag-defined': 'off',
|
|
147
|
+
'operation-singular-tag': 'off',
|
|
148
|
+
'parameter-description': 'off',
|
|
149
|
+
'path-declaration-must-exist': 'warn',
|
|
150
|
+
'path-not-include-query': 'warn',
|
|
151
|
+
'path-parameters-defined': 'warn',
|
|
152
|
+
'paths-kebab-case': 'off',
|
|
153
|
+
'path-excludes-patterns': 'off',
|
|
154
|
+
'path-http-verbs-order': 'off',
|
|
155
|
+
'path-params-defined': 'off',
|
|
156
|
+
'path-segment-plural': 'off',
|
|
157
|
+
'required-string-property-missing-min-length': 'off',
|
|
158
|
+
'response-contains-header': 'off',
|
|
86
159
|
'request-mime-type': 'off',
|
|
87
160
|
'response-contains-property': 'off',
|
|
88
161
|
'response-mime-type': 'off',
|
|
89
|
-
'
|
|
162
|
+
'security-defined': 'warn',
|
|
163
|
+
'spec-strict-refs': 'off',
|
|
164
|
+
'scalar-property-missing-example': 'off',
|
|
165
|
+
'spec-components-invalid-map-name': 'warn',
|
|
166
|
+
'tag-description': 'warn',
|
|
167
|
+
'tags-alphabetical': 'off',
|
|
90
168
|
},
|
|
91
169
|
async2Rules: {
|
|
92
|
-
|
|
170
|
+
'channels-kebab-case': 'off',
|
|
93
171
|
'info-contact': 'off',
|
|
94
172
|
'info-license-strict': 'off',
|
|
173
|
+
'no-channel-trailing-slash': 'off',
|
|
95
174
|
'operation-operationId': 'warn',
|
|
96
175
|
'tag-description': 'warn',
|
|
97
176
|
'tags-alphabetical': 'off',
|
|
98
|
-
'channels-kebab-case': 'off',
|
|
99
|
-
'no-channel-trailing-slash': 'off',
|
|
100
177
|
},
|
|
101
178
|
async3Rules: {
|
|
102
|
-
|
|
179
|
+
'channels-kebab-case': 'off',
|
|
103
180
|
'info-contact': 'off',
|
|
104
181
|
'info-license-strict': 'off',
|
|
182
|
+
'no-channel-trailing-slash': 'off',
|
|
105
183
|
'operation-operationId': 'warn',
|
|
106
184
|
'tag-description': 'warn',
|
|
107
185
|
'tags-alphabetical': 'off',
|
|
108
|
-
'channels-kebab-case': 'off',
|
|
109
|
-
'no-channel-trailing-slash': 'off',
|
|
110
186
|
},
|
|
111
|
-
|
|
112
|
-
|
|
187
|
+
arazzo1Rules: {
|
|
188
|
+
'criteria-unique': 'off',
|
|
189
|
+
'no-criteria-xpath': 'off',
|
|
190
|
+
'no-actions-type-end': 'off',
|
|
113
191
|
'parameters-not-in-body': 'off',
|
|
192
|
+
'parameters-unique': 'off',
|
|
193
|
+
'requestBody-replacements-unique': 'off',
|
|
114
194
|
'sourceDescription-type': 'off',
|
|
115
|
-
'
|
|
116
|
-
'
|
|
195
|
+
'sourceDescriptions-not-empty': 'off',
|
|
196
|
+
'step-onSuccess-unique': 'off',
|
|
197
|
+
'step-onFailure-unique': 'off',
|
|
117
198
|
'stepId-unique': 'error',
|
|
118
199
|
'sourceDescription-name-unique': 'off',
|
|
200
|
+
'version-enum': 'off',
|
|
201
|
+
'workflowId-unique': 'error',
|
|
119
202
|
'workflow-dependsOn': 'off',
|
|
120
|
-
'parameters-unique': 'off',
|
|
121
|
-
'step-onSuccess-unique': 'off',
|
|
122
|
-
'step-onFailure-unique': 'off',
|
|
123
|
-
'requestBody-replacements-unique': 'off',
|
|
124
|
-
'no-criteria-xpath': 'off',
|
|
125
|
-
'no-actions-type-end': 'off',
|
|
126
|
-
'criteria-unique': 'off',
|
|
127
203
|
},
|
|
128
204
|
};
|
|
129
205
|
|
|
@@ -2,54 +2,70 @@ import type { PluginStyleguideConfig } from './types';
|
|
|
2
2
|
|
|
3
3
|
const recommendedStrict: PluginStyleguideConfig<'built-in'> = {
|
|
4
4
|
rules: {
|
|
5
|
+
struct: 'error',
|
|
6
|
+
},
|
|
7
|
+
oas2Rules: {
|
|
8
|
+
'boolean-parameter-prefixes': 'off',
|
|
5
9
|
'info-contact': 'off',
|
|
6
10
|
'info-license': 'error',
|
|
7
11
|
'info-license-url': 'off',
|
|
8
12
|
'info-license-strict': 'error',
|
|
9
|
-
'tag-description': 'error',
|
|
10
|
-
'tags-alphabetical': 'off',
|
|
11
|
-
'parameter-description': 'off',
|
|
12
13
|
'no-path-trailing-slash': 'error',
|
|
13
14
|
'no-identical-paths': 'error',
|
|
14
15
|
'no-ambiguous-paths': 'error',
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'operation-operationId': 'error',
|
|
16
|
+
'no-invalid-schema-examples': 'off',
|
|
17
|
+
'no-invalid-parameter-examples': 'off',
|
|
18
|
+
'no-http-verbs-in-paths': 'off',
|
|
19
|
+
'no-enum-type-mismatch': 'error',
|
|
20
|
+
'no-unresolved-refs': 'error',
|
|
21
|
+
'no-required-schema-properties-undefined': 'off',
|
|
22
22
|
'operation-summary': 'error',
|
|
23
|
+
'operation-operationId': 'error',
|
|
23
24
|
'operation-operationId-unique': 'error',
|
|
24
25
|
'operation-operationId-url-safe': 'error',
|
|
26
|
+
'operation-description': 'off',
|
|
27
|
+
'operation-2xx-response': 'error',
|
|
28
|
+
'operation-4xx-response': 'error',
|
|
25
29
|
'operation-parameters-unique': 'error',
|
|
26
30
|
'operation-tag-defined': 'off',
|
|
27
|
-
'security-defined': 'error',
|
|
28
31
|
'operation-singular-tag': 'off',
|
|
29
|
-
'
|
|
30
|
-
'
|
|
32
|
+
'parameter-description': 'off',
|
|
33
|
+
'path-declaration-must-exist': 'error',
|
|
34
|
+
'path-not-include-query': 'error',
|
|
35
|
+
'path-parameters-defined': 'error',
|
|
31
36
|
'paths-kebab-case': 'off',
|
|
32
|
-
spec: 'error',
|
|
33
|
-
'spec-strict-refs': 'off',
|
|
34
|
-
'no-http-verbs-in-paths': 'off',
|
|
35
|
-
'no-invalid-parameter-examples': 'off',
|
|
36
|
-
'no-invalid-schema-examples': 'off',
|
|
37
37
|
'path-excludes-patterns': 'off',
|
|
38
38
|
'path-http-verbs-order': 'off',
|
|
39
39
|
'path-params-defined': 'off',
|
|
40
40
|
'path-segment-plural': 'off',
|
|
41
41
|
'required-string-property-missing-min-length': 'off',
|
|
42
42
|
'response-contains-header': 'off',
|
|
43
|
-
'scalar-property-missing-example': 'off',
|
|
44
|
-
'no-required-schema-properties-undefined': 'off',
|
|
45
|
-
},
|
|
46
|
-
oas2Rules: {
|
|
47
|
-
'boolean-parameter-prefixes': 'off',
|
|
48
43
|
'request-mime-type': 'off',
|
|
49
44
|
'response-contains-property': 'off',
|
|
50
45
|
'response-mime-type': 'off',
|
|
46
|
+
'security-defined': 'error',
|
|
47
|
+
'spec-strict-refs': 'off',
|
|
48
|
+
'scalar-property-missing-example': 'off',
|
|
49
|
+
'tag-description': 'error',
|
|
50
|
+
'tags-alphabetical': 'off',
|
|
51
51
|
},
|
|
52
52
|
oas3_0Rules: {
|
|
53
|
+
'array-parameter-serialization': 'off',
|
|
54
|
+
'boolean-parameter-prefixes': 'off',
|
|
55
|
+
'component-name-unique': 'off',
|
|
56
|
+
'info-contact': 'off',
|
|
57
|
+
'info-license': 'error',
|
|
58
|
+
'info-license-url': 'off',
|
|
59
|
+
'info-license-strict': 'error',
|
|
60
|
+
'no-path-trailing-slash': 'error',
|
|
61
|
+
'no-identical-paths': 'error',
|
|
62
|
+
'no-ambiguous-paths': 'error',
|
|
63
|
+
'no-invalid-schema-examples': 'off',
|
|
64
|
+
'no-invalid-parameter-examples': 'off',
|
|
65
|
+
'no-http-verbs-in-paths': 'off',
|
|
66
|
+
'no-enum-type-mismatch': 'error',
|
|
67
|
+
'no-unresolved-refs': 'error',
|
|
68
|
+
'no-required-schema-properties-undefined': 'off',
|
|
53
69
|
'no-invalid-media-type-examples': {
|
|
54
70
|
severity: 'error',
|
|
55
71
|
allowAdditionalProperties: false,
|
|
@@ -61,16 +77,55 @@ const recommendedStrict: PluginStyleguideConfig<'built-in'> = {
|
|
|
61
77
|
'no-unused-components': 'error',
|
|
62
78
|
'no-undefined-server-variable': 'error',
|
|
63
79
|
'no-server-variables-empty-enum': 'error',
|
|
64
|
-
'
|
|
65
|
-
'
|
|
66
|
-
'
|
|
80
|
+
'operation-summary': 'error',
|
|
81
|
+
'operation-operationId': 'error',
|
|
82
|
+
'operation-operationId-unique': 'error',
|
|
83
|
+
'operation-operationId-url-safe': 'error',
|
|
84
|
+
'operation-description': 'off',
|
|
85
|
+
'operation-2xx-response': 'error',
|
|
86
|
+
'operation-4xx-response': 'error',
|
|
67
87
|
'operation-4xx-problem-details-rfc7807': 'off',
|
|
88
|
+
'operation-parameters-unique': 'error',
|
|
89
|
+
'operation-tag-defined': 'off',
|
|
90
|
+
'operation-singular-tag': 'off',
|
|
91
|
+
'parameter-description': 'off',
|
|
92
|
+
'path-declaration-must-exist': 'error',
|
|
93
|
+
'path-not-include-query': 'error',
|
|
94
|
+
'path-parameters-defined': 'error',
|
|
95
|
+
'paths-kebab-case': 'off',
|
|
96
|
+
'path-excludes-patterns': 'off',
|
|
97
|
+
'path-http-verbs-order': 'off',
|
|
98
|
+
'path-params-defined': 'off',
|
|
99
|
+
'path-segment-plural': 'off',
|
|
100
|
+
'required-string-property-missing-min-length': 'off',
|
|
101
|
+
'response-contains-header': 'off',
|
|
68
102
|
'request-mime-type': 'off',
|
|
69
103
|
'response-contains-property': 'off',
|
|
70
104
|
'response-mime-type': 'off',
|
|
71
|
-
'
|
|
105
|
+
'security-defined': 'error',
|
|
106
|
+
'spec-strict-refs': 'off',
|
|
107
|
+
'scalar-property-missing-example': 'off',
|
|
108
|
+
'spec-components-invalid-map-name': 'error',
|
|
109
|
+
'tag-description': 'error',
|
|
110
|
+
'tags-alphabetical': 'off',
|
|
72
111
|
},
|
|
73
112
|
oas3_1Rules: {
|
|
113
|
+
'array-parameter-serialization': 'off',
|
|
114
|
+
'boolean-parameter-prefixes': 'off',
|
|
115
|
+
'component-name-unique': 'off',
|
|
116
|
+
'info-contact': 'off',
|
|
117
|
+
'info-license': 'error',
|
|
118
|
+
'info-license-url': 'off',
|
|
119
|
+
'info-license-strict': 'error',
|
|
120
|
+
'no-path-trailing-slash': 'error',
|
|
121
|
+
'no-identical-paths': 'error',
|
|
122
|
+
'no-ambiguous-paths': 'error',
|
|
123
|
+
'no-invalid-schema-examples': 'off',
|
|
124
|
+
'no-invalid-parameter-examples': 'off',
|
|
125
|
+
'no-http-verbs-in-paths': 'off',
|
|
126
|
+
'no-enum-type-mismatch': 'error',
|
|
127
|
+
'no-unresolved-refs': 'error',
|
|
128
|
+
'no-required-schema-properties-undefined': 'off',
|
|
74
129
|
'no-invalid-media-type-examples': 'error',
|
|
75
130
|
'no-server-example.com': 'error',
|
|
76
131
|
'no-server-trailing-slash': 'error',
|
|
@@ -79,51 +134,72 @@ const recommendedStrict: PluginStyleguideConfig<'built-in'> = {
|
|
|
79
134
|
'no-unused-components': 'error',
|
|
80
135
|
'no-undefined-server-variable': 'error',
|
|
81
136
|
'no-server-variables-empty-enum': 'error',
|
|
82
|
-
'
|
|
83
|
-
'
|
|
84
|
-
'
|
|
137
|
+
'operation-summary': 'error',
|
|
138
|
+
'operation-operationId': 'error',
|
|
139
|
+
'operation-operationId-unique': 'error',
|
|
140
|
+
'operation-operationId-url-safe': 'error',
|
|
141
|
+
'operation-description': 'off',
|
|
142
|
+
'operation-2xx-response': 'error',
|
|
143
|
+
'operation-4xx-response': 'error',
|
|
85
144
|
'operation-4xx-problem-details-rfc7807': 'off',
|
|
145
|
+
'operation-parameters-unique': 'error',
|
|
146
|
+
'operation-tag-defined': 'off',
|
|
147
|
+
'operation-singular-tag': 'off',
|
|
148
|
+
'parameter-description': 'off',
|
|
149
|
+
'path-declaration-must-exist': 'error',
|
|
150
|
+
'path-not-include-query': 'error',
|
|
151
|
+
'path-parameters-defined': 'error',
|
|
152
|
+
'paths-kebab-case': 'off',
|
|
153
|
+
'path-excludes-patterns': 'off',
|
|
154
|
+
'path-http-verbs-order': 'off',
|
|
155
|
+
'path-params-defined': 'off',
|
|
156
|
+
'path-segment-plural': 'off',
|
|
157
|
+
'required-string-property-missing-min-length': 'off',
|
|
158
|
+
'response-contains-header': 'off',
|
|
86
159
|
'request-mime-type': 'off',
|
|
87
160
|
'response-contains-property': 'off',
|
|
88
161
|
'response-mime-type': 'off',
|
|
89
|
-
'
|
|
162
|
+
'security-defined': 'error',
|
|
163
|
+
'spec-strict-refs': 'off',
|
|
164
|
+
'scalar-property-missing-example': 'off',
|
|
165
|
+
'spec-components-invalid-map-name': 'error',
|
|
166
|
+
'tag-description': 'error',
|
|
167
|
+
'tags-alphabetical': 'off',
|
|
90
168
|
},
|
|
91
169
|
async2Rules: {
|
|
92
|
-
|
|
170
|
+
'channels-kebab-case': 'off',
|
|
93
171
|
'info-contact': 'off',
|
|
94
172
|
'info-license-strict': 'error',
|
|
173
|
+
'no-channel-trailing-slash': 'off',
|
|
95
174
|
'operation-operationId': 'error',
|
|
96
175
|
'tag-description': 'error',
|
|
97
176
|
'tags-alphabetical': 'off',
|
|
98
|
-
'channels-kebab-case': 'off',
|
|
99
|
-
'no-channel-trailing-slash': 'off',
|
|
100
177
|
},
|
|
101
178
|
async3Rules: {
|
|
102
|
-
|
|
179
|
+
'channels-kebab-case': 'off',
|
|
103
180
|
'info-contact': 'off',
|
|
104
181
|
'info-license-strict': 'error',
|
|
182
|
+
'no-channel-trailing-slash': 'off',
|
|
105
183
|
'operation-operationId': 'error',
|
|
106
184
|
'tag-description': 'error',
|
|
107
185
|
'tags-alphabetical': 'off',
|
|
108
|
-
'channels-kebab-case': 'off',
|
|
109
|
-
'no-channel-trailing-slash': 'off',
|
|
110
186
|
},
|
|
111
|
-
|
|
112
|
-
|
|
187
|
+
arazzo1Rules: {
|
|
188
|
+
'criteria-unique': 'error',
|
|
189
|
+
'no-criteria-xpath': 'error',
|
|
190
|
+
'no-actions-type-end': 'error',
|
|
113
191
|
'parameters-not-in-body': 'error',
|
|
192
|
+
'parameters-unique': 'error',
|
|
193
|
+
'requestBody-replacements-unique': 'error',
|
|
114
194
|
'sourceDescription-type': 'error',
|
|
115
|
-
'
|
|
116
|
-
'
|
|
195
|
+
'step-onSuccess-unique': 'error',
|
|
196
|
+
'step-onFailure-unique': 'error',
|
|
117
197
|
'stepId-unique': 'error',
|
|
118
198
|
'sourceDescription-name-unique': 'error',
|
|
199
|
+
'sourceDescriptions-not-empty': 'error',
|
|
200
|
+
'version-enum': 'error',
|
|
201
|
+
'workflowId-unique': 'error',
|
|
119
202
|
'workflow-dependsOn': 'error',
|
|
120
|
-
'parameters-unique': 'error',
|
|
121
|
-
'step-onSuccess-unique': 'error',
|
|
122
|
-
'step-onFailure-unique': 'error',
|
|
123
|
-
'requestBody-replacements-unique': 'error',
|
|
124
|
-
'no-criteria-xpath': 'error',
|
|
125
|
-
'no-actions-type-end': 'error',
|
|
126
|
-
'criteria-unique': 'error',
|
|
127
203
|
},
|
|
128
204
|
};
|
|
129
205
|
|