@redocly/openapi-core 1.25.14 → 1.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/__tests__/utils.ts +0 -3
- package/lib/bundle.js +3 -3
- package/lib/config/all.js +130 -48
- package/lib/config/builtIn.d.ts +1 -1
- package/lib/config/builtIn.js +5 -3
- package/lib/config/config-resolvers.js +9 -9
- package/lib/config/config.d.ts +2 -2
- package/lib/config/config.js +38 -20
- package/lib/config/minimal.js +125 -49
- package/lib/config/recommended-strict.js +124 -48
- package/lib/config/recommended.js +123 -47
- package/lib/config/rules.d.ts +2 -2
- package/lib/config/spec.d.ts +3 -0
- package/lib/config/spec.js +31 -0
- package/lib/config/types.d.ts +23 -23
- package/lib/config/utils.d.ts +1 -1
- package/lib/config/utils.js +33 -23
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/lib/lint.js +3 -3
- package/lib/oas-types.d.ts +11 -11
- package/lib/oas-types.js +6 -6
- package/lib/rules/arazzo/criteria-unique.d.ts +2 -2
- package/lib/rules/arazzo/index.d.ts +2 -2
- package/lib/rules/arazzo/index.js +6 -4
- package/lib/rules/arazzo/parameters-unique.d.ts +2 -2
- package/lib/rules/arazzo/requestBody-replacements-unique.d.ts +2 -2
- package/lib/rules/arazzo/sourceDescription-type.d.ts +2 -0
- package/lib/rules/arazzo/{source-description-type.js → sourceDescription-type.js} +5 -3
- package/lib/rules/arazzo/sourceDescriptions-name-unique.d.ts +2 -2
- package/lib/rules/arazzo/sourceDescriptions-not-empty.d.ts +2 -0
- package/lib/rules/arazzo/sourceDescriptions-not-empty.js +18 -0
- package/lib/rules/arazzo/step-onFailure-unique.d.ts +2 -2
- package/lib/rules/arazzo/step-onSuccess-unique.d.ts +2 -2
- package/lib/rules/arazzo/stepId-unique.d.ts +2 -2
- package/lib/rules/arazzo/workflow-dependsOn.d.ts +2 -2
- package/lib/rules/arazzo/workflowId-unique.d.ts +2 -2
- package/lib/rules/async2/index.js +5 -2
- package/lib/rules/async3/index.js +5 -2
- package/lib/rules/common/assertions/index.d.ts +2 -2
- package/lib/rules/common/struct.d.ts +2 -0
- package/lib/rules/common/{spec.js → struct.js} +3 -3
- package/lib/rules/oas2/index.js +5 -2
- package/lib/rules/oas3/index.js +5 -2
- package/lib/rules/spot/no-actions-type-end.d.ts +2 -2
- package/lib/rules/spot/no-criteria-xpath.d.ts +2 -2
- package/lib/rules/spot/parameters-not-in-body.d.ts +2 -2
- package/lib/rules/spot/version-enum.d.ts +2 -2
- package/lib/types/arazzo.d.ts +1 -1
- package/lib/types/arazzo.js +3 -27
- package/lib/types/redocly-yaml.d.ts +6 -8
- package/lib/types/redocly-yaml.js +47 -12
- package/lib/typings/arazzo.d.ts +1 -15
- package/lib/utils.d.ts +1 -1
- package/lib/utils.js +3 -2
- package/lib/visitors.d.ts +5 -7
- package/package.json +2 -2
- package/src/__tests__/lint.test.ts +3 -3
- package/src/bundle.ts +3 -3
- package/src/config/__tests__/__snapshots__/config-resolvers.test.ts.snap +228 -70
- package/src/config/__tests__/__snapshots__/config.test.ts.snap +16 -3
- package/src/config/__tests__/config-resolvers.test.ts +14 -2
- package/src/config/__tests__/config.test.ts +11 -6
- package/src/config/all.ts +130 -48
- package/src/config/builtIn.ts +10 -8
- package/src/config/config-resolvers.ts +9 -9
- package/src/config/config.ts +46 -22
- package/src/config/minimal.ts +125 -49
- package/src/config/recommended-strict.ts +124 -48
- package/src/config/recommended.ts +123 -47
- package/src/config/rules.ts +2 -2
- package/src/config/spec.ts +32 -0
- package/src/config/types.ts +27 -33
- package/src/config/utils.ts +38 -26
- package/src/index.ts +1 -1
- package/src/lint.ts +6 -6
- package/src/oas-types.ts +19 -20
- package/src/rules/arazzo/__tests__/criteria-unique.test.ts +1 -2
- package/src/rules/arazzo/__tests__/no-actions-type-end.test.ts +1 -2
- package/src/rules/arazzo/__tests__/no-criteria-xpath.test.ts +1 -2
- package/src/rules/arazzo/__tests__/parameters-not-in-body.test.ts +1 -2
- package/src/rules/arazzo/__tests__/parameters-unique.test.ts +1 -2
- package/src/rules/arazzo/__tests__/requestBody-replacements-unique.test.ts +1 -2
- package/src/rules/arazzo/__tests__/source-description-type.test.ts +2 -4
- package/src/rules/arazzo/__tests__/sourceDescription-name-unique.test.ts +1 -2
- package/src/rules/arazzo/__tests__/sourceDescriptions-not-empty.test.ts +104 -0
- package/src/rules/arazzo/__tests__/step-onFailure-unique.test.ts +1 -2
- package/src/rules/arazzo/__tests__/step-onSuccess-unique.test.ts +1 -2
- package/src/rules/arazzo/__tests__/stepId-unique.test.ts +1 -2
- package/src/rules/arazzo/__tests__/version-enum.test.ts +1 -2
- package/src/rules/arazzo/__tests__/workflow-dependsOn.test.ts +3 -6
- package/src/rules/arazzo/__tests__/workflowId-unique.test.ts +2 -4
- package/src/rules/arazzo/criteria-unique.ts +2 -2
- package/src/rules/arazzo/index.ts +23 -21
- package/src/rules/arazzo/parameters-unique.ts +2 -2
- package/src/rules/arazzo/requestBody-replacements-unique.ts +2 -2
- package/src/rules/arazzo/{source-description-type.ts → sourceDescription-type.ts} +6 -5
- package/src/rules/arazzo/sourceDescriptions-name-unique.ts +2 -2
- package/src/rules/arazzo/sourceDescriptions-not-empty.ts +17 -0
- package/src/rules/arazzo/step-onFailure-unique.ts +2 -2
- package/src/rules/arazzo/step-onSuccess-unique.ts +2 -2
- package/src/rules/arazzo/stepId-unique.ts +2 -2
- package/src/rules/arazzo/workflow-dependsOn.ts +2 -2
- package/src/rules/arazzo/workflowId-unique.ts +2 -2
- package/src/rules/async2/index.ts +5 -2
- package/src/rules/async3/index.ts +5 -2
- package/src/rules/common/__tests__/no-enum-type-mismatch.test.ts +1 -1
- package/src/rules/common/__tests__/{spec.test.ts → struct.test.ts} +35 -35
- package/src/rules/common/assertions/index.ts +2 -2
- package/src/rules/common/{spec.ts → struct.ts} +2 -2
- package/src/rules/oas2/index.ts +5 -2
- package/src/rules/oas3/__tests__/spec/spec.test.ts +10 -10
- package/src/rules/oas3/index.ts +5 -2
- package/src/rules/spot/no-actions-type-end.ts +2 -2
- package/src/rules/spot/no-criteria-xpath.ts +2 -2
- package/src/rules/spot/parameters-not-in-body.ts +2 -2
- package/src/rules/spot/version-enum.ts +2 -2
- package/src/types/arazzo.ts +2 -25
- package/src/types/redocly-yaml.ts +48 -16
- package/src/typings/arazzo.ts +1 -20
- package/src/utils.ts +4 -2
- package/src/visitors.ts +4 -8
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/rules/arazzo/source-description-type.d.ts +0 -2
- package/lib/rules/common/spec.d.ts +0 -2
|
@@ -7,8 +7,7 @@ const _1 = require(".");
|
|
|
7
7
|
const utils_1 = require("../utils");
|
|
8
8
|
const json_schema_adapter_1 = require("./json-schema-adapter");
|
|
9
9
|
const oas_types_1 = require("../oas-types");
|
|
10
|
-
const
|
|
11
|
-
'spec',
|
|
10
|
+
const builtInOAS2Rules = [
|
|
12
11
|
'info-contact',
|
|
13
12
|
'operation-operationId',
|
|
14
13
|
'tag-description',
|
|
@@ -48,14 +47,51 @@ const builtInCommonOASRules = [
|
|
|
48
47
|
'spec-strict-refs',
|
|
49
48
|
'no-unresolved-refs',
|
|
50
49
|
'no-required-schema-properties-undefined',
|
|
51
|
-
];
|
|
52
|
-
const builtInOAS2Rules = [
|
|
53
50
|
'boolean-parameter-prefixes',
|
|
54
51
|
'request-mime-type',
|
|
55
52
|
'response-contains-property',
|
|
56
53
|
'response-mime-type',
|
|
57
54
|
];
|
|
58
55
|
const builtInOAS3Rules = [
|
|
56
|
+
'info-contact',
|
|
57
|
+
'operation-operationId',
|
|
58
|
+
'tag-description',
|
|
59
|
+
'tags-alphabetical',
|
|
60
|
+
'info-license-url',
|
|
61
|
+
'info-license-strict',
|
|
62
|
+
'info-license',
|
|
63
|
+
'no-ambiguous-paths',
|
|
64
|
+
'no-enum-type-mismatch',
|
|
65
|
+
'no-http-verbs-in-paths',
|
|
66
|
+
'no-identical-paths',
|
|
67
|
+
'no-invalid-parameter-examples',
|
|
68
|
+
'no-invalid-schema-examples',
|
|
69
|
+
'no-path-trailing-slash',
|
|
70
|
+
'operation-2xx-response',
|
|
71
|
+
'operation-4xx-response',
|
|
72
|
+
'operation-description',
|
|
73
|
+
'operation-operationId-unique',
|
|
74
|
+
'operation-operationId-url-safe',
|
|
75
|
+
'operation-parameters-unique',
|
|
76
|
+
'operation-singular-tag',
|
|
77
|
+
'operation-summary',
|
|
78
|
+
'operation-tag-defined',
|
|
79
|
+
'parameter-description',
|
|
80
|
+
'path-declaration-must-exist',
|
|
81
|
+
'path-excludes-patterns',
|
|
82
|
+
'path-http-verbs-order',
|
|
83
|
+
'path-not-include-query',
|
|
84
|
+
'path-params-defined',
|
|
85
|
+
'path-parameters-defined',
|
|
86
|
+
'path-segment-plural',
|
|
87
|
+
'paths-kebab-case',
|
|
88
|
+
'required-string-property-missing-min-length',
|
|
89
|
+
'response-contains-header',
|
|
90
|
+
'scalar-property-missing-example',
|
|
91
|
+
'security-defined',
|
|
92
|
+
'spec-strict-refs',
|
|
93
|
+
'no-unresolved-refs',
|
|
94
|
+
'no-required-schema-properties-undefined',
|
|
59
95
|
'boolean-parameter-prefixes',
|
|
60
96
|
'component-name-unique',
|
|
61
97
|
'no-empty-servers',
|
|
@@ -74,7 +110,6 @@ const builtInOAS3Rules = [
|
|
|
74
110
|
'array-parameter-serialization',
|
|
75
111
|
];
|
|
76
112
|
const builtInAsync2Rules = [
|
|
77
|
-
'spec',
|
|
78
113
|
'info-contact',
|
|
79
114
|
'info-license-strict',
|
|
80
115
|
'operation-operationId',
|
|
@@ -84,7 +119,6 @@ const builtInAsync2Rules = [
|
|
|
84
119
|
'no-channel-trailing-slash',
|
|
85
120
|
];
|
|
86
121
|
const builtInAsync3Rules = [
|
|
87
|
-
'spec',
|
|
88
122
|
'info-contact',
|
|
89
123
|
'info-license-strict',
|
|
90
124
|
'operation-operationId',
|
|
@@ -93,14 +127,14 @@ const builtInAsync3Rules = [
|
|
|
93
127
|
'channels-kebab-case',
|
|
94
128
|
'no-channel-trailing-slash',
|
|
95
129
|
];
|
|
96
|
-
const
|
|
97
|
-
'spec',
|
|
130
|
+
const builtInArazzo1Rules = [
|
|
98
131
|
'parameters-not-in-body',
|
|
99
132
|
'sourceDescription-type',
|
|
100
133
|
'version-enum',
|
|
101
134
|
'workflowId-unique',
|
|
102
135
|
'stepId-unique',
|
|
103
136
|
'sourceDescription-name-unique',
|
|
137
|
+
'sourceDescriptions-not-empty',
|
|
104
138
|
'workflow-dependsOn',
|
|
105
139
|
'parameters-unique',
|
|
106
140
|
'step-onSuccess-unique',
|
|
@@ -111,12 +145,13 @@ const builtInArazzoRules = [
|
|
|
111
145
|
'criteria-unique',
|
|
112
146
|
];
|
|
113
147
|
const builtInRules = [
|
|
114
|
-
...builtInCommonOASRules,
|
|
115
148
|
...builtInOAS2Rules,
|
|
116
149
|
...builtInOAS3Rules,
|
|
117
150
|
...builtInAsync2Rules,
|
|
118
151
|
...builtInAsync3Rules,
|
|
119
|
-
...
|
|
152
|
+
...builtInArazzo1Rules,
|
|
153
|
+
'spec', // TODO: depricated in favor of struct
|
|
154
|
+
'struct',
|
|
120
155
|
];
|
|
121
156
|
const oas2NodeTypesList = [
|
|
122
157
|
'Root',
|
|
@@ -247,7 +282,7 @@ const ConfigStyleguide = {
|
|
|
247
282
|
oas3_0Rules: 'Rules',
|
|
248
283
|
oas3_1Rules: 'Rules',
|
|
249
284
|
async2Rules: 'Rules',
|
|
250
|
-
|
|
285
|
+
arazzo1Rules: 'Rules',
|
|
251
286
|
preprocessors: { type: 'object' },
|
|
252
287
|
oas2Preprocessors: { type: 'object' },
|
|
253
288
|
oas3_0Preprocessors: { type: 'object' },
|
|
@@ -259,7 +294,7 @@ const ConfigStyleguide = {
|
|
|
259
294
|
oas3_0Decorators: { type: 'object' },
|
|
260
295
|
oas3_1Decorators: { type: 'object' },
|
|
261
296
|
async2Decorators: { type: 'object' },
|
|
262
|
-
|
|
297
|
+
arazzo1Decorators: { type: 'object' },
|
|
263
298
|
},
|
|
264
299
|
};
|
|
265
300
|
const createConfigRoot = (nodeTypes) => ({
|
package/lib/typings/arazzo.d.ts
CHANGED
|
@@ -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 |
|
|
18
|
+
export type SourceDescription = OpenAPISourceDescription | ArazzoSourceDescription;
|
|
24
19
|
export interface Parameter {
|
|
25
20
|
in?: 'header' | 'query' | 'path' | 'cookie' | 'body';
|
|
26
21
|
name: string;
|
|
@@ -31,14 +26,6 @@ export interface ExtendedOperation {
|
|
|
31
26
|
url: string;
|
|
32
27
|
method: 'get' | 'post' | 'put' | 'delete' | 'patch' | 'head' | 'options' | 'trace' | 'connect' | 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS' | 'TRACE' | 'CONNECT';
|
|
33
28
|
}
|
|
34
|
-
export interface ExpectSchema {
|
|
35
|
-
statusCode?: number;
|
|
36
|
-
mimeType?: string;
|
|
37
|
-
body?: any;
|
|
38
|
-
schema?: {
|
|
39
|
-
[key: string]: any;
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
29
|
export interface Replacement {
|
|
43
30
|
target: string;
|
|
44
31
|
value: string | object | any[];
|
|
@@ -89,7 +76,6 @@ export interface Step {
|
|
|
89
76
|
outputs?: {
|
|
90
77
|
[key: string]: string | object | any[] | boolean | number;
|
|
91
78
|
};
|
|
92
|
-
'x-expect'?: ExpectSchema;
|
|
93
79
|
'x-operation'?: ExtendedOperation;
|
|
94
80
|
requestBody?: RequestBody;
|
|
95
81
|
}
|
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
|
-
: ''}
|
|
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,
|
|
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,11 +149,9 @@ 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>;
|
|
156
|
-
ExpectSchema?: VisitFunctionOrObject<ExpectSchema>;
|
|
157
155
|
Replacement?: VisitFunctionOrObject<Replacement>;
|
|
158
156
|
RequestBody?: VisitFunctionOrObject<RequestBody>;
|
|
159
157
|
CriteriaObject?: VisitFunctionOrObject<CriteriaObject>;
|
|
@@ -183,7 +181,7 @@ export type Oas3Visitor = BaseVisitor & Oas3NestedVisitor & Record<string, Visit
|
|
|
183
181
|
export type Oas2Visitor = BaseVisitor & Oas2NestedVisitor & Record<string, VisitFunction<any> | NestedVisitObject<any, Oas2NestedVisitor>>;
|
|
184
182
|
export type Async2Visitor = BaseVisitor & Async2NestedVisitor & Record<string, VisitFunction<any> | NestedVisitObject<any, Async2NestedVisitor>>;
|
|
185
183
|
export type Async3Visitor = BaseVisitor & Async3NestedVisitor & Record<string, VisitFunction<any> | NestedVisitObject<any, Async3NestedVisitor>>;
|
|
186
|
-
export type
|
|
184
|
+
export type Arazzo1Visitor = BaseVisitor & ArazzoNestedVisitor & Record<string, VisitFunction<any> | NestedVisitObject<any, ArazzoNestedVisitor>>;
|
|
187
185
|
export type NestedVisitor<T> = Exclude<T, 'any' | 'ref' | 'Root'>;
|
|
188
186
|
export type NormalizedOasVisitors<T extends BaseVisitor> = {
|
|
189
187
|
[V in keyof T]-?: {
|
|
@@ -204,17 +202,17 @@ export type Oas3Rule = (options: Record<string, any>) => Oas3Visitor | Oas3Visit
|
|
|
204
202
|
export type Oas2Rule = (options: Record<string, any>) => Oas2Visitor | Oas2Visitor[];
|
|
205
203
|
export type Async2Rule = (options: Record<string, any>) => Async2Visitor | Async2Visitor[];
|
|
206
204
|
export type Async3Rule = (options: Record<string, any>) => Async3Visitor | Async3Visitor[];
|
|
207
|
-
export type
|
|
205
|
+
export type Arazzo1Rule = (options: Record<string, any>) => Arazzo1Visitor | Arazzo1Visitor[];
|
|
208
206
|
export type Oas3Preprocessor = (options: Record<string, any>) => Oas3Visitor;
|
|
209
207
|
export type Oas2Preprocessor = (options: Record<string, any>) => Oas2Visitor;
|
|
210
208
|
export type Async2Preprocessor = (options: Record<string, any>) => Async2Visitor;
|
|
211
209
|
export type Async3Preprocessor = (options: Record<string, any>) => Async3Visitor;
|
|
212
|
-
export type
|
|
210
|
+
export type Arazzo1Preprocessor = (options: Record<string, any>) => Arazzo1Visitor;
|
|
213
211
|
export type Oas3Decorator = (options: Record<string, any>) => Oas3Visitor;
|
|
214
212
|
export type Oas2Decorator = (options: Record<string, any>) => Oas2Visitor;
|
|
215
213
|
export type Async2Decorator = (options: Record<string, any>) => Async2Visitor;
|
|
216
214
|
export type Async3Decorator = (options: Record<string, any>) => Async3Visitor;
|
|
217
|
-
export type
|
|
215
|
+
export type Arazzo1Decorator = (options: Record<string, any>) => Arazzo1Visitor;
|
|
218
216
|
export type OasRule = Oas3Rule;
|
|
219
217
|
export type OasPreprocessor = Oas3Preprocessor;
|
|
220
218
|
export type OasDecorator = Oas3Decorator;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/openapi-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"engines": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@redocly/ajv": "^8.11.2",
|
|
39
|
-
"@redocly/config": "^0.
|
|
39
|
+
"@redocly/config": "^0.17.0",
|
|
40
40
|
"colorette": "^1.2.0",
|
|
41
41
|
"https-proxy-agent": "^7.0.4",
|
|
42
42
|
"js-levenshtein": "^1.1.6",
|
|
@@ -295,7 +295,7 @@ describe('lint', () => {
|
|
|
295
295
|
},
|
|
296
296
|
],
|
|
297
297
|
"message": "Expected type \`License\` (object) but got \`string\`",
|
|
298
|
-
"ruleId": "
|
|
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": "
|
|
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": "
|
|
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.
|
|
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.
|
|
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.
|
|
411
|
+
} else if (version === SpecMajorVersion.Arazzo1) {
|
|
412
412
|
components = root.components = root.components || {};
|
|
413
413
|
}
|
|
414
414
|
},
|