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 <dblock@amazon.com>
  • Loading branch information
dblock committed Jun 18, 2024
1 parent ab57a68 commit e80d5bb
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 && schema.properties && !schema.additionalProperties) {

Check failure on line 38 in tools/src/tester/MergedOpenApiSpec.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any value in conditional. An explicit comparison or type cast is required

Check failure on line 38 in tools/src/tester/MergedOpenApiSpec.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any value in conditional. An explicit comparison or type cast is required

Check failure on line 38 in tools/src/tester/MergedOpenApiSpec.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any value in conditional. An explicit comparison or type cast is required
// causes any undeclared field in the response to produce an error
schema.additionalProperties = {
not: true,
Expand Down

0 comments on commit e80d5bb

Please sign in to comment.