We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I want to declare a formatted string, that can be null, as such:
today: type: [string, "null"] format: date
As per OAI/OpenAPI-Specification#3148, I believe the above is a valid v3.1 spec. I could be wrong.
However, when I validate a response {'today': None} I get the following error:
{'today': None}
Unable to unmarshal value None for format date: strptime() argument 1 must be str, not None
Response {'today': None} should pass validaiton.
I made a self-contained single-file example with a test that fails: https://github.com/Pylons/pyramid_openapi3/blob/example/null/examples/singlefile/app.py
python -m unittest app.py
format: date
Latest master
pyramid_openapi3
validation
No response
None
The text was updated successfully, but these errors were encountered:
What else can I try? Any additional info that I can provide?
Sorry, something went wrong.
+1
This is definitely valid OAS 3.1
The best workaround I have found is to go back to OAS 3.0 and add a nullable attribute until this is fixed.
Successfully merging a pull request may close this issue.
Actual Behavior
I want to declare a formatted string, that can be null, as such:
As per OAI/OpenAPI-Specification#3148, I believe the above is a valid v3.1 spec. I could be wrong.
However, when I validate a response
{'today': None}
I get the following error:Unable to unmarshal value None for format date: strptime() argument 1 must be str, not None
Expected Behavior
Response
{'today': None}
should pass validaiton.Steps to Reproduce
I made a self-contained single-file example with a test that fails: https://github.com/Pylons/pyramid_openapi3/blob/example/null/examples/singlefile/app.py
python -m unittest app.py
and it fails.format: date
) and the test passes.OpenAPI Core Version
Latest master
OpenAPI Core Integration
pyramid_openapi3
Affected Area(s)
validation
References
No response
Anything else we need to know?
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: