@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.
Files changed (126) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/__tests__/utils.ts +0 -3
  3. package/lib/bundle.js +3 -3
  4. package/lib/config/all.js +130 -48
  5. package/lib/config/builtIn.d.ts +1 -1
  6. package/lib/config/builtIn.js +5 -3
  7. package/lib/config/config-resolvers.js +9 -9
  8. package/lib/config/config.d.ts +2 -2
  9. package/lib/config/config.js +38 -20
  10. package/lib/config/minimal.js +125 -49
  11. package/lib/config/recommended-strict.js +124 -48
  12. package/lib/config/recommended.js +123 -47
  13. package/lib/config/rules.d.ts +2 -2
  14. package/lib/config/spec.d.ts +3 -0
  15. package/lib/config/spec.js +31 -0
  16. package/lib/config/types.d.ts +23 -23
  17. package/lib/config/utils.d.ts +1 -1
  18. package/lib/config/utils.js +33 -23
  19. package/lib/index.d.ts +1 -1
  20. package/lib/index.js +2 -2
  21. package/lib/lint.js +3 -3
  22. package/lib/oas-types.d.ts +11 -11
  23. package/lib/oas-types.js +6 -6
  24. package/lib/rules/arazzo/criteria-unique.d.ts +2 -2
  25. package/lib/rules/arazzo/index.d.ts +2 -2
  26. package/lib/rules/arazzo/index.js +6 -4
  27. package/lib/rules/arazzo/parameters-unique.d.ts +2 -2
  28. package/lib/rules/arazzo/requestBody-replacements-unique.d.ts +2 -2
  29. package/lib/rules/arazzo/sourceDescription-type.d.ts +2 -0
  30. package/lib/rules/arazzo/{source-description-type.js → sourceDescription-type.js} +5 -3
  31. package/lib/rules/arazzo/sourceDescriptions-name-unique.d.ts +2 -2
  32. package/lib/rules/arazzo/sourceDescriptions-not-empty.d.ts +2 -0
  33. package/lib/rules/arazzo/sourceDescriptions-not-empty.js +18 -0
  34. package/lib/rules/arazzo/step-onFailure-unique.d.ts +2 -2
  35. package/lib/rules/arazzo/step-onSuccess-unique.d.ts +2 -2
  36. package/lib/rules/arazzo/stepId-unique.d.ts +2 -2
  37. package/lib/rules/arazzo/workflow-dependsOn.d.ts +2 -2
  38. package/lib/rules/arazzo/workflowId-unique.d.ts +2 -2
  39. package/lib/rules/async2/index.js +5 -2
  40. package/lib/rules/async3/index.js +5 -2
  41. package/lib/rules/common/assertions/index.d.ts +2 -2
  42. package/lib/rules/common/struct.d.ts +2 -0
  43. package/lib/rules/common/{spec.js → struct.js} +3 -3
  44. package/lib/rules/oas2/index.js +5 -2
  45. package/lib/rules/oas3/index.js +5 -2
  46. package/lib/rules/spot/no-actions-type-end.d.ts +2 -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 -12
  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 -1
  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 -70
  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 +130 -48
  66. package/src/config/builtIn.ts +10 -8
  67. package/src/config/config-resolvers.ts +9 -9
  68. package/src/config/config.ts +46 -22
  69. package/src/config/minimal.ts +125 -49
  70. package/src/config/recommended-strict.ts +124 -48
  71. package/src/config/recommended.ts +123 -47
  72. package/src/config/rules.ts +2 -2
  73. package/src/config/spec.ts +32 -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-actions-type-end.test.ts +1 -2
  81. package/src/rules/arazzo/__tests__/no-criteria-xpath.test.ts +1 -2
  82. package/src/rules/arazzo/__tests__/parameters-not-in-body.test.ts +1 -2
  83. package/src/rules/arazzo/__tests__/parameters-unique.test.ts +1 -2
  84. package/src/rules/arazzo/__tests__/requestBody-replacements-unique.test.ts +1 -2
  85. package/src/rules/arazzo/__tests__/source-description-type.test.ts +2 -4
  86. package/src/rules/arazzo/__tests__/sourceDescription-name-unique.test.ts +1 -2
  87. package/src/rules/arazzo/__tests__/sourceDescriptions-not-empty.test.ts +104 -0
  88. package/src/rules/arazzo/__tests__/step-onFailure-unique.test.ts +1 -2
  89. package/src/rules/arazzo/__tests__/step-onSuccess-unique.test.ts +1 -2
  90. package/src/rules/arazzo/__tests__/stepId-unique.test.ts +1 -2
  91. package/src/rules/arazzo/__tests__/version-enum.test.ts +1 -2
  92. package/src/rules/arazzo/__tests__/workflow-dependsOn.test.ts +3 -6
  93. package/src/rules/arazzo/__tests__/workflowId-unique.test.ts +2 -4
  94. package/src/rules/arazzo/criteria-unique.ts +2 -2
  95. package/src/rules/arazzo/index.ts +23 -21
  96. package/src/rules/arazzo/parameters-unique.ts +2 -2
  97. package/src/rules/arazzo/requestBody-replacements-unique.ts +2 -2
  98. package/src/rules/arazzo/{source-description-type.ts → sourceDescription-type.ts} +6 -5
  99. package/src/rules/arazzo/sourceDescriptions-name-unique.ts +2 -2
  100. package/src/rules/arazzo/sourceDescriptions-not-empty.ts +17 -0
  101. package/src/rules/arazzo/step-onFailure-unique.ts +2 -2
  102. package/src/rules/arazzo/step-onSuccess-unique.ts +2 -2
  103. package/src/rules/arazzo/stepId-unique.ts +2 -2
  104. package/src/rules/arazzo/workflow-dependsOn.ts +2 -2
  105. package/src/rules/arazzo/workflowId-unique.ts +2 -2
  106. package/src/rules/async2/index.ts +5 -2
  107. package/src/rules/async3/index.ts +5 -2
  108. package/src/rules/common/__tests__/no-enum-type-mismatch.test.ts +1 -1
  109. package/src/rules/common/__tests__/{spec.test.ts → struct.test.ts} +35 -35
  110. package/src/rules/common/assertions/index.ts +2 -2
  111. package/src/rules/common/{spec.ts → struct.ts} +2 -2
  112. package/src/rules/oas2/index.ts +5 -2
  113. package/src/rules/oas3/__tests__/spec/spec.test.ts +10 -10
  114. package/src/rules/oas3/index.ts +5 -2
  115. package/src/rules/spot/no-actions-type-end.ts +2 -2
  116. package/src/rules/spot/no-criteria-xpath.ts +2 -2
  117. package/src/rules/spot/parameters-not-in-body.ts +2 -2
  118. package/src/rules/spot/version-enum.ts +2 -2
  119. package/src/types/arazzo.ts +2 -14
  120. package/src/types/redocly-yaml.ts +48 -16
  121. package/src/typings/arazzo.ts +1 -10
  122. package/src/utils.ts +4 -2
  123. package/src/visitors.ts +4 -6
  124. package/tsconfig.tsbuildinfo +1 -1
  125. package/lib/rules/arazzo/source-description-type.d.ts +0 -2
  126. package/lib/rules/common/spec.d.ts +0 -2
@@ -10,17 +10,12 @@ export interface OpenAPISourceDescription {
10
10
  url: string;
11
11
  'x-serverUrl'?: string;
12
12
  }
13
- export interface NoneSourceDescription {
14
- name: string;
15
- type: 'none';
16
- 'x-serverUrl': string;
17
- }
18
13
  export interface ArazzoSourceDescription {
19
14
  name: string;
20
15
  type: 'arazzo';
21
16
  url: string;
22
17
  }
23
- export type SourceDescription = OpenAPISourceDescription | NoneSourceDescription | ArazzoSourceDescription;
18
+ export type SourceDescription = OpenAPISourceDescription | ArazzoSourceDescription;
24
19
  export interface Parameter {
25
20
  in?: 'header' | 'query' | 'path' | 'cookie' | 'body';
26
21
  name: string;
package/lib/utils.d.ts CHANGED
@@ -49,7 +49,7 @@ export declare function assignOnlyExistingConfig<T extends string | {
49
49
  export declare function getMatchingStatusCodeRange(code: number | string): string;
50
50
  export declare function isCustomRuleId(id: string): boolean;
51
51
  export declare function doesYamlFileExist(filePath: string): boolean;
52
- export declare function showWarningForDeprecatedField(deprecatedField: string, updatedField?: string, updatedObject?: string): void;
52
+ export declare function showWarningForDeprecatedField(deprecatedField: string, updatedField?: string, updatedObject?: string, link?: string): void;
53
53
  export declare function showErrorForDeprecatedField(deprecatedField: string, updatedField?: string, updatedObject?: string): void;
54
54
  export type Falsy = undefined | null | false | '' | 0;
55
55
  export declare function isTruthy<Truthy>(value: Truthy | Falsy): value is Truthy;
package/lib/utils.js CHANGED
@@ -218,10 +218,11 @@ function doesYamlFileExist(filePath) {
218
218
  fs?.hasOwnProperty?.('existsSync') &&
219
219
  fs.existsSync(filePath));
220
220
  }
221
- function showWarningForDeprecatedField(deprecatedField, updatedField, updatedObject) {
221
+ function showWarningForDeprecatedField(deprecatedField, updatedField, updatedObject, link) {
222
+ const readMoreText = link ? `Read more about this change: ${link}` : '';
222
223
  logger_1.logger.warn(`The '${logger_1.colorize.red(deprecatedField)}' field is deprecated. ${updatedField
223
224
  ? `Use ${logger_1.colorize.green(getUpdatedFieldName(updatedField, updatedObject))} instead. `
224
- : ''}Read more about this change: https://redocly.com/docs/api-registry/guides/migration-guide-config-file/#changed-properties\n`);
225
+ : ''}${readMoreText}\n`);
225
226
  }
226
227
  function showErrorForDeprecatedField(deprecatedField, updatedField, updatedObject) {
227
228
  throw new Error(`Do not use '${deprecatedField}' field. ${updatedField ? `Use '${getUpdatedFieldName(updatedField, updatedObject)}' instead. ` : ''}\n`);
package/lib/visitors.d.ts CHANGED
@@ -6,7 +6,7 @@ import type { Oas3Definition, Oas3ExternalDocs, Oas3Info, Oas3Contact, Oas3Compo
6
6
  import type { Oas2Definition, Oas2Tag, Oas2ExternalDocs, Oas2SecurityRequirement, Oas2Info, Oas2Contact, Oas2License, Oas2PathItem, Oas2Operation, Oas2Header, Oas2Response, Oas2Schema, Oas2Xml, Oas2Parameter, Oas2SecurityScheme } from './typings/swagger';
7
7
  import type { Async2Definition } from './typings/asyncapi';
8
8
  import type { Async3Definition } from './typings/asyncapi3';
9
- import type { ArazzoDefinition, ArazzoSourceDescription, CriteriaObject, ExtendedOperation, InfoObject, NoneSourceDescription, OnFailureObject, OnSuccessObject, OpenAPISourceDescription, Parameter, Replacement, RequestBody, SourceDescription, Step, Workflow } from './typings/arazzo';
9
+ import type { ArazzoDefinition, ArazzoSourceDescription, CriteriaObject, ExtendedOperation, InfoObject, OnFailureObject, OnSuccessObject, OpenAPISourceDescription, Parameter, Replacement, RequestBody, SourceDescription, Step, Workflow } from './typings/arazzo';
10
10
  export type SkipFunctionContext = Pick<UserContext, 'location' | 'rawNode' | 'resolve' | 'rawLocation'>;
11
11
  export type VisitFunction<T> = (node: T, ctx: UserContext & {
12
12
  ignoreNextVisitorsOnNode: () => void;
@@ -149,7 +149,6 @@ type ArazzoFlatVisitor = {
149
149
  ParameterObject?: VisitFunctionOrObject<Parameter>;
150
150
  InfoObject?: VisitFunctionOrObject<InfoObject>;
151
151
  OpenAPISourceDescription?: VisitFunctionOrObject<OpenAPISourceDescription>;
152
- NoneSourceDescription?: VisitFunctionOrObject<NoneSourceDescription>;
153
152
  ArazzoSourceDescription?: VisitFunctionOrObject<ArazzoSourceDescription>;
154
153
  SourceDescription?: VisitFunctionOrObject<SourceDescription>;
155
154
  ExtendedOperation?: VisitFunctionOrObject<ExtendedOperation>;
@@ -182,7 +181,7 @@ export type Oas3Visitor = BaseVisitor & Oas3NestedVisitor & Record<string, Visit
182
181
  export type Oas2Visitor = BaseVisitor & Oas2NestedVisitor & Record<string, VisitFunction<any> | NestedVisitObject<any, Oas2NestedVisitor>>;
183
182
  export type Async2Visitor = BaseVisitor & Async2NestedVisitor & Record<string, VisitFunction<any> | NestedVisitObject<any, Async2NestedVisitor>>;
184
183
  export type Async3Visitor = BaseVisitor & Async3NestedVisitor & Record<string, VisitFunction<any> | NestedVisitObject<any, Async3NestedVisitor>>;
185
- export type ArazzoVisitor = BaseVisitor & ArazzoNestedVisitor & Record<string, VisitFunction<any> | NestedVisitObject<any, ArazzoNestedVisitor>>;
184
+ export type Arazzo1Visitor = BaseVisitor & ArazzoNestedVisitor & Record<string, VisitFunction<any> | NestedVisitObject<any, ArazzoNestedVisitor>>;
186
185
  export type NestedVisitor<T> = Exclude<T, 'any' | 'ref' | 'Root'>;
187
186
  export type NormalizedOasVisitors<T extends BaseVisitor> = {
188
187
  [V in keyof T]-?: {
@@ -203,17 +202,17 @@ export type Oas3Rule = (options: Record<string, any>) => Oas3Visitor | Oas3Visit
203
202
  export type Oas2Rule = (options: Record<string, any>) => Oas2Visitor | Oas2Visitor[];
204
203
  export type Async2Rule = (options: Record<string, any>) => Async2Visitor | Async2Visitor[];
205
204
  export type Async3Rule = (options: Record<string, any>) => Async3Visitor | Async3Visitor[];
206
- export type ArazzoRule = (options: Record<string, any>) => ArazzoVisitor | ArazzoVisitor[];
205
+ export type Arazzo1Rule = (options: Record<string, any>) => Arazzo1Visitor | Arazzo1Visitor[];
207
206
  export type Oas3Preprocessor = (options: Record<string, any>) => Oas3Visitor;
208
207
  export type Oas2Preprocessor = (options: Record<string, any>) => Oas2Visitor;
209
208
  export type Async2Preprocessor = (options: Record<string, any>) => Async2Visitor;
210
209
  export type Async3Preprocessor = (options: Record<string, any>) => Async3Visitor;
211
- export type ArazzoPreprocessor = (options: Record<string, any>) => ArazzoVisitor;
210
+ export type Arazzo1Preprocessor = (options: Record<string, any>) => Arazzo1Visitor;
212
211
  export type Oas3Decorator = (options: Record<string, any>) => Oas3Visitor;
213
212
  export type Oas2Decorator = (options: Record<string, any>) => Oas2Visitor;
214
213
  export type Async2Decorator = (options: Record<string, any>) => Async2Visitor;
215
214
  export type Async3Decorator = (options: Record<string, any>) => Async3Visitor;
216
- export type ArazzoDecorator = (options: Record<string, any>) => ArazzoVisitor;
215
+ export type Arazzo1Decorator = (options: Record<string, any>) => Arazzo1Visitor;
217
216
  export type OasRule = Oas3Rule;
218
217
  export type OasPreprocessor = Oas3Preprocessor;
219
218
  export type OasDecorator = Oas3Decorator;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/openapi-core",
3
- "version": "1.25.15",
3
+ "version": "1.26.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "engines": {
@@ -295,7 +295,7 @@ describe('lint', () => {
295
295
  },
296
296
  ],
297
297
  "message": "Expected type \`License\` (object) but got \`string\`",
298
- "ruleId": "spec",
298
+ "ruleId": "struct",
299
299
  "severity": "error",
300
300
  "suggest": [],
301
301
  },
@@ -324,7 +324,7 @@ describe('lint', () => {
324
324
  },
325
325
  ],
326
326
  "message": "Expected type \`License\` (object) but got \`string\`",
327
- "ruleId": "spec",
327
+ "ruleId": "struct",
328
328
  "severity": "error",
329
329
  "suggest": [],
330
330
  },
@@ -1611,7 +1611,7 @@ describe('lint', () => {
1611
1611
  },
1612
1612
  ],
1613
1613
  "message": "Property \`dependentRequired\` is not expected here.",
1614
- "ruleId": "spec",
1614
+ "ruleId": "struct",
1615
1615
  "severity": "error",
1616
1616
  "suggest": [],
1617
1617
  },
package/src/bundle.ts CHANGED
@@ -163,7 +163,7 @@ export async function bundleDocument(opts: {
163
163
  } = opts;
164
164
  const specVersion = detectSpec(document.parsed);
165
165
  const specMajorVersion = getMajorSpecVersion(specVersion);
166
- const rules = config.getRulesForOasVersion(specMajorVersion);
166
+ const rules = config.getRulesForSpecVersion(specMajorVersion);
167
167
  const types = normalizeTypes(
168
168
  config.extendTypes(customTypes ?? getTypes(specVersion), specVersion),
169
169
  config
@@ -303,7 +303,7 @@ export function mapTypeToComponent(typeName: string, version: SpecMajorVersion)
303
303
  default:
304
304
  return null;
305
305
  }
306
- case SpecMajorVersion.Arazzo:
306
+ case SpecMajorVersion.Arazzo1:
307
307
  switch (typeName) {
308
308
  case 'Root.workflows_items.parameters_items':
309
309
  case 'Root.workflows_items.steps_items.parameters_items':
@@ -408,7 +408,7 @@ function makeBundleVisitor(
408
408
  components = root.components = root.components || {};
409
409
  } else if (version === SpecMajorVersion.Async3) {
410
410
  components = root.components = root.components || {};
411
- } else if (version === SpecMajorVersion.Arazzo) {
411
+ } else if (version === SpecMajorVersion.Arazzo1) {
412
412
  components = root.components = root.components || {};
413
413
  }
414
414
  },
@@ -2,9 +2,9 @@
2
2
 
3
3
  exports[`resolveConfig should ignore minimal from the root and read local file 1`] = `
4
4
  {
5
- "arazzoDecorators": {},
6
- "arazzoPreprocessors": {},
7
- "arazzoRules": {
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
- "spec": "error",
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
- "arazzoDecorators": {},
154
- "arazzoPreprocessors": {},
155
- "arazzoRules": {
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
- "spec": "error",
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
  `;