Title: [0.16.2 regression] `{"key": null}` fails to validate as `{"type": "object"}` · Issue #442 · python-openapi/openapi-core · GitHub
Open Graph Title: [0.16.2 regression] `{"key": null}` fails to validate as `{"type": "object"}` · Issue #442 · python-openapi/openapi-core
X Title: [0.16.2 regression] `{"key": null}` fails to validate as `{"type": "object"}` · Issue #442 · python-openapi/openapi-core
Description: In 0.16.1, {"key": null} validated successfully against {"type": "object"}—an object that includes a null value is still an object. But in 0.16.2 this incorrectly raises openapi_core.unmarshalling.schemas.exceptions.InvalidSchemaValue: V...
Open Graph Description: In 0.16.1, {"key": null} validated successfully against {"type": "object"}—an object that includes a null value is still an object. But in 0.16.2 this incorrectly raises openapi_core.unmarshalling....
X Description: In 0.16.1, {"key": null} validated successfully against {"type": "object"}—an object that includes a null value is still an object. But in 0.16.2 this incorrectly rais...
Opengraph URL: https://github.com/python-openapi/openapi-core/issues/442
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[0.16.2 regression] `{\"key\": null}` fails to validate as `{\"type\": \"object\"}`","articleBody":"In 0.16.1, `{\"key\": null}` validated successfully against `{\"type\": \"object\"}`—an object that includes a `null` value is still an object. But in 0.16.2 this incorrectly raises `openapi_core.unmarshalling.schemas.exceptions.InvalidSchemaValue: Value None not valid for schema of type any: (\u003cValidationError: 'None for not nullable'\u003e,)`.\r\n\r\nThis regression was introduced by commit 692a9156abd99a63cfbaf018bf26470d0060b702 (#434).\r\n\r\nFull reproducible example:\r\n\r\n```python\r\nfrom openapi_core import Spec\r\nfrom openapi_core.testing import MockRequest\r\nfrom openapi_core.validation.request import openapi_request_validator\r\n\r\nspec = Spec.create(\r\n {\r\n \"openapi\": \"3.0.3\",\r\n \"info\": {\"title\": \"test\", \"version\": \"0\"},\r\n \"paths\": {\r\n \"/test\": {\r\n \"post\": {\r\n \"parameters\": [\r\n {\r\n \"name\": \"obj\",\r\n \"in\": \"query\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\"type\": \"object\"},\r\n }\r\n },\r\n },\r\n ],\r\n \"responses\": {\"200\": {\"description\": \"\"}},\r\n },\r\n },\r\n },\r\n },\r\n)\r\nrequest = MockRequest(\r\n \"http://localhost/\", \"post\", \"/test\", args={\"obj\": '{\"key\": null}'}\r\n)\r\nresult = openapi_request_validator.validate(spec, request)\r\nprint(result)\r\nresult.raise_for_errors()\r\n```\r\n","author":{"url":"https://github.com/andersk","@type":"Person","name":"andersk"},"datePublished":"2022-12-04T09:15:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/442/openapi-core/issues/442"}
| 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:28e55027-2efa-40c1-b913-50a6cc94e3a5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E950:3B7A72:5FF917:7FAFB7:696B70C9 |
| html-safe-nonce | 1f7ab47761cb29efc496984c79f13bff19c6f4e3f084e90e1d66089bd912c39a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOTUwOjNCN0E3Mjo1RkY5MTc6N0ZBRkI3OjY5NkI3MEM5IiwidmlzaXRvcl9pZCI6IjQ4MTMxNTQ2NzY4MjkyODY2MDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4feaec15aca96c5fd7cff1c8ae4bc7bdd88e9bd70088b223155d337cdcf49155 |
| hovercard-subject-tag | issue:1474630644 |
| 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/442/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fdc7443ad57724b5b8eb1b29fe4774e35c1c37bc98f1f186411bb6b99cadd6ba/python-openapi/openapi-core/issues/442 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fdc7443ad57724b5b8eb1b29fe4774e35c1c37bc98f1f186411bb6b99cadd6ba/python-openapi/openapi-core/issues/442 |
| og:image:alt | In 0.16.1, {"key": null} validated successfully against {"type": "object"}—an object that includes a null value is still an object. But in 0.16.2 this incorrectly raises openapi_core.unmarshalling.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | andersk |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| 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 | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width