@redocly/openapi-core 1.25.15 → 1.26.1

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.
Files changed (128) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/__tests__/utils.ts +0 -3
  3. package/lib/bundle.js +3 -3
  4. package/lib/config/all.js +129 -48
  5. package/lib/config/builtIn.d.ts +1 -1
  6. package/lib/config/builtIn.js +5 -3
  7. package/lib/config/config-resolvers.d.ts +3 -1
  8. package/lib/config/config-resolvers.js +16 -14
  9. package/lib/config/config.d.ts +2 -2
  10. package/lib/config/config.js +38 -20
  11. package/lib/config/minimal.js +124 -49
  12. package/lib/config/recommended-strict.js +123 -48
  13. package/lib/config/recommended.js +122 -47
  14. package/lib/config/rules.d.ts +2 -2
  15. package/lib/config/spec.d.ts +3 -0
  16. package/lib/config/spec.js +30 -0
  17. package/lib/config/types.d.ts +23 -23
  18. package/lib/config/utils.d.ts +1 -1
  19. package/lib/config/utils.js +33 -23
  20. package/lib/index.d.ts +1 -1
  21. package/lib/index.js +2 -2
  22. package/lib/lint.js +3 -3
  23. package/lib/oas-types.d.ts +11 -11
  24. package/lib/oas-types.js +6 -6
  25. package/lib/rules/arazzo/criteria-unique.d.ts +2 -2
  26. package/lib/rules/arazzo/index.d.ts +2 -2
  27. package/lib/rules/arazzo/index.js +6 -6
  28. package/lib/rules/arazzo/parameters-unique.d.ts +2 -2
  29. package/lib/rules/arazzo/requestBody-replacements-unique.d.ts +2 -2
  30. package/lib/rules/arazzo/sourceDescription-type.d.ts +2 -0
  31. package/lib/rules/arazzo/{source-description-type.js → sourceDescription-type.js} +5 -3
  32. package/lib/rules/arazzo/sourceDescriptions-name-unique.d.ts +2 -2
  33. package/lib/rules/arazzo/sourceDescriptions-not-empty.d.ts +2 -0
  34. package/lib/rules/arazzo/sourceDescriptions-not-empty.js +18 -0
  35. package/lib/rules/arazzo/step-onFailure-unique.d.ts +2 -2
  36. package/lib/rules/arazzo/step-onSuccess-unique.d.ts +2 -2
  37. package/lib/rules/arazzo/stepId-unique.d.ts +2 -2
  38. package/lib/rules/arazzo/workflow-dependsOn.d.ts +2 -2
  39. package/lib/rules/arazzo/workflowId-unique.d.ts +2 -2
  40. package/lib/rules/async2/index.js +5 -2
  41. package/lib/rules/async3/index.js +5 -2
  42. package/lib/rules/common/assertions/index.d.ts +2 -2
  43. package/lib/rules/common/struct.d.ts +2 -0
  44. package/lib/rules/common/{spec.js → struct.js} +3 -3
  45. package/lib/rules/oas2/index.js +5 -2
  46. package/lib/rules/oas3/index.js +5 -2
  47. package/lib/rules/spot/no-criteria-xpath.d.ts +2 -2
  48. package/lib/rules/spot/parameters-not-in-body.d.ts +2 -2
  49. package/lib/rules/spot/version-enum.d.ts +2 -2
  50. package/lib/types/arazzo.d.ts +1 -1
  51. package/lib/types/arazzo.js +3 -16
  52. package/lib/types/redocly-yaml.d.ts +6 -8
  53. package/lib/types/redocly-yaml.js +47 -13
  54. package/lib/typings/arazzo.d.ts +1 -6
  55. package/lib/utils.d.ts +1 -1
  56. package/lib/utils.js +3 -2
  57. package/lib/visitors.d.ts +5 -6
  58. package/package.json +1 -3
  59. package/src/__tests__/lint.test.ts +3 -3
  60. package/src/bundle.ts +3 -3
  61. package/src/config/__tests__/__snapshots__/config-resolvers.test.ts.snap +228 -72
  62. package/src/config/__tests__/__snapshots__/config.test.ts.snap +16 -3
  63. package/src/config/__tests__/config-resolvers.test.ts +14 -2
  64. package/src/config/__tests__/config.test.ts +11 -6
  65. package/src/config/all.ts +129 -48
  66. package/src/config/builtIn.ts +10 -8
  67. package/src/config/config-resolvers.ts +37 -45
  68. package/src/config/config.ts +46 -22
  69. package/src/config/minimal.ts +124 -49
  70. package/src/config/recommended-strict.ts +123 -48
  71. package/src/config/recommended.ts +122 -47
  72. package/src/config/rules.ts +2 -2
  73. package/src/config/spec.ts +31 -0
  74. package/src/config/types.ts +27 -33
  75. package/src/config/utils.ts +38 -26
  76. package/src/index.ts +1 -1
  77. package/src/lint.ts +6 -6
  78. package/src/oas-types.ts +19 -20
  79. package/src/rules/arazzo/__tests__/criteria-unique.test.ts +1 -2
  80. package/src/rules/arazzo/__tests__/no-criteria-xpath.test.ts +1 -2
  81. package/src/rules/arazzo/__tests__/parameters-not-in-body.test.ts +1 -2
  82. package/src/rules/arazzo/__tests__/parameters-unique.test.ts +1 -2
  83. package/src/rules/arazzo/__tests__/requestBody-replacements-unique.test.ts +1 -2
  84. package/src/rules/arazzo/__tests__/source-description-type.test.ts +2 -4
  85. package/src/rules/arazzo/__tests__/sourceDescription-name-unique.test.ts +1 -2
  86. package/src/rules/arazzo/__tests__/sourceDescriptions-not-empty.test.ts +104 -0
  87. package/src/rules/arazzo/__tests__/step-onFailure-unique.test.ts +1 -2
  88. package/src/rules/arazzo/__tests__/step-onSuccess-unique.test.ts +1 -2
  89. package/src/rules/arazzo/__tests__/stepId-unique.test.ts +1 -2
  90. package/src/rules/arazzo/__tests__/version-enum.test.ts +1 -2
  91. package/src/rules/arazzo/__tests__/workflow-dependsOn.test.ts +3 -6
  92. package/src/rules/arazzo/__tests__/workflowId-unique.test.ts +2 -4
  93. package/src/rules/arazzo/criteria-unique.ts +2 -2
  94. package/src/rules/arazzo/index.ts +22 -22
  95. package/src/rules/arazzo/parameters-unique.ts +2 -2
  96. package/src/rules/arazzo/requestBody-replacements-unique.ts +2 -2
  97. package/src/rules/arazzo/{source-description-type.ts → sourceDescription-type.ts} +6 -5
  98. package/src/rules/arazzo/sourceDescriptions-name-unique.ts +2 -2
  99. package/src/rules/arazzo/sourceDescriptions-not-empty.ts +17 -0
  100. package/src/rules/arazzo/step-onFailure-unique.ts +2 -2
  101. package/src/rules/arazzo/step-onSuccess-unique.ts +2 -2
  102. package/src/rules/arazzo/stepId-unique.ts +2 -2
  103. package/src/rules/arazzo/workflow-dependsOn.ts +2 -2
  104. package/src/rules/arazzo/workflowId-unique.ts +2 -2
  105. package/src/rules/async2/index.ts +5 -2
  106. package/src/rules/async3/index.ts +5 -2
  107. package/src/rules/common/__tests__/no-enum-type-mismatch.test.ts +1 -1
  108. package/src/rules/common/__tests__/{spec.test.ts → struct.test.ts} +35 -35
  109. package/src/rules/common/assertions/index.ts +2 -2
  110. package/src/rules/common/{spec.ts → struct.ts} +2 -2
  111. package/src/rules/oas2/index.ts +5 -2
  112. package/src/rules/oas3/__tests__/spec/spec.test.ts +10 -10
  113. package/src/rules/oas3/index.ts +5 -2
  114. package/src/rules/spot/no-criteria-xpath.ts +2 -2
  115. package/src/rules/spot/parameters-not-in-body.ts +2 -2
  116. package/src/rules/spot/version-enum.ts +2 -2
  117. package/src/types/arazzo.ts +2 -14
  118. package/src/types/redocly-yaml.ts +48 -17
  119. package/src/typings/arazzo.ts +1 -10
  120. package/src/utils.ts +4 -2
  121. package/src/visitors.ts +4 -6
  122. package/tsconfig.tsbuildinfo +1 -1
  123. package/lib/rules/arazzo/source-description-type.d.ts +0 -2
  124. package/lib/rules/common/spec.d.ts +0 -2
  125. package/lib/rules/spot/no-actions-type-end.d.ts +0 -2
  126. package/lib/rules/spot/no-actions-type-end.js +0 -28
  127. package/src/rules/arazzo/__tests__/no-actions-type-end.test.ts +0 -122
  128. package/src/rules/spot/no-actions-type-end.ts +0 -27
@@ -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
- ArazzoRuleSet,
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.Arazzo]: {
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.Arazzo]: { ...rawConfig.arazzoPreprocessors },
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.Arazzo]: { ...rawConfig.arazzoDecorators },
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.Arazzo:
196
- if (!plugin.typeExtension.arazzo) continue;
197
- extendedTypes = plugin.typeExtension.arazzo(extendedTypes, version);
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
- getRulesForOasVersion(version: SpecMajorVersion) {
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[] = []; // default ruleset
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[] = []; // default ruleset
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[] = []; // default ruleset
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[] = []; // default ruleset
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.Arazzo:
320
+ case SpecMajorVersion.Arazzo1:
310
321
  // eslint-disable-next-line no-case-declarations
311
- const arazzoRules: ArazzoRuleSet[] = []; // default ruleset
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.preprocessors?.arazzo && arazzoRules.push(p.preprocessors.arazzo)
328
+ (p) => p.decorators?.arazzo1 && arazzo1Rules.push(p.decorators.arazzo1)
314
329
  );
315
- this.plugins.forEach((p) => p.rules?.arazzo && arazzoRules.push(p.rules.arazzo));
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;
@@ -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
- 'path-declaration-must-exist': 'warn',
16
- 'path-not-include-query': 'warn',
17
- 'path-parameters-defined': 'warn',
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
- 'no-unresolved-refs': 'error',
30
- 'no-enum-type-mismatch': 'warn',
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
- 'spec-components-invalid-map-name': 'warn',
65
- 'boolean-parameter-prefixes': 'off',
66
- 'component-name-unique': 'off',
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
- 'array-parameter-serialization': 'off',
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,71 @@ 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
- 'spec-components-invalid-map-name': 'warn',
83
- 'boolean-parameter-prefixes': 'off',
84
- 'component-name-unique': 'off',
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
- 'array-parameter-serialization': 'off',
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
- spec: 'error',
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
- spec: 'error',
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
- arazzoRules: {
112
- spec: 'error',
187
+ arazzo1Rules: {
188
+ 'criteria-unique': 'off',
189
+ 'no-criteria-xpath': 'off',
113
190
  'parameters-not-in-body': 'off',
191
+ 'parameters-unique': 'off',
192
+ 'requestBody-replacements-unique': 'off',
114
193
  'sourceDescription-type': 'off',
115
- 'version-enum': 'warn',
116
- 'workflowId-unique': 'error',
194
+ 'sourceDescriptions-not-empty': 'off',
195
+ 'step-onSuccess-unique': 'off',
196
+ 'step-onFailure-unique': 'off',
117
197
  'stepId-unique': 'error',
118
198
  'sourceDescription-name-unique': 'off',
199
+ 'version-enum': 'off',
200
+ 'workflowId-unique': 'error',
119
201
  '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
202
  },
128
203
  };
129
204
 
@@ -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
- 'path-declaration-must-exist': 'error',
16
- 'path-not-include-query': 'error',
17
- 'path-parameters-defined': 'error',
18
- 'operation-description': 'off',
19
- 'operation-2xx-response': 'error',
20
- 'operation-4xx-response': 'error',
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
- 'no-unresolved-refs': 'error',
30
- 'no-enum-type-mismatch': 'error',
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
- 'spec-components-invalid-map-name': 'error',
65
- 'boolean-parameter-prefixes': 'off',
66
- 'component-name-unique': 'off',
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
- 'array-parameter-serialization': 'off',
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,71 @@ 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
- 'spec-components-invalid-map-name': 'error',
83
- 'boolean-parameter-prefixes': 'off',
84
- 'component-name-unique': 'off',
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
- 'array-parameter-serialization': 'off',
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
- spec: 'error',
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
- spec: 'error',
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
- arazzoRules: {
112
- spec: 'error',
187
+ arazzo1Rules: {
188
+ 'criteria-unique': 'error',
189
+ 'no-criteria-xpath': 'error',
113
190
  'parameters-not-in-body': 'error',
191
+ 'parameters-unique': 'error',
192
+ 'requestBody-replacements-unique': 'error',
114
193
  'sourceDescription-type': 'error',
115
- 'version-enum': 'error',
116
- 'workflowId-unique': 'error',
194
+ 'step-onSuccess-unique': 'error',
195
+ 'step-onFailure-unique': 'error',
117
196
  'stepId-unique': 'error',
118
197
  'sourceDescription-name-unique': 'error',
198
+ 'sourceDescriptions-not-empty': 'error',
199
+ 'version-enum': 'error',
200
+ 'workflowId-unique': 'error',
119
201
  '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
202
  },
128
203
  };
129
204