Skip to content

Commit

Permalink
Check for property values when augmenting schema.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Jun 18, 2024
1 parent ab57a68 commit 25886d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/src/tester/MergedOpenApiSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 25886d8

Please sign in to comment.