Title: [Bug]: "null" + format · Issue #557 · python-openapi/openapi-core · GitHub
Open Graph Title: [Bug]: "null" + format · Issue #557 · python-openapi/openapi-core
X Title: [Bug]: "null" + format · Issue #557 · python-openapi/openapi-core
Description: Actual Behavior 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 ...
Open Graph Description: Actual Behavior 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....
X Description: Actual Behavior 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...
Opengraph URL: https://github.com/python-openapi/openapi-core/issues/557
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: \"null\" + format","articleBody":"### Actual Behavior\r\n\r\nI want to declare a formatted string, that can be null, as such:\r\n\r\n```\r\ntoday:\r\n type: [string, \"null\"]\r\n format: date\r\n```\r\n\r\nAs per https://github.com/OAI/OpenAPI-Specification/issues/3148, I believe the above is a valid v3.1 spec. I could be wrong.\r\n\r\nHowever, when I validate a response `{'today': None}` I get the following error:\r\n\r\n`Unable to unmarshal value None for format date: strptime() argument 1 must be str, not None`\r\n\r\n\r\n### Expected Behavior\r\n\r\nResponse `{'today': None}` should pass validaiton.\r\n\r\n### Steps to Reproduce\r\n\r\nI 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\r\n\r\n1. Run the test with `python -m unittest app.py ` and it fails. \r\n2. Comment out [line 35](https://github.com/Pylons/pyramid_openapi3/blob/941b967cfdc51d149fe6dd11221143b68c5f1b9e/examples/singlefile/app.py#L35) (to remove `format: date`) and the test passes. \r\n\r\n### OpenAPI Core Version\r\n\r\nLatest master\r\n\r\n### OpenAPI Core Integration\r\n\r\npyramid_openapi3\r\n\r\n### Affected Area(s)\r\n\r\nvalidation\r\n\r\n### References\r\n\r\n_No response_\r\n\r\n### Anything else we need to know?\r\n\r\n_No response_\r\n\r\n### Would you like to implement a fix?\r\n\r\nNone","author":{"url":"https://github.com/zupo","@type":"Person","name":"zupo"},"datePublished":"2023-04-13T22:02:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/557/openapi-core/issues/557"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:753a43d8-742d-c7d1-4c36-fc68632fc8f6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9C92:F5DBC:3B242E:516837:69774CE8 |
| html-safe-nonce | df086517fb1977f01cbeb5b53d302b792f712ca167d5958b5e93418a9a88c85a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzkyOkY1REJDOjNCMjQyRTo1MTY4Mzc6Njk3NzRDRTgiLCJ2aXNpdG9yX2lkIjoiNDk4NzU0MzYzNzY3NjQ3NzY3MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2ffc060964dc82364117884b40ae2313b75c43b16e00b654b24e9224834cfdf9 |
| hovercard-subject-tag | issue:1667191122 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-openapi/openapi-core/557/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0e1615a3b76425e0e99992606e0d275fcd59b889bd855b6716e47aae22d289e3/python-openapi/openapi-core/issues/557 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0e1615a3b76425e0e99992606e0d275fcd59b889bd855b6716e47aae22d289e3/python-openapi/openapi-core/issues/557 |
| og:image:alt | Actual Behavior 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.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | zupo |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3310064f35a62c06a4024ba37f41c06836f39376a095c2dfd2c4b693c34965be |
| turbo-cache-control | no-preview |
| go-import | github.com/python-openapi/openapi-core git https://github.com/python-openapi/openapi-core.git |
| octolytics-dimension-user_id | 126442889 |
| octolytics-dimension-user_login | python-openapi |
| octolytics-dimension-repository_id | 104200746 |
| octolytics-dimension-repository_nwo | python-openapi/openapi-core |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 104200746 |
| octolytics-dimension-repository_network_root_nwo | python-openapi/openapi-core |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 67d5f8d1d53c3cc4f49fc3bb8029933c3dc219e6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width