Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response validation incorrectly fails for undefined values for additionalProperties #856

Open
ghost91- opened this issue Jul 12, 2023 · 0 comments

Comments

@ghost91-
Copy link

Describe the bug
When using a schema that has additionalProperties set to some type, and when then returning an object that has an additional property set to undefined, the response validation fails. Instead, it should ignore the undefined values, because they will be filtered out when serializing the response to JSON.

To Reproduce
Steps to reproduce the behavior.

  • Create an OpenAPI spec that has some response with
    additionalProperties:
      type: string
  • Activate response validation
  • Return an object that has an additional property set to undefined

Actual behavior
undefined values make validation of additionalProperties fail

Expected behavior
undefined values are ignored for validation additionalProperties in response validation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant