@redocly/openapi-core 1.3.0 → 1.4.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 +6 -0
- package/lib/benchmark/benches/lint-with-many-rules.bench.js +4 -4
- package/lib/benchmark/benches/lint-with-nested-rule.bench.js +4 -4
- package/lib/benchmark/benches/lint-with-no-rules.bench.js +4 -4
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.js +4 -4
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.js +4 -4
- package/lib/benchmark/benches/recommended-oas3.bench.js +4 -4
- package/lib/benchmark/benches/resolve-with-no-external.bench.js +3 -3
- package/lib/benchmark/utils.js +3 -3
- package/lib/bundle.d.ts +4 -4
- package/lib/bundle.js +23 -23
- package/lib/config/all.d.ts +2 -2
- package/lib/config/all.js +44 -8
- package/lib/config/builtIn.js +2 -0
- package/lib/config/config-resolvers.js +25 -25
- package/lib/config/config.js +9 -9
- package/lib/config/index.js +5 -1
- package/lib/config/load.d.ts +1 -1
- package/lib/config/load.js +6 -6
- package/lib/config/minimal.d.ts +2 -2
- package/lib/config/minimal.js +34 -3
- package/lib/config/recommended-strict.d.ts +3 -0
- package/lib/config/recommended-strict.js +92 -0
- package/lib/config/recommended.d.ts +2 -2
- package/lib/config/recommended.js +34 -3
- package/lib/config/rules.d.ts +1 -1
- package/lib/config/types.d.ts +47 -46
- package/lib/config/types.js +2 -2
- package/lib/config/utils.js +26 -14
- package/lib/decorators/common/filters/filter-helper.js +4 -4
- package/lib/decorators/common/filters/filter-in.js +2 -2
- package/lib/decorators/common/filters/filter-out.js +2 -2
- package/lib/decorators/common/info-description-override.js +1 -1
- package/lib/decorators/common/media-type-examples-override.js +3 -3
- package/lib/decorators/common/operation-description-override.js +1 -1
- package/lib/decorators/common/registry-dependencies.js +1 -1
- package/lib/decorators/common/remove-x-internal.js +4 -4
- package/lib/decorators/common/tag-description-override.js +1 -1
- package/lib/format/codeframes.d.ts +6 -6
- package/lib/format/format.d.ts +2 -2
- package/lib/format/format.js +12 -12
- package/lib/js-yaml/index.d.ts +2 -2
- package/lib/js-yaml/index.js +2 -2
- package/lib/lint.js +18 -18
- package/lib/oas-types.d.ts +12 -10
- package/lib/oas-types.js +2 -2
- package/lib/redocly/index.js +10 -10
- package/lib/redocly/registry-api.js +2 -2
- package/lib/resolve.d.ts +4 -4
- package/lib/resolve.js +18 -18
- package/lib/rules/ajv.js +1 -1
- package/lib/rules/async2/index.d.ts +2 -11
- package/lib/rules/common/assertions/asserts.d.ts +3 -3
- package/lib/rules/common/assertions/asserts.js +21 -21
- package/lib/rules/common/assertions/index.d.ts +4 -4
- package/lib/rules/common/assertions/index.js +3 -3
- package/lib/rules/common/assertions/utils.d.ts +4 -4
- package/lib/rules/common/assertions/utils.js +3 -3
- package/lib/rules/common/info-contact.js +1 -1
- package/lib/rules/common/info-license-url.js +1 -1
- package/lib/rules/common/info-license.js +1 -1
- package/lib/rules/common/no-enum-type-mismatch.js +3 -3
- package/lib/rules/common/no-http-verbs-in-paths.js +2 -2
- package/lib/rules/common/no-invalid-parameter-examples.js +3 -3
- package/lib/rules/common/no-invalid-schema-examples.js +3 -3
- package/lib/rules/common/operation-2xx-response.js +2 -2
- package/lib/rules/common/operation-4xx-response.js +2 -2
- package/lib/rules/common/operation-description.js +1 -1
- package/lib/rules/common/operation-operationId.js +1 -1
- package/lib/rules/common/operation-summary.js +1 -1
- package/lib/rules/common/path-segment-plural.js +1 -1
- package/lib/rules/common/response-contains-header.js +2 -2
- package/lib/rules/common/spec-strict-refs.js +1 -1
- package/lib/rules/common/spec.js +11 -11
- package/lib/rules/common/tag-description.js +1 -1
- package/lib/rules/oas2/boolean-parameter-prefixes.d.ts +1 -1
- package/lib/rules/oas2/index.d.ts +2 -46
- package/lib/rules/oas2/remove-unused-components.js +1 -1
- package/lib/rules/oas2/request-mime-type.js +2 -2
- package/lib/rules/oas2/response-contains-property.js +2 -2
- package/lib/rules/oas2/response-mime-type.js +2 -2
- package/lib/rules/oas3/boolean-parameter-prefixes.d.ts +1 -1
- package/lib/rules/oas3/index.d.ts +1 -1
- package/lib/rules/oas3/index.js +1 -1
- package/lib/rules/oas3/no-invalid-media-type-examples.js +3 -3
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js +3 -3
- package/lib/rules/oas3/remove-unused-components.js +2 -2
- package/lib/rules/oas3/request-mime-type.js +3 -3
- package/lib/rules/oas3/response-contains-property.js +2 -2
- package/lib/rules/oas3/response-mime-type.js +3 -3
- package/lib/rules/utils.js +3 -3
- package/lib/types/asyncapi.js +21 -21
- package/lib/types/index.d.ts +8 -8
- package/lib/types/oas2.js +14 -14
- package/lib/types/oas3.js +27 -27
- package/lib/types/oas3_1.js +6 -6
- package/lib/types/redocly-yaml.d.ts +11 -0
- package/lib/types/redocly-yaml.js +71 -53
- package/lib/types/theme-config.js +1 -1
- package/lib/typings/common.d.ts +2 -2
- package/lib/typings/openapi.d.ts +6 -6
- package/lib/typings/swagger.d.ts +3 -3
- package/lib/utils.d.ts +5 -5
- package/lib/utils.js +3 -3
- package/lib/visitors.d.ts +40 -40
- package/lib/walk.d.ts +14 -15
- package/lib/walk.js +11 -11
- package/package.json +2 -2
- package/src/__tests__/lint.test.ts +40 -40
- package/src/__tests__/normalizeVisitors.test.ts +23 -5
- package/src/__tests__/ref-utils.test.ts +7 -7
- package/src/__tests__/resolve-http.test.ts +10 -10
- package/src/__tests__/resolve.test.ts +39 -39
- package/src/__tests__/walk.test.ts +48 -48
- package/src/config/__tests__/__snapshots__/config-resolvers.test.ts.snap +95 -32
- package/src/config/__tests__/__snapshots__/config.test.ts.snap +81 -81
- package/src/config/__tests__/config-resolvers.test.ts +30 -1
- package/src/config/__tests__/config.test.ts +88 -88
- package/src/config/__tests__/load.test.ts +12 -8
- package/src/config/__tests__/utils.test.ts +18 -18
- package/src/config/all.ts +46 -9
- package/src/config/builtIn.ts +2 -0
- package/src/config/minimal.ts +36 -4
- package/src/config/recommended-strict.ts +93 -0
- package/src/config/recommended.ts +36 -4
- package/src/config/types.ts +22 -8
- package/src/config/utils.ts +15 -0
- package/src/decorators/common/media-type-examples-override.ts +2 -2
- package/src/lint.ts +3 -3
- package/src/oas-types.ts +26 -3
- package/src/rules/__tests__/no-unresolved-refs.test.ts +26 -26
- package/src/rules/async2/__tests__/channels-kebab-case.test.ts +12 -12
- package/src/rules/async2/__tests__/no-channel-trailing-slash.test.ts +7 -7
- package/src/rules/async2/index.ts +2 -1
- package/src/rules/common/__tests__/info-license.test.ts +6 -6
- package/src/rules/common/__tests__/license-url.test.ts +6 -6
- package/src/rules/common/__tests__/no-ambiguous-paths.test.ts +13 -13
- package/src/rules/common/__tests__/no-enum-type-mismatch.test.ts +18 -18
- package/src/rules/common/__tests__/no-identical-paths.test.ts +5 -5
- package/src/rules/common/__tests__/no-path-trailing-slash.test.ts +12 -12
- package/src/rules/common/__tests__/operation-2xx-response.test.ts +18 -18
- package/src/rules/common/__tests__/operation-4xx-response.test.ts +23 -23
- package/src/rules/common/__tests__/operation-operationId-unique.test.ts +6 -6
- package/src/rules/common/__tests__/operation-operationId-url-safe.test.ts +5 -5
- package/src/rules/common/__tests__/operation-parameters-unique.test.ts +16 -16
- package/src/rules/common/__tests__/operation-singular-tag.test.ts +6 -6
- package/src/rules/common/__tests__/path-http-verbs-order.test.ts +10 -10
- package/src/rules/common/__tests__/path-not-include-query.test.ts +6 -6
- package/src/rules/common/__tests__/path-params-defined.test.ts +21 -21
- package/src/rules/common/__tests__/paths-kebab-case.test.ts +11 -11
- package/src/rules/common/__tests__/scalar-property-missing-example.test.ts +18 -18
- package/src/rules/common/__tests__/security-defined.test.ts +21 -21
- package/src/rules/common/__tests__/spec-strict-refs.test.ts +9 -9
- package/src/rules/common/__tests__/spec.test.ts +102 -102
- package/src/rules/common/__tests__/tag-description.test.ts +6 -6
- package/src/rules/common/__tests__/tags-alphabetical.test.ts +12 -12
- package/src/rules/common/assertions/__tests__/index.test.ts +15 -15
- package/src/rules/common/assertions/__tests__/utils.test.ts +9 -9
- package/src/rules/oas2/__tests__/boolean-parameter-prefixes.test.ts +7 -7
- package/src/rules/oas2/__tests__/response-contains-header.test.ts +13 -13
- package/src/rules/oas2/__tests__/response-contains-property.test.ts +8 -8
- package/src/rules/oas2/__tests__/spec/info.test.ts +21 -21
- package/src/rules/oas2/__tests__/spec/operation.test.ts +4 -4
- package/src/rules/oas2/__tests__/spec/paths.test.ts +12 -12
- package/src/rules/oas2/__tests__/spec/referenceableScalars.test.ts +1 -1
- package/src/rules/oas2/index.ts +3 -1
- package/src/rules/oas3/__tests__/boolean-parameter-prefixes.test.ts +7 -7
- package/src/rules/oas3/__tests__/component-name-unique.test.ts +186 -186
- package/src/rules/oas3/__tests__/no-empty-enum-servers.com.test.ts +18 -18
- package/src/rules/oas3/__tests__/no-example-value-and-externalValue.test.ts +6 -6
- package/src/rules/oas3/__tests__/no-invalid-media-type-examples.test.ts +36 -36
- package/src/rules/oas3/__tests__/no-server-example.com.test.ts +11 -11
- package/src/rules/oas3/__tests__/no-server-trailing-slash.test.ts +7 -7
- package/src/rules/oas3/__tests__/no-unused-components.test.ts +31 -31
- package/src/rules/oas3/__tests__/operation-4xx-problem-details-rfc7807.test.ts +15 -15
- package/src/rules/oas3/__tests__/response-contains-header.test.ts +26 -26
- package/src/rules/oas3/__tests__/response-contains-property.test.ts +27 -27
- package/src/rules/oas3/__tests__/spec/callbacks.test.ts +1 -1
- package/src/rules/oas3/__tests__/spec/info.test.ts +21 -21
- package/src/rules/oas3/__tests__/spec/operation.test.ts +10 -10
- package/src/rules/oas3/__tests__/spec/paths.test.ts +13 -13
- package/src/rules/oas3/__tests__/spec/referenceableScalars.test.ts +2 -2
- package/src/rules/oas3/__tests__/spec/servers.test.ts +25 -25
- package/src/rules/oas3/__tests__/spec/spec.test.ts +56 -56
- package/src/rules/oas3/__tests__/spec-components-invalid-map-name.test.ts +28 -28
- package/src/rules/oas3/index.ts +3 -3
- package/src/types/redocly-yaml.ts +75 -40
- package/src/visitors.ts +3 -3
- package/src/walk.ts +23 -10
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -188,7 +188,7 @@ describe('walk order', () => {
|
|
|
188
188
|
});
|
|
189
189
|
|
|
190
190
|
expect(calls).toMatchInlineSnapshot(`
|
|
191
|
-
|
|
191
|
+
[
|
|
192
192
|
"enter param path-param",
|
|
193
193
|
"leave param path-param",
|
|
194
194
|
"enter operation: get",
|
|
@@ -268,7 +268,7 @@ describe('walk order', () => {
|
|
|
268
268
|
});
|
|
269
269
|
|
|
270
270
|
expect(calls).toMatchInlineSnapshot(`
|
|
271
|
-
|
|
271
|
+
[
|
|
272
272
|
"enter param path-param",
|
|
273
273
|
"leave param path-param",
|
|
274
274
|
"enter operation: get",
|
|
@@ -349,7 +349,7 @@ describe('walk order', () => {
|
|
|
349
349
|
});
|
|
350
350
|
|
|
351
351
|
expect(calls).toMatchInlineSnapshot(`
|
|
352
|
-
|
|
352
|
+
[
|
|
353
353
|
"enter operation: get",
|
|
354
354
|
"enter operation get > param shared-a",
|
|
355
355
|
"enter param shared-a",
|
|
@@ -421,7 +421,7 @@ describe('walk order', () => {
|
|
|
421
421
|
});
|
|
422
422
|
|
|
423
423
|
expect(calls).toMatchInlineSnapshot(`
|
|
424
|
-
|
|
424
|
+
[
|
|
425
425
|
"enter path pet > param path-param",
|
|
426
426
|
"enter path pet > param shared-a",
|
|
427
427
|
"enter path pet > param get_b",
|
|
@@ -493,7 +493,7 @@ describe('walk order', () => {
|
|
|
493
493
|
});
|
|
494
494
|
|
|
495
495
|
expect(calls).toMatchInlineSnapshot(`
|
|
496
|
-
|
|
496
|
+
[
|
|
497
497
|
"enter path pet > param path-param",
|
|
498
498
|
"enter operation get > param shared-a",
|
|
499
499
|
"enter operation get > param get_b",
|
|
@@ -560,7 +560,7 @@ describe('walk order', () => {
|
|
|
560
560
|
});
|
|
561
561
|
|
|
562
562
|
expect(calls).toMatchInlineSnapshot(`
|
|
563
|
-
|
|
563
|
+
[
|
|
564
564
|
"enter path pet > param path-param",
|
|
565
565
|
"leave path pet > param path-param",
|
|
566
566
|
"enter path pet > op get",
|
|
@@ -614,7 +614,7 @@ describe('walk order', () => {
|
|
|
614
614
|
});
|
|
615
615
|
|
|
616
616
|
expect(calls).toMatchInlineSnapshot(`
|
|
617
|
-
|
|
617
|
+
[
|
|
618
618
|
"enter schema shared_a",
|
|
619
619
|
"enter schema nested",
|
|
620
620
|
]
|
|
@@ -670,7 +670,7 @@ describe('walk order', () => {
|
|
|
670
670
|
});
|
|
671
671
|
|
|
672
672
|
expect(calls).toMatchInlineSnapshot(`
|
|
673
|
-
|
|
673
|
+
[
|
|
674
674
|
"enter param a > schema shared_a",
|
|
675
675
|
"enter param b > schema shared_a",
|
|
676
676
|
]
|
|
@@ -712,7 +712,7 @@ describe('walk order', () => {
|
|
|
712
712
|
});
|
|
713
713
|
|
|
714
714
|
expect(calls).toMatchInlineSnapshot(`
|
|
715
|
-
|
|
715
|
+
[
|
|
716
716
|
"enter operation get",
|
|
717
717
|
"leave operation get",
|
|
718
718
|
]
|
|
@@ -767,7 +767,7 @@ describe('walk order', () => {
|
|
|
767
767
|
});
|
|
768
768
|
|
|
769
769
|
expect(calls).toMatchInlineSnapshot(`
|
|
770
|
-
|
|
770
|
+
[
|
|
771
771
|
"enter operation get > param shared-a",
|
|
772
772
|
"enter operation get > param get_b",
|
|
773
773
|
"enter operation get > param get_c",
|
|
@@ -853,7 +853,7 @@ describe('walk order', () => {
|
|
|
853
853
|
});
|
|
854
854
|
|
|
855
855
|
expect(calls).toMatchInlineSnapshot(`
|
|
856
|
-
|
|
856
|
+
[
|
|
857
857
|
"enter path pet > param path-param",
|
|
858
858
|
"leave path pet > param path-param",
|
|
859
859
|
"enter operation get > param shared-a",
|
|
@@ -932,7 +932,7 @@ describe('walk order', () => {
|
|
|
932
932
|
});
|
|
933
933
|
|
|
934
934
|
expect(calls).toMatchInlineSnapshot(`
|
|
935
|
-
|
|
935
|
+
[
|
|
936
936
|
"enter nested schema inline-top > inline-top",
|
|
937
937
|
"enter nested schema inline-top > inline-nested",
|
|
938
938
|
"enter nested schema inline-nested > inline-nested-nested",
|
|
@@ -1004,7 +1004,7 @@ describe('walk order', () => {
|
|
|
1004
1004
|
});
|
|
1005
1005
|
|
|
1006
1006
|
expect(calls).toMatchInlineSnapshot(`
|
|
1007
|
-
|
|
1007
|
+
[
|
|
1008
1008
|
"enter $ref #/components/parameters/shared_b with target shared-b",
|
|
1009
1009
|
"enter $ref #/components/parameters/shared_b with target shared-b",
|
|
1010
1010
|
"enter $ref #/components/parameters/shared_a with target shared-a",
|
|
@@ -1048,7 +1048,7 @@ describe('walk order', () => {
|
|
|
1048
1048
|
});
|
|
1049
1049
|
|
|
1050
1050
|
expect(calls).toMatchInlineSnapshot(`
|
|
1051
|
-
|
|
1051
|
+
[
|
|
1052
1052
|
"enter schema a: string",
|
|
1053
1053
|
"enter schema b: number",
|
|
1054
1054
|
]
|
|
@@ -1113,7 +1113,7 @@ describe('walk order', () => {
|
|
|
1113
1113
|
});
|
|
1114
1114
|
|
|
1115
1115
|
expect(calls).toMatchInlineSnapshot(`
|
|
1116
|
-
|
|
1116
|
+
[
|
|
1117
1117
|
"enter Root",
|
|
1118
1118
|
"enter Paths",
|
|
1119
1119
|
"enter PathItem",
|
|
@@ -1202,10 +1202,10 @@ describe('context.report', () => {
|
|
|
1202
1202
|
|
|
1203
1203
|
expect(results).toHaveLength(3);
|
|
1204
1204
|
expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
"location":
|
|
1208
|
-
|
|
1205
|
+
[
|
|
1206
|
+
{
|
|
1207
|
+
"location": [
|
|
1208
|
+
{
|
|
1209
1209
|
"pointer": "#/paths/~1pet/get/parameters/0",
|
|
1210
1210
|
"reportOnKey": false,
|
|
1211
1211
|
"source": "foobar.yaml",
|
|
@@ -1214,11 +1214,11 @@ describe('context.report', () => {
|
|
|
1214
1214
|
"message": "Parameter name shouldn't contain '_: get_a",
|
|
1215
1215
|
"ruleId": "test/test",
|
|
1216
1216
|
"severity": "error",
|
|
1217
|
-
"suggest":
|
|
1217
|
+
"suggest": [],
|
|
1218
1218
|
},
|
|
1219
|
-
|
|
1220
|
-
"location":
|
|
1221
|
-
|
|
1219
|
+
{
|
|
1220
|
+
"location": [
|
|
1221
|
+
{
|
|
1222
1222
|
"pointer": "#/paths/~1pet/get/parameters/1",
|
|
1223
1223
|
"reportOnKey": false,
|
|
1224
1224
|
"source": "foobar.yaml",
|
|
@@ -1227,11 +1227,11 @@ describe('context.report', () => {
|
|
|
1227
1227
|
"message": "Parameter name shouldn't contain '_: get_b",
|
|
1228
1228
|
"ruleId": "test/test",
|
|
1229
1229
|
"severity": "error",
|
|
1230
|
-
"suggest":
|
|
1230
|
+
"suggest": [],
|
|
1231
1231
|
},
|
|
1232
|
-
|
|
1233
|
-
"location":
|
|
1234
|
-
|
|
1232
|
+
{
|
|
1233
|
+
"location": [
|
|
1234
|
+
{
|
|
1235
1235
|
"pointer": "#/components/parameters/shared_a",
|
|
1236
1236
|
"reportOnKey": false,
|
|
1237
1237
|
"source": "foobar.yaml",
|
|
@@ -1240,7 +1240,7 @@ describe('context.report', () => {
|
|
|
1240
1240
|
"message": "Parameter name shouldn't contain '_: shared_a",
|
|
1241
1241
|
"ruleId": "test/test",
|
|
1242
1242
|
"severity": "error",
|
|
1243
|
-
"suggest":
|
|
1243
|
+
"suggest": [],
|
|
1244
1244
|
},
|
|
1245
1245
|
]
|
|
1246
1246
|
`);
|
|
@@ -1282,10 +1282,10 @@ describe('context.report', () => {
|
|
|
1282
1282
|
|
|
1283
1283
|
expect(results).toHaveLength(4);
|
|
1284
1284
|
expect(replaceSourceWithRef(results, cwd)).toMatchInlineSnapshot(`
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
"location":
|
|
1288
|
-
|
|
1285
|
+
[
|
|
1286
|
+
{
|
|
1287
|
+
"location": [
|
|
1288
|
+
{
|
|
1289
1289
|
"pointer": "#/components/parameters/path-param",
|
|
1290
1290
|
"reportOnKey": false,
|
|
1291
1291
|
"source": "openapi-with-external-refs.yaml",
|
|
@@ -1294,11 +1294,11 @@ describe('context.report', () => {
|
|
|
1294
1294
|
"message": "Parameter name shouldn't contain '_: path_param",
|
|
1295
1295
|
"ruleId": "test/test",
|
|
1296
1296
|
"severity": "error",
|
|
1297
|
-
"suggest":
|
|
1297
|
+
"suggest": [],
|
|
1298
1298
|
},
|
|
1299
|
-
|
|
1300
|
-
"location":
|
|
1301
|
-
|
|
1299
|
+
{
|
|
1300
|
+
"location": [
|
|
1301
|
+
{
|
|
1302
1302
|
"pointer": "#/components/parameters/param-a",
|
|
1303
1303
|
"reportOnKey": false,
|
|
1304
1304
|
"source": "openapi-with-external-refs.yaml",
|
|
@@ -1307,11 +1307,11 @@ describe('context.report', () => {
|
|
|
1307
1307
|
"message": "Parameter name shouldn't contain '_: param_a",
|
|
1308
1308
|
"ruleId": "test/test",
|
|
1309
1309
|
"severity": "error",
|
|
1310
|
-
"suggest":
|
|
1310
|
+
"suggest": [],
|
|
1311
1311
|
},
|
|
1312
|
-
|
|
1313
|
-
"location":
|
|
1314
|
-
|
|
1312
|
+
{
|
|
1313
|
+
"location": [
|
|
1314
|
+
{
|
|
1315
1315
|
"pointer": "#/",
|
|
1316
1316
|
"reportOnKey": false,
|
|
1317
1317
|
"source": "param-c.yaml",
|
|
@@ -1320,11 +1320,11 @@ describe('context.report', () => {
|
|
|
1320
1320
|
"message": "Parameter name shouldn't contain '_: param_c",
|
|
1321
1321
|
"ruleId": "test/test",
|
|
1322
1322
|
"severity": "error",
|
|
1323
|
-
"suggest":
|
|
1323
|
+
"suggest": [],
|
|
1324
1324
|
},
|
|
1325
|
-
|
|
1326
|
-
"location":
|
|
1327
|
-
|
|
1325
|
+
{
|
|
1326
|
+
"location": [
|
|
1327
|
+
{
|
|
1328
1328
|
"pointer": "#/",
|
|
1329
1329
|
"reportOnKey": false,
|
|
1330
1330
|
"source": "param-b.yaml",
|
|
@@ -1333,7 +1333,7 @@ describe('context.report', () => {
|
|
|
1333
1333
|
"message": "Parameter name shouldn't contain '_: param_b",
|
|
1334
1334
|
"ruleId": "test/test",
|
|
1335
1335
|
"severity": "error",
|
|
1336
|
-
"suggest":
|
|
1336
|
+
"suggest": [],
|
|
1337
1337
|
},
|
|
1338
1338
|
]
|
|
1339
1339
|
`);
|
|
@@ -1350,7 +1350,7 @@ describe('context.resolve', () => {
|
|
|
1350
1350
|
expect(schema.properties.a.$ref).toBeDefined();
|
|
1351
1351
|
const { location, node } = resolve(schema.properties.a);
|
|
1352
1352
|
expect(node).toMatchInlineSnapshot(`
|
|
1353
|
-
|
|
1353
|
+
{
|
|
1354
1354
|
"type": "string",
|
|
1355
1355
|
}
|
|
1356
1356
|
`);
|
|
@@ -1460,7 +1460,7 @@ describe('type extensions', () => {
|
|
|
1460
1460
|
});
|
|
1461
1461
|
|
|
1462
1462
|
expect(calls).toMatchInlineSnapshot(`
|
|
1463
|
-
|
|
1463
|
+
[
|
|
1464
1464
|
"enter Root",
|
|
1465
1465
|
"enter XWebHooks",
|
|
1466
1466
|
"enter hook test",
|
|
@@ -1532,7 +1532,7 @@ describe('ignoreNextRules', () => {
|
|
|
1532
1532
|
});
|
|
1533
1533
|
|
|
1534
1534
|
expect(calls).toMatchInlineSnapshot(`
|
|
1535
|
-
|
|
1535
|
+
[
|
|
1536
1536
|
"enter and skip operation get",
|
|
1537
1537
|
"leave skipped operation get",
|
|
1538
1538
|
"enter and not skip operation put",
|
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`resolveConfig should ignore minimal from the root and read local file 1`] = `
|
|
4
|
-
|
|
5
|
-
"
|
|
4
|
+
{
|
|
5
|
+
"async2Decorators": {},
|
|
6
|
+
"async2Preprocessors": {},
|
|
7
|
+
"async2Rules": {
|
|
8
|
+
"channels-kebab-case": "off",
|
|
9
|
+
"no-channel-trailing-slash": "off",
|
|
10
|
+
},
|
|
11
|
+
"decorators": {},
|
|
6
12
|
"doNotResolveExamples": undefined,
|
|
7
|
-
"oas2Decorators":
|
|
8
|
-
"oas2Preprocessors":
|
|
9
|
-
"oas2Rules":
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
"oas2Decorators": {},
|
|
14
|
+
"oas2Preprocessors": {},
|
|
15
|
+
"oas2Rules": {
|
|
16
|
+
"boolean-parameter-prefixes": "error",
|
|
17
|
+
"request-mime-type": "off",
|
|
18
|
+
"response-contains-property": "off",
|
|
19
|
+
"response-mime-type": "off",
|
|
20
|
+
},
|
|
21
|
+
"oas3_0Decorators": {},
|
|
22
|
+
"oas3_0Preprocessors": {},
|
|
23
|
+
"oas3_0Rules": {
|
|
24
|
+
"boolean-parameter-prefixes": "error",
|
|
25
|
+
"component-name-unique": "off",
|
|
13
26
|
"no-empty-servers": "error",
|
|
14
27
|
"no-example-value-and-externalValue": "error",
|
|
15
28
|
"no-invalid-media-type-examples": "error",
|
|
@@ -18,11 +31,17 @@ Object {
|
|
|
18
31
|
"no-server-variables-empty-enum": "error",
|
|
19
32
|
"no-undefined-server-variable": "error",
|
|
20
33
|
"no-unused-components": "warn",
|
|
34
|
+
"operation-4xx-problem-details-rfc7807": "off",
|
|
35
|
+
"request-mime-type": "off",
|
|
36
|
+
"response-contains-property": "off",
|
|
37
|
+
"response-mime-type": "off",
|
|
21
38
|
"spec-components-invalid-map-name": "error",
|
|
22
39
|
},
|
|
23
|
-
"oas3_1Decorators":
|
|
24
|
-
"oas3_1Preprocessors":
|
|
25
|
-
"oas3_1Rules":
|
|
40
|
+
"oas3_1Decorators": {},
|
|
41
|
+
"oas3_1Preprocessors": {},
|
|
42
|
+
"oas3_1Rules": {
|
|
43
|
+
"boolean-parameter-prefixes": "error",
|
|
44
|
+
"component-name-unique": "off",
|
|
26
45
|
"no-empty-servers": "error",
|
|
27
46
|
"no-example-value-and-externalValue": "error",
|
|
28
47
|
"no-invalid-media-type-examples": "error",
|
|
@@ -31,21 +50,27 @@ Object {
|
|
|
31
50
|
"no-server-variables-empty-enum": "error",
|
|
32
51
|
"no-undefined-server-variable": "error",
|
|
33
52
|
"no-unused-components": "warn",
|
|
53
|
+
"operation-4xx-problem-details-rfc7807": "off",
|
|
54
|
+
"request-mime-type": "off",
|
|
55
|
+
"response-contains-property": "off",
|
|
56
|
+
"response-mime-type": "off",
|
|
34
57
|
"spec-components-invalid-map-name": "error",
|
|
35
58
|
},
|
|
36
|
-
"preprocessors":
|
|
59
|
+
"preprocessors": {},
|
|
37
60
|
"recommendedFallback": false,
|
|
38
|
-
"rules":
|
|
61
|
+
"rules": {
|
|
39
62
|
"boolean-parameter-prefixes": "error",
|
|
40
|
-
"component-name-unique": "off",
|
|
41
63
|
"info-contact": "off",
|
|
42
64
|
"info-license": "warn",
|
|
43
65
|
"info-license-url": "warn",
|
|
44
66
|
"local/operation-id-not-test": "error",
|
|
45
67
|
"no-ambiguous-paths": "warn",
|
|
46
68
|
"no-enum-type-mismatch": "error",
|
|
69
|
+
"no-http-verbs-in-paths": "off",
|
|
47
70
|
"no-identical-paths": "error",
|
|
48
71
|
"no-invalid-media-type-examples": "error",
|
|
72
|
+
"no-invalid-parameter-examples": "off",
|
|
73
|
+
"no-invalid-schema-examples": "off",
|
|
49
74
|
"no-path-trailing-slash": "error",
|
|
50
75
|
"no-unresolved-refs": "error",
|
|
51
76
|
"operation-2xx-response": "warn",
|
|
@@ -60,10 +85,16 @@ Object {
|
|
|
60
85
|
"operation-tag-defined": "off",
|
|
61
86
|
"parameter-description": "off",
|
|
62
87
|
"path-declaration-must-exist": "error",
|
|
88
|
+
"path-excludes-patterns": "off",
|
|
63
89
|
"path-http-verbs-order": "error",
|
|
64
90
|
"path-not-include-query": "error",
|
|
65
91
|
"path-parameters-defined": "error",
|
|
92
|
+
"path-params-defined": "off",
|
|
93
|
+
"path-segment-plural": "off",
|
|
66
94
|
"paths-kebab-case": "off",
|
|
95
|
+
"required-string-property-missing-min-length": "off",
|
|
96
|
+
"response-contains-header": "off",
|
|
97
|
+
"scalar-property-missing-example": "off",
|
|
67
98
|
"security-defined": "error",
|
|
68
99
|
"spec": "error",
|
|
69
100
|
"spec-strict-refs": "off",
|
|
@@ -74,15 +105,28 @@ Object {
|
|
|
74
105
|
`;
|
|
75
106
|
|
|
76
107
|
exports[`resolveStyleguideConfig should resolve extends with local file config which contains path to nested config 1`] = `
|
|
77
|
-
|
|
78
|
-
"
|
|
108
|
+
{
|
|
109
|
+
"async2Decorators": {},
|
|
110
|
+
"async2Preprocessors": {},
|
|
111
|
+
"async2Rules": {
|
|
112
|
+
"channels-kebab-case": "off",
|
|
113
|
+
"no-channel-trailing-slash": "off",
|
|
114
|
+
},
|
|
115
|
+
"decorators": {},
|
|
79
116
|
"doNotResolveExamples": undefined,
|
|
80
|
-
"oas2Decorators":
|
|
81
|
-
"oas2Preprocessors":
|
|
82
|
-
"oas2Rules":
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
117
|
+
"oas2Decorators": {},
|
|
118
|
+
"oas2Preprocessors": {},
|
|
119
|
+
"oas2Rules": {
|
|
120
|
+
"boolean-parameter-prefixes": "error",
|
|
121
|
+
"request-mime-type": "off",
|
|
122
|
+
"response-contains-property": "off",
|
|
123
|
+
"response-mime-type": "off",
|
|
124
|
+
},
|
|
125
|
+
"oas3_0Decorators": {},
|
|
126
|
+
"oas3_0Preprocessors": {},
|
|
127
|
+
"oas3_0Rules": {
|
|
128
|
+
"boolean-parameter-prefixes": "error",
|
|
129
|
+
"component-name-unique": "off",
|
|
86
130
|
"no-empty-servers": "error",
|
|
87
131
|
"no-example-value-and-externalValue": "error",
|
|
88
132
|
"no-invalid-media-type-examples": "warn",
|
|
@@ -91,11 +135,17 @@ Object {
|
|
|
91
135
|
"no-server-variables-empty-enum": "error",
|
|
92
136
|
"no-undefined-server-variable": "error",
|
|
93
137
|
"no-unused-components": "warn",
|
|
138
|
+
"operation-4xx-problem-details-rfc7807": "off",
|
|
139
|
+
"request-mime-type": "off",
|
|
140
|
+
"response-contains-property": "off",
|
|
141
|
+
"response-mime-type": "off",
|
|
94
142
|
"spec-components-invalid-map-name": "error",
|
|
95
143
|
},
|
|
96
|
-
"oas3_1Decorators":
|
|
97
|
-
"oas3_1Preprocessors":
|
|
98
|
-
"oas3_1Rules":
|
|
144
|
+
"oas3_1Decorators": {},
|
|
145
|
+
"oas3_1Preprocessors": {},
|
|
146
|
+
"oas3_1Rules": {
|
|
147
|
+
"boolean-parameter-prefixes": "error",
|
|
148
|
+
"component-name-unique": "off",
|
|
99
149
|
"no-empty-servers": "error",
|
|
100
150
|
"no-example-value-and-externalValue": "error",
|
|
101
151
|
"no-invalid-media-type-examples": "warn",
|
|
@@ -104,39 +154,45 @@ Object {
|
|
|
104
154
|
"no-server-variables-empty-enum": "error",
|
|
105
155
|
"no-undefined-server-variable": "error",
|
|
106
156
|
"no-unused-components": "warn",
|
|
157
|
+
"operation-4xx-problem-details-rfc7807": "off",
|
|
158
|
+
"request-mime-type": "off",
|
|
159
|
+
"response-contains-property": "off",
|
|
160
|
+
"response-mime-type": "off",
|
|
107
161
|
"spec-components-invalid-map-name": "error",
|
|
108
162
|
},
|
|
109
|
-
"preprocessors":
|
|
163
|
+
"preprocessors": {},
|
|
110
164
|
"recommendedFallback": undefined,
|
|
111
|
-
"rules":
|
|
112
|
-
"assertions":
|
|
113
|
-
|
|
165
|
+
"rules": {
|
|
166
|
+
"assertions": [
|
|
167
|
+
{
|
|
114
168
|
"assertionId": "rule/path-item-get-defined",
|
|
115
169
|
"defined": true,
|
|
116
170
|
"message": "Every path item must have a GET operation.",
|
|
117
171
|
"property": "get",
|
|
118
172
|
"subject": "PathItem",
|
|
119
173
|
},
|
|
120
|
-
|
|
174
|
+
{
|
|
121
175
|
"assertionId": "rule/tag-description",
|
|
122
176
|
"message": "Tag description must be at least 13 characters and end with a full stop.",
|
|
123
177
|
"minLength": 13,
|
|
124
|
-
"pattern": "
|
|
178
|
+
"pattern": "/\\.$/",
|
|
125
179
|
"property": "description",
|
|
126
180
|
"severity": "error",
|
|
127
181
|
"subject": "Tag",
|
|
128
182
|
},
|
|
129
183
|
],
|
|
130
184
|
"boolean-parameter-prefixes": "error",
|
|
131
|
-
"component-name-unique": "off",
|
|
132
185
|
"info-contact": "off",
|
|
133
186
|
"info-license": "warn",
|
|
134
187
|
"info-license-url": "warn",
|
|
135
188
|
"local/operation-id-not-test": "error",
|
|
136
189
|
"no-ambiguous-paths": "warn",
|
|
137
190
|
"no-enum-type-mismatch": "error",
|
|
191
|
+
"no-http-verbs-in-paths": "off",
|
|
138
192
|
"no-identical-paths": "error",
|
|
139
193
|
"no-invalid-media-type-examples": "warn",
|
|
194
|
+
"no-invalid-parameter-examples": "off",
|
|
195
|
+
"no-invalid-schema-examples": "off",
|
|
140
196
|
"no-path-trailing-slash": "error",
|
|
141
197
|
"no-unresolved-refs": "error",
|
|
142
198
|
"operation-2xx-response": "error",
|
|
@@ -151,9 +207,16 @@ Object {
|
|
|
151
207
|
"operation-tag-defined": "off",
|
|
152
208
|
"parameter-description": "off",
|
|
153
209
|
"path-declaration-must-exist": "error",
|
|
210
|
+
"path-excludes-patterns": "off",
|
|
211
|
+
"path-http-verbs-order": "off",
|
|
154
212
|
"path-not-include-query": "error",
|
|
155
213
|
"path-parameters-defined": "error",
|
|
214
|
+
"path-params-defined": "off",
|
|
215
|
+
"path-segment-plural": "off",
|
|
156
216
|
"paths-kebab-case": "off",
|
|
217
|
+
"required-string-property-missing-min-length": "off",
|
|
218
|
+
"response-contains-header": "off",
|
|
219
|
+
"scalar-property-missing-example": "off",
|
|
157
220
|
"security-defined": "error",
|
|
158
221
|
"spec": "error",
|
|
159
222
|
"spec-strict-refs": "off",
|