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

Nullable Strings are not recognized, incorrect check for None if type is string #130

Open
tuxmania87 opened this issue Sep 18, 2023 · 1 comment

Comments

@tuxmania87
Copy link

I was digging through the code and it seems for string type None validation there is no check for nullable. It is in the code but validate from shortcuts pulls directly the jsonschema type validator which ignores nullables alltoghether.

I am looking for a possibility for it wo work.
Can be easily replicated by adding to the examle on README a nullable string and put it in the content.

@gogowitsch
Copy link

This project currently defaults to OpenAPI 3.1.0, but nullable was only supported until the OpenAPI 3.0.* spec.

You can either:

  • fix your spec by swapping nullable for type arrays or
  • fix your code by supplying the cls=OAS30Validator argument to the validate function.

See https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0

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

2 participants