@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
|
@@ -19,7 +19,7 @@ function getPredicatesFromLocators(locators) {
|
|
|
19
19
|
return [matchKeysPredicate, filterInPredicate, filterOutPredicate].filter(utils_1.isTruthy);
|
|
20
20
|
}
|
|
21
21
|
function getAssertsToApply(assertion) {
|
|
22
|
-
const assertsToApply = utils_1.keysOf(asserts_1.asserts)
|
|
22
|
+
const assertsToApply = (0, utils_1.keysOf)(asserts_1.asserts)
|
|
23
23
|
.filter((assertName) => assertion.assertions[assertName] !== undefined)
|
|
24
24
|
.map((assertName) => {
|
|
25
25
|
return {
|
|
@@ -82,7 +82,7 @@ function buildVisitorObject(assertion, subjectVisitor) {
|
|
|
82
82
|
const context = assertion.where;
|
|
83
83
|
for (let index = 0; index < context.length; index++) {
|
|
84
84
|
const assertionDefinitionNode = context[index];
|
|
85
|
-
if (!utils_1.isString((_a = assertionDefinitionNode.subject) === null || _a === void 0 ? void 0 : _a.type)) {
|
|
85
|
+
if (!(0, utils_1.isString)((_a = assertionDefinitionNode.subject) === null || _a === void 0 ? void 0 : _a.type)) {
|
|
86
86
|
throw new Error(`${assertion.assertionId} -> where -> [${index}]: 'type' (String) is required`);
|
|
87
87
|
}
|
|
88
88
|
const locatorPredicates = getPredicatesFromLocators(assertionDefinitionNode.subject);
|
|
@@ -191,7 +191,7 @@ function runAssertion({ assert, ctx, assertionProperty, }) {
|
|
|
191
191
|
var _a;
|
|
192
192
|
const currentLocation = assert.name === 'ref' ? ctx.rawLocation : ctx.location;
|
|
193
193
|
if (assertionProperty) {
|
|
194
|
-
const values = ref_utils_1.isRef(ctx.node[assertionProperty])
|
|
194
|
+
const values = (0, ref_utils_1.isRef)(ctx.node[assertionProperty])
|
|
195
195
|
? (_a = ctx.resolve(ctx.node[assertionProperty])) === null || _a === void 0 ? void 0 : _a.node
|
|
196
196
|
: ctx.node[assertionProperty];
|
|
197
197
|
const rawValues = ctx.rawNode[assertionProperty];
|
|
@@ -7,7 +7,7 @@ const InfoContact = () => {
|
|
|
7
7
|
Info(info, { report, location }) {
|
|
8
8
|
if (!info.contact) {
|
|
9
9
|
report({
|
|
10
|
-
message: utils_1.missingRequiredField('Info', 'contact'),
|
|
10
|
+
message: (0, utils_1.missingRequiredField)('Info', 'contact'),
|
|
11
11
|
location: location.child('contact').key(),
|
|
12
12
|
});
|
|
13
13
|
}
|
|
@@ -8,10 +8,10 @@ const NoEnumTypeMismatch = () => {
|
|
|
8
8
|
if (schema.enum && !Array.isArray(schema.enum))
|
|
9
9
|
return;
|
|
10
10
|
if (schema.enum && schema.type && !Array.isArray(schema.type)) {
|
|
11
|
-
const typeMismatchedValues = schema.enum.filter((item) => !utils_1.matchesJsonSchemaType(item, schema.type, schema.nullable));
|
|
11
|
+
const typeMismatchedValues = schema.enum.filter((item) => !(0, utils_1.matchesJsonSchemaType)(item, schema.type, schema.nullable));
|
|
12
12
|
for (const mismatchedValue of typeMismatchedValues) {
|
|
13
13
|
report({
|
|
14
|
-
message: `All values of \`enum\` field must be of the same type as the \`type\` field: expected "${schema.type}" but received "${utils_1.oasTypeOf(mismatchedValue)}".`,
|
|
14
|
+
message: `All values of \`enum\` field must be of the same type as the \`type\` field: expected "${schema.type}" but received "${(0, utils_1.oasTypeOf)(mismatchedValue)}".`,
|
|
15
15
|
location: location.child(['enum', schema.enum.indexOf(mismatchedValue)]),
|
|
16
16
|
});
|
|
17
17
|
}
|
|
@@ -21,7 +21,7 @@ const NoEnumTypeMismatch = () => {
|
|
|
21
21
|
for (const enumValue of schema.enum) {
|
|
22
22
|
mismatchedResults[enumValue] = [];
|
|
23
23
|
for (const type of schema.type) {
|
|
24
|
-
const valid = utils_1.matchesJsonSchemaType(enumValue, type, schema.nullable);
|
|
24
|
+
const valid = (0, utils_1.matchesJsonSchemaType)(enumValue, type, schema.nullable);
|
|
25
25
|
if (!valid)
|
|
26
26
|
mismatchedResults[enumValue].push(type);
|
|
27
27
|
}
|
|
@@ -11,11 +11,11 @@ const NoHttpVerbsInPaths = ({ splitIntoWords }) => {
|
|
|
11
11
|
return;
|
|
12
12
|
const pathSegments = pathKey.split('/');
|
|
13
13
|
for (const pathSegment of pathSegments) {
|
|
14
|
-
if (!pathSegment || utils_1.isPathParameter(pathSegment))
|
|
14
|
+
if (!pathSegment || (0, utils_1.isPathParameter)(pathSegment))
|
|
15
15
|
continue;
|
|
16
16
|
const isHttpMethodIncluded = (method) => {
|
|
17
17
|
return splitIntoWords
|
|
18
|
-
? utils_1.splitCamelCaseIntoWords(pathSegment).has(method)
|
|
18
|
+
? (0, utils_1.splitCamelCaseIntoWords)(pathSegment).has(method)
|
|
19
19
|
: pathSegment.toLocaleLowerCase().includes(method);
|
|
20
20
|
};
|
|
21
21
|
for (const method of httpMethods) {
|
|
@@ -4,17 +4,17 @@ exports.NoInvalidParameterExamples = void 0;
|
|
|
4
4
|
const utils_1 = require("../utils");
|
|
5
5
|
const NoInvalidParameterExamples = (opts) => {
|
|
6
6
|
var _a;
|
|
7
|
-
const allowAdditionalProperties = (_a = utils_1.getAdditionalPropertiesOption(opts)) !== null && _a !== void 0 ? _a : false;
|
|
7
|
+
const allowAdditionalProperties = (_a = (0, utils_1.getAdditionalPropertiesOption)(opts)) !== null && _a !== void 0 ? _a : false;
|
|
8
8
|
return {
|
|
9
9
|
Parameter: {
|
|
10
10
|
leave(parameter, ctx) {
|
|
11
11
|
if (parameter.example) {
|
|
12
|
-
utils_1.validateExample(parameter.example, parameter.schema, ctx.location.child('example'), ctx, allowAdditionalProperties);
|
|
12
|
+
(0, utils_1.validateExample)(parameter.example, parameter.schema, ctx.location.child('example'), ctx, allowAdditionalProperties);
|
|
13
13
|
}
|
|
14
14
|
if (parameter.examples) {
|
|
15
15
|
for (const [key, example] of Object.entries(parameter.examples)) {
|
|
16
16
|
if ('value' in example) {
|
|
17
|
-
utils_1.validateExample(example.value, parameter.schema, ctx.location.child(['examples', key]), ctx, true);
|
|
17
|
+
(0, utils_1.validateExample)(example.value, parameter.schema, ctx.location.child(['examples', key]), ctx, true);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -4,17 +4,17 @@ exports.NoInvalidSchemaExamples = void 0;
|
|
|
4
4
|
const utils_1 = require("../utils");
|
|
5
5
|
const NoInvalidSchemaExamples = (opts) => {
|
|
6
6
|
var _a;
|
|
7
|
-
const allowAdditionalProperties = (_a = utils_1.getAdditionalPropertiesOption(opts)) !== null && _a !== void 0 ? _a : false;
|
|
7
|
+
const allowAdditionalProperties = (_a = (0, utils_1.getAdditionalPropertiesOption)(opts)) !== null && _a !== void 0 ? _a : false;
|
|
8
8
|
return {
|
|
9
9
|
Schema: {
|
|
10
10
|
leave(schema, ctx) {
|
|
11
11
|
if (schema.examples) {
|
|
12
12
|
for (const example of schema.examples) {
|
|
13
|
-
utils_1.validateExample(example, schema, ctx.location.child(['examples', schema.examples.indexOf(example)]), ctx, allowAdditionalProperties);
|
|
13
|
+
(0, utils_1.validateExample)(example, schema, ctx.location.child(['examples', schema.examples.indexOf(example)]), ctx, allowAdditionalProperties);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
if (schema.example) {
|
|
17
|
-
utils_1.validateExample(schema.example, schema, ctx.location.child('example'), ctx, true);
|
|
17
|
+
(0, utils_1.validateExample)(schema.example, schema, ctx.location.child('example'), ctx, true);
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
},
|
|
@@ -7,7 +7,7 @@ const Operation2xxResponse = ({ validateWebhooks }) => {
|
|
|
7
7
|
Paths: {
|
|
8
8
|
Responses(responses, { report }) {
|
|
9
9
|
const codes = Object.keys(responses || {});
|
|
10
|
-
utils_1.validateResponseCodes(codes, '2XX', { report });
|
|
10
|
+
(0, utils_1.validateResponseCodes)(codes, '2XX', { report });
|
|
11
11
|
},
|
|
12
12
|
},
|
|
13
13
|
WebhooksMap: {
|
|
@@ -15,7 +15,7 @@ const Operation2xxResponse = ({ validateWebhooks }) => {
|
|
|
15
15
|
if (!validateWebhooks)
|
|
16
16
|
return;
|
|
17
17
|
const codes = Object.keys(responses || {});
|
|
18
|
-
utils_1.validateResponseCodes(codes, '2XX', { report });
|
|
18
|
+
(0, utils_1.validateResponseCodes)(codes, '2XX', { report });
|
|
19
19
|
},
|
|
20
20
|
},
|
|
21
21
|
};
|
|
@@ -7,7 +7,7 @@ const Operation4xxResponse = ({ validateWebhooks }) => {
|
|
|
7
7
|
Paths: {
|
|
8
8
|
Responses(responses, { report }) {
|
|
9
9
|
const codes = Object.keys(responses || {});
|
|
10
|
-
utils_1.validateResponseCodes(codes, '4XX', { report });
|
|
10
|
+
(0, utils_1.validateResponseCodes)(codes, '4XX', { report });
|
|
11
11
|
},
|
|
12
12
|
},
|
|
13
13
|
WebhooksMap: {
|
|
@@ -15,7 +15,7 @@ const Operation4xxResponse = ({ validateWebhooks }) => {
|
|
|
15
15
|
if (!validateWebhooks)
|
|
16
16
|
return;
|
|
17
17
|
const codes = Object.keys(responses || {});
|
|
18
|
-
utils_1.validateResponseCodes(codes, '4XX', { report });
|
|
18
|
+
(0, utils_1.validateResponseCodes)(codes, '4XX', { report });
|
|
19
19
|
},
|
|
20
20
|
},
|
|
21
21
|
};
|
|
@@ -5,7 +5,7 @@ const utils_1 = require("../utils");
|
|
|
5
5
|
const OperationDescription = () => {
|
|
6
6
|
return {
|
|
7
7
|
Operation(operation, ctx) {
|
|
8
|
-
utils_1.validateDefinedAndNonEmpty('description', operation, ctx);
|
|
8
|
+
(0, utils_1.validateDefinedAndNonEmpty)('description', operation, ctx);
|
|
9
9
|
},
|
|
10
10
|
};
|
|
11
11
|
};
|
|
@@ -17,7 +17,7 @@ const PathSegmentPlural = (opts) => {
|
|
|
17
17
|
for (const pathSegment of pathSegments) {
|
|
18
18
|
if (exceptions && exceptions.includes(pathSegment))
|
|
19
19
|
continue;
|
|
20
|
-
if (!utils_1.isPathParameter(pathSegment) && utils_1.isSingular(pathSegment)) {
|
|
20
|
+
if (!(0, utils_1.isPathParameter)(pathSegment) && (0, utils_1.isSingular)(pathSegment)) {
|
|
21
21
|
report({
|
|
22
22
|
message: `path segment \`${pathSegment}\` should be plural.`,
|
|
23
23
|
location: location.key(),
|
|
@@ -9,8 +9,8 @@ const ResponseContainsHeader = (options) => {
|
|
|
9
9
|
Response: {
|
|
10
10
|
enter: (response, { report, location, key }) => {
|
|
11
11
|
const expectedHeaders = names[key] ||
|
|
12
|
-
names[utils_1.getMatchingStatusCodeRange(key)] ||
|
|
13
|
-
names[utils_1.getMatchingStatusCodeRange(key).toLowerCase()] ||
|
|
12
|
+
names[(0, utils_1.getMatchingStatusCodeRange)(key)] ||
|
|
13
|
+
names[(0, utils_1.getMatchingStatusCodeRange)(key).toLowerCase()] ||
|
|
14
14
|
[];
|
|
15
15
|
for (const expectedHeader of expectedHeaders) {
|
|
16
16
|
if (!(response === null || response === void 0 ? void 0 : response.headers) ||
|
|
@@ -18,7 +18,7 @@ const SpecStrictRefs = () => {
|
|
|
18
18
|
return {
|
|
19
19
|
any(_node, { report, rawNode, rawLocation, type }) {
|
|
20
20
|
const shouldCheck = !nodesToSkip.includes(type.name);
|
|
21
|
-
if (shouldCheck && ref_utils_1.isRef(rawNode)) {
|
|
21
|
+
if (shouldCheck && (0, ref_utils_1.isRef)(rawNode)) {
|
|
22
22
|
report({
|
|
23
23
|
message: 'Field $ref is not expected here.',
|
|
24
24
|
location: rawLocation.child('$ref').key(),
|
package/lib/rules/common/spec.js
CHANGED
|
@@ -9,7 +9,7 @@ const Spec = () => {
|
|
|
9
9
|
return {
|
|
10
10
|
any(node, { report, type, location, rawLocation, key, resolve, ignoreNextVisitorsOnNode }) {
|
|
11
11
|
var _a, _b, _c, _d, _e, _f;
|
|
12
|
-
const nodeType = utils_1.oasTypeOf(node);
|
|
12
|
+
const nodeType = (0, utils_1.oasTypeOf)(node);
|
|
13
13
|
const refLocation = rawLocation !== location ? rawLocation : undefined;
|
|
14
14
|
if (type.items) {
|
|
15
15
|
if (nodeType !== 'array') {
|
|
@@ -43,7 +43,7 @@ const Spec = () => {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
const allowed = (_a = type.allowed) === null || _a === void 0 ? void 0 : _a.call(type, node);
|
|
46
|
-
if (allowed && utils_2.isPlainObject(node)) {
|
|
46
|
+
if (allowed && (0, utils_2.isPlainObject)(node)) {
|
|
47
47
|
for (const propName in node) {
|
|
48
48
|
if (allowed.includes(propName) ||
|
|
49
49
|
(type.extensionsPrefix && propName.startsWith(type.extensionsPrefix)) ||
|
|
@@ -80,17 +80,17 @@ const Spec = () => {
|
|
|
80
80
|
propType = type.additionalProperties;
|
|
81
81
|
if (typeof propType === 'function')
|
|
82
82
|
propType = propType(propValue, propName);
|
|
83
|
-
if (types_1.isNamedType(propType)) {
|
|
83
|
+
if ((0, types_1.isNamedType)(propType)) {
|
|
84
84
|
continue; // do nothing for named schema, it is executed with the next any call
|
|
85
85
|
}
|
|
86
86
|
const propSchema = propType;
|
|
87
|
-
const propValueType = utils_1.oasTypeOf(propValue);
|
|
87
|
+
const propValueType = (0, utils_1.oasTypeOf)(propValue);
|
|
88
88
|
if (propSchema === undefined) {
|
|
89
89
|
if (propName.startsWith('x-'))
|
|
90
90
|
continue;
|
|
91
91
|
report({
|
|
92
92
|
message: `Property \`${propName}\` is not expected here.`,
|
|
93
|
-
suggest: utils_1.getSuggest(propName, Object.keys(type.properties)),
|
|
93
|
+
suggest: (0, utils_1.getSuggest)(propName, Object.keys(type.properties)),
|
|
94
94
|
from: refLocation,
|
|
95
95
|
location: propLocation.key(),
|
|
96
96
|
});
|
|
@@ -99,24 +99,24 @@ const Spec = () => {
|
|
|
99
99
|
if (propSchema === null) {
|
|
100
100
|
continue; // just defined, no validation
|
|
101
101
|
}
|
|
102
|
-
if (propSchema.resolvable !== false && ref_utils_1.isRef(propValue)) {
|
|
102
|
+
if (propSchema.resolvable !== false && (0, ref_utils_1.isRef)(propValue)) {
|
|
103
103
|
propValue = resolve(propValue).node;
|
|
104
104
|
}
|
|
105
105
|
if (propSchema.items && ((_c = propSchema.items) === null || _c === void 0 ? void 0 : _c.enum) && Array.isArray(propValue)) {
|
|
106
106
|
for (let i = 0; i < propValue.length; i++) {
|
|
107
|
-
utils_1.validateSchemaEnumType((_d = propSchema.items) === null || _d === void 0 ? void 0 : _d.enum, propValue[i], propName, refLocation, {
|
|
107
|
+
(0, utils_1.validateSchemaEnumType)((_d = propSchema.items) === null || _d === void 0 ? void 0 : _d.enum, propValue[i], propName, refLocation, {
|
|
108
108
|
report,
|
|
109
109
|
location: location.child([propName, i]),
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
if (propSchema.enum) {
|
|
114
|
-
utils_1.validateSchemaEnumType(propSchema.enum, propValue, propName, refLocation, {
|
|
114
|
+
(0, utils_1.validateSchemaEnumType)(propSchema.enum, propValue, propName, refLocation, {
|
|
115
115
|
report,
|
|
116
116
|
location: location.child([propName]),
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
|
-
else if (propSchema.type && !utils_1.matchesJsonSchemaType(propValue, propSchema.type, false)) {
|
|
119
|
+
else if (propSchema.type && !(0, utils_1.matchesJsonSchemaType)(propValue, propSchema.type, false)) {
|
|
120
120
|
report({
|
|
121
121
|
message: `Expected type \`${propSchema.type}\` but got \`${propValueType}\`.`,
|
|
122
122
|
from: refLocation,
|
|
@@ -128,9 +128,9 @@ const Spec = () => {
|
|
|
128
128
|
const itemsType = (_f = propSchema.items) === null || _f === void 0 ? void 0 : _f.type;
|
|
129
129
|
for (let i = 0; i < propValue.length; i++) {
|
|
130
130
|
const item = propValue[i];
|
|
131
|
-
if (!utils_1.matchesJsonSchemaType(item, itemsType, false)) {
|
|
131
|
+
if (!(0, utils_1.matchesJsonSchemaType)(item, itemsType, false)) {
|
|
132
132
|
report({
|
|
133
|
-
message: `Expected type \`${itemsType}\` but got \`${utils_1.oasTypeOf(item)}\`.`,
|
|
133
|
+
message: `Expected type \`${itemsType}\` but got \`${(0, utils_1.oasTypeOf)(item)}\`.`,
|
|
134
134
|
from: refLocation,
|
|
135
135
|
location: propLocation.child([i]),
|
|
136
136
|
});
|
|
@@ -1,47 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const rules:
|
|
3
|
-
spec: Oas2Rule;
|
|
4
|
-
'no-invalid-schema-examples': any;
|
|
5
|
-
'no-invalid-parameter-examples': any;
|
|
6
|
-
'info-contact': Oas2Rule;
|
|
7
|
-
'info-license': Oas2Rule;
|
|
8
|
-
'info-license-url': Oas2Rule;
|
|
9
|
-
'tag-description': Oas2Rule;
|
|
10
|
-
'tags-alphabetical': Oas2Rule;
|
|
11
|
-
'paths-kebab-case': Oas2Rule;
|
|
12
|
-
'no-enum-type-mismatch': Oas2Rule;
|
|
13
|
-
'boolean-parameter-prefixes': Oas2Rule;
|
|
14
|
-
'no-path-trailing-slash': Oas2Rule;
|
|
15
|
-
'operation-2xx-response': Oas2Rule;
|
|
16
|
-
'operation-4xx-response': Oas2Rule;
|
|
17
|
-
assertions: Oas2Rule;
|
|
18
|
-
'operation-operationId-unique': Oas2Rule;
|
|
19
|
-
'operation-parameters-unique': Oas2Rule;
|
|
20
|
-
'path-parameters-defined': Oas2Rule;
|
|
21
|
-
'operation-tag-defined': Oas2Rule;
|
|
22
|
-
'path-declaration-must-exist': Oas2Rule;
|
|
23
|
-
'operation-operationId-url-safe': Oas2Rule;
|
|
24
|
-
'operation-operationId': Oas2Rule;
|
|
25
|
-
'operation-summary': Oas2Rule;
|
|
26
|
-
'operation-description': Oas2Rule;
|
|
27
|
-
'path-not-include-query': Oas2Rule;
|
|
28
|
-
'path-params-defined': Oas2Rule;
|
|
29
|
-
'parameter-description': Oas2Rule;
|
|
30
|
-
'operation-singular-tag': Oas2Rule;
|
|
31
|
-
'security-defined': Oas2Rule;
|
|
32
|
-
'no-unresolved-refs': Oas2Rule;
|
|
33
|
-
'no-identical-paths': Oas2Rule;
|
|
34
|
-
'no-ambiguous-paths': Oas2Rule;
|
|
35
|
-
'path-http-verbs-order': Oas2Rule;
|
|
36
|
-
'no-http-verbs-in-paths': Oas2Rule;
|
|
37
|
-
'path-excludes-patterns': Oas2Rule;
|
|
38
|
-
'request-mime-type': Oas2Rule;
|
|
39
|
-
'response-mime-type': Oas2Rule;
|
|
40
|
-
'path-segment-plural': Oas2Rule;
|
|
41
|
-
'response-contains-header': Oas2Rule;
|
|
42
|
-
'response-contains-property': Oas2Rule;
|
|
43
|
-
'scalar-property-missing-example': import("../../visitors").Oas3Rule | Oas2Rule;
|
|
44
|
-
'required-string-property-missing-min-length': import("../../visitors").Oas3Rule;
|
|
45
|
-
'spec-strict-refs': import("../../visitors").Oas3Rule | Oas2Rule;
|
|
46
|
-
};
|
|
1
|
+
import type { Oas2RuleSet } from 'core/src/oas-types';
|
|
2
|
+
export declare const rules: Oas2RuleSet<'built-in'>;
|
|
47
3
|
export declare const preprocessors: {};
|
|
@@ -5,11 +5,11 @@ const utils_1 = require("../../utils");
|
|
|
5
5
|
const RequestMimeType = ({ allowedValues }) => {
|
|
6
6
|
return {
|
|
7
7
|
Root(root, ctx) {
|
|
8
|
-
utils_1.validateMimeType({ type: 'consumes', value: root }, ctx, allowedValues);
|
|
8
|
+
(0, utils_1.validateMimeType)({ type: 'consumes', value: root }, ctx, allowedValues);
|
|
9
9
|
},
|
|
10
10
|
Operation: {
|
|
11
11
|
leave(operation, ctx) {
|
|
12
|
-
utils_1.validateMimeType({ type: 'consumes', value: operation }, ctx, allowedValues);
|
|
12
|
+
(0, utils_1.validateMimeType)({ type: 'consumes', value: operation }, ctx, allowedValues);
|
|
13
13
|
},
|
|
14
14
|
},
|
|
15
15
|
};
|
|
@@ -19,8 +19,8 @@ const ResponseContainsProperty = (options) => {
|
|
|
19
19
|
if (schema.type !== 'object')
|
|
20
20
|
return;
|
|
21
21
|
const expectedProperties = names[key] ||
|
|
22
|
-
names[utils_1.getMatchingStatusCodeRange(key)] ||
|
|
23
|
-
names[utils_1.getMatchingStatusCodeRange(key).toLowerCase()] ||
|
|
22
|
+
names[(0, utils_1.getMatchingStatusCodeRange)(key)] ||
|
|
23
|
+
names[(0, utils_1.getMatchingStatusCodeRange)(key).toLowerCase()] ||
|
|
24
24
|
[];
|
|
25
25
|
for (const expectedProperty of expectedProperties) {
|
|
26
26
|
if (!((_a = schema.properties) === null || _a === void 0 ? void 0 : _a[expectedProperty])) {
|
|
@@ -5,11 +5,11 @@ const utils_1 = require("../../utils");
|
|
|
5
5
|
const ResponseMimeType = ({ allowedValues }) => {
|
|
6
6
|
return {
|
|
7
7
|
Root(root, ctx) {
|
|
8
|
-
utils_1.validateMimeType({ type: 'produces', value: root }, ctx, allowedValues);
|
|
8
|
+
(0, utils_1.validateMimeType)({ type: 'produces', value: root }, ctx, allowedValues);
|
|
9
9
|
},
|
|
10
10
|
Operation: {
|
|
11
11
|
leave(operation, ctx) {
|
|
12
|
-
utils_1.validateMimeType({ type: 'produces', value: operation }, ctx, allowedValues);
|
|
12
|
+
(0, utils_1.validateMimeType)({ type: 'produces', value: operation }, ctx, allowedValues);
|
|
13
13
|
},
|
|
14
14
|
},
|
|
15
15
|
};
|
package/lib/rules/oas3/index.js
CHANGED
|
@@ -65,7 +65,6 @@ exports.rules = {
|
|
|
65
65
|
assertions: assertions_1.Assertions,
|
|
66
66
|
'operation-operationId-unique': operation_operationId_unique_1.OperationIdUnique,
|
|
67
67
|
'operation-parameters-unique': operation_parameters_unique_1.OperationParametersUnique,
|
|
68
|
-
'path-parameters-defined': path_params_defined_1.PathParamsDefined,
|
|
69
68
|
'operation-tag-defined': operation_tag_defined_1.OperationTagDefined,
|
|
70
69
|
'no-example-value-and-externalValue': no_example_value_and_externalValue_1.NoExampleValueAndExternalValue,
|
|
71
70
|
'no-enum-type-mismatch': no_enum_type_mismatch_1.NoEnumTypeMismatch,
|
|
@@ -82,6 +81,7 @@ exports.rules = {
|
|
|
82
81
|
'operation-description': operation_description_1.OperationDescription,
|
|
83
82
|
'no-unused-components': no_unused_components_1.NoUnusedComponents,
|
|
84
83
|
'path-not-include-query': path_not_include_query_1.PathNotIncludeQuery,
|
|
84
|
+
'path-parameters-defined': path_params_defined_1.PathParamsDefined,
|
|
85
85
|
'path-params-defined': path_params_defined_1.PathParamsDefined,
|
|
86
86
|
'parameter-description': parameter_description_1.ParameterDescription,
|
|
87
87
|
'operation-singular-tag': operation_singular_tag_1.OperationSingularTag,
|
|
@@ -5,7 +5,7 @@ const ref_utils_1 = require("../../ref-utils");
|
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
6
|
const ValidContentExamples = (opts) => {
|
|
7
7
|
var _a;
|
|
8
|
-
const allowAdditionalProperties = (_a = utils_1.getAdditionalPropertiesOption(opts)) !== null && _a !== void 0 ? _a : false;
|
|
8
|
+
const allowAdditionalProperties = (_a = (0, utils_1.getAdditionalPropertiesOption)(opts)) !== null && _a !== void 0 ? _a : false;
|
|
9
9
|
return {
|
|
10
10
|
MediaType: {
|
|
11
11
|
leave(mediaType, ctx) {
|
|
@@ -21,14 +21,14 @@ const ValidContentExamples = (opts) => {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
function resolveAndValidateExample(example, location, isMultiple) {
|
|
24
|
-
if (ref_utils_1.isRef(example)) {
|
|
24
|
+
if ((0, ref_utils_1.isRef)(example)) {
|
|
25
25
|
const resolved = resolve(example);
|
|
26
26
|
if (!resolved.location)
|
|
27
27
|
return;
|
|
28
28
|
location = isMultiple ? resolved.location.child('value') : resolved.location;
|
|
29
29
|
example = resolved.node;
|
|
30
30
|
}
|
|
31
|
-
utils_1.validateExample(isMultiple ? example.value : example, mediaType.schema, location, ctx, allowAdditionalProperties);
|
|
31
|
+
(0, utils_1.validateExample)(isMultiple ? example.value : example, mediaType.schema, location, ctx, allowAdditionalProperties);
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
},
|
|
@@ -23,11 +23,11 @@ const Operation4xxProblemDetailsRfc7807 = () => {
|
|
|
23
23
|
return key !== 'application/problem+json';
|
|
24
24
|
},
|
|
25
25
|
enter(media, ctx) {
|
|
26
|
-
utils_1.validateDefinedAndNonEmpty('schema', media, ctx);
|
|
26
|
+
(0, utils_1.validateDefinedAndNonEmpty)('schema', media, ctx);
|
|
27
27
|
},
|
|
28
28
|
SchemaProperties(schema, ctx) {
|
|
29
|
-
utils_1.validateDefinedAndNonEmpty('type', schema, ctx);
|
|
30
|
-
utils_1.validateDefinedAndNonEmpty('title', schema, ctx);
|
|
29
|
+
(0, utils_1.validateDefinedAndNonEmpty)('type', schema, ctx);
|
|
30
|
+
(0, utils_1.validateDefinedAndNonEmpty)('title', schema, ctx);
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
33
|
},
|
|
@@ -39,12 +39,12 @@ const RemoveUnusedComponents = () => {
|
|
|
39
39
|
const componentChild = root.components[componentType];
|
|
40
40
|
delete componentChild[name];
|
|
41
41
|
data.removedCount++;
|
|
42
|
-
if (utils_1.isEmptyObject(componentChild)) {
|
|
42
|
+
if ((0, utils_1.isEmptyObject)(componentChild)) {
|
|
43
43
|
delete root.components[componentType];
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
|
-
if (utils_1.isEmptyObject(root.components)) {
|
|
47
|
+
if ((0, utils_1.isEmptyObject)(root.components)) {
|
|
48
48
|
delete root.components;
|
|
49
49
|
}
|
|
50
50
|
},
|
|
@@ -7,14 +7,14 @@ const RequestMimeType = ({ allowedValues }) => {
|
|
|
7
7
|
Paths: {
|
|
8
8
|
RequestBody: {
|
|
9
9
|
leave(requestBody, ctx) {
|
|
10
|
-
utils_1.validateMimeTypeOAS3({ type: 'consumes', value: requestBody }, ctx, allowedValues);
|
|
10
|
+
(0, utils_1.validateMimeTypeOAS3)({ type: 'consumes', value: requestBody }, ctx, allowedValues);
|
|
11
11
|
},
|
|
12
12
|
},
|
|
13
13
|
Callback: {
|
|
14
14
|
RequestBody() { },
|
|
15
15
|
Response: {
|
|
16
16
|
leave(response, ctx) {
|
|
17
|
-
utils_1.validateMimeTypeOAS3({ type: 'consumes', value: response }, ctx, allowedValues);
|
|
17
|
+
(0, utils_1.validateMimeTypeOAS3)({ type: 'consumes', value: response }, ctx, allowedValues);
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
20
|
},
|
|
@@ -22,7 +22,7 @@ const RequestMimeType = ({ allowedValues }) => {
|
|
|
22
22
|
WebhooksMap: {
|
|
23
23
|
Response: {
|
|
24
24
|
leave(response, ctx) {
|
|
25
|
-
utils_1.validateMimeTypeOAS3({ type: 'consumes', value: response }, ctx, allowedValues);
|
|
25
|
+
(0, utils_1.validateMimeTypeOAS3)({ type: 'consumes', value: response }, ctx, allowedValues);
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
28
|
},
|
|
@@ -20,8 +20,8 @@ const ResponseContainsProperty = (options) => {
|
|
|
20
20
|
if (schema.type !== 'object')
|
|
21
21
|
return;
|
|
22
22
|
const expectedProperties = names[key] ||
|
|
23
|
-
names[utils_1.getMatchingStatusCodeRange(key)] ||
|
|
24
|
-
names[utils_1.getMatchingStatusCodeRange(key).toLowerCase()] ||
|
|
23
|
+
names[(0, utils_1.getMatchingStatusCodeRange)(key)] ||
|
|
24
|
+
names[(0, utils_1.getMatchingStatusCodeRange)(key).toLowerCase()] ||
|
|
25
25
|
[];
|
|
26
26
|
for (const expectedProperty of expectedProperties) {
|
|
27
27
|
if (!((_a = schema.properties) === null || _a === void 0 ? void 0 : _a[expectedProperty])) {
|
|
@@ -7,14 +7,14 @@ const ResponseMimeType = ({ allowedValues }) => {
|
|
|
7
7
|
Paths: {
|
|
8
8
|
Response: {
|
|
9
9
|
leave(response, ctx) {
|
|
10
|
-
utils_1.validateMimeTypeOAS3({ type: 'produces', value: response }, ctx, allowedValues);
|
|
10
|
+
(0, utils_1.validateMimeTypeOAS3)({ type: 'produces', value: response }, ctx, allowedValues);
|
|
11
11
|
},
|
|
12
12
|
},
|
|
13
13
|
Callback: {
|
|
14
14
|
Response() { },
|
|
15
15
|
RequestBody: {
|
|
16
16
|
leave(requestBody, ctx) {
|
|
17
|
-
utils_1.validateMimeTypeOAS3({ type: 'produces', value: requestBody }, ctx, allowedValues);
|
|
17
|
+
(0, utils_1.validateMimeTypeOAS3)({ type: 'produces', value: requestBody }, ctx, allowedValues);
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
20
|
},
|
|
@@ -22,7 +22,7 @@ const ResponseMimeType = ({ allowedValues }) => {
|
|
|
22
22
|
WebhooksMap: {
|
|
23
23
|
RequestBody: {
|
|
24
24
|
leave(requestBody, ctx) {
|
|
25
|
-
utils_1.validateMimeTypeOAS3({ type: 'produces', value: requestBody }, ctx, allowedValues);
|
|
25
|
+
(0, utils_1.validateMimeTypeOAS3)({ type: 'produces', value: requestBody }, ctx, allowedValues);
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
28
|
},
|
package/lib/rules/utils.js
CHANGED
|
@@ -90,7 +90,7 @@ function getSuggest(given, variants) {
|
|
|
90
90
|
exports.getSuggest = getSuggest;
|
|
91
91
|
function validateExample(example, schema, dataLoc, { resolve, location, report }, allowAdditionalProperties) {
|
|
92
92
|
try {
|
|
93
|
-
const { valid, errors } = ajv_1.validateJsonSchema(example, schema, location.child('schema'), dataLoc.pointer, resolve, allowAdditionalProperties);
|
|
93
|
+
const { valid, errors } = (0, ajv_1.validateJsonSchema)(example, schema, location.child('schema'), dataLoc.pointer, resolve, allowAdditionalProperties);
|
|
94
94
|
if (!valid) {
|
|
95
95
|
for (const error of errors) {
|
|
96
96
|
report({
|
|
@@ -119,9 +119,9 @@ function getAdditionalPropertiesOption(opts) {
|
|
|
119
119
|
return opts.allowAdditionalProperties;
|
|
120
120
|
}
|
|
121
121
|
if (opts.allowAdditionalProperties !== undefined) {
|
|
122
|
-
utils_1.showErrorForDeprecatedField('disallowAdditionalProperties', 'allowAdditionalProperties', undefined);
|
|
122
|
+
(0, utils_1.showErrorForDeprecatedField)('disallowAdditionalProperties', 'allowAdditionalProperties', undefined);
|
|
123
123
|
}
|
|
124
|
-
utils_1.showWarningForDeprecatedField('disallowAdditionalProperties', 'allowAdditionalProperties');
|
|
124
|
+
(0, utils_1.showWarningForDeprecatedField)('disallowAdditionalProperties', 'allowAdditionalProperties');
|
|
125
125
|
return !opts.disallowAdditionalProperties;
|
|
126
126
|
}
|
|
127
127
|
exports.getAdditionalPropertiesOption = getAdditionalPropertiesOption;
|