diff --git a/tools/src/tester/MergedOpenApiSpec.ts b/tools/src/tester/MergedOpenApiSpec.ts index 8ff253157..869dbee6d 100644 --- a/tools/src/tester/MergedOpenApiSpec.ts +++ b/tools/src/tester/MergedOpenApiSpec.ts @@ -35,7 +35,7 @@ export default class MergedOpenApiSpec { private inject_additional_properties(ctx: SpecificationContext, spec: OpenAPIV3.Document): void { const visitor = new SchemaVisitor((_ctx, schema: any) => { - if (('required' in schema) && ('properties' in schema) && !('additionalProperties' in schema)) { + if (schema.required !== null && schema.properties !== null && schema.additionalProperties === null) { // causes any undeclared field in the response to produce an error schema.additionalProperties = { not: true,