Title: Optional nullable model properties are deserialized from `UNSET` to `None` · Issue #381 · openapi-generators/openapi-python-client · GitHub
Open Graph Title: Optional nullable model properties are deserialized from `UNSET` to `None` · Issue #381 · openapi-generators/openapi-python-client
X Title: Optional nullable model properties are deserialized from `UNSET` to `None` · Issue #381 · openapi-generators/openapi-python-client
Description: Describe the bug If a model has an optional nullable model property, then in the from_dict, if the key is not present in the dictionary, it is deserialized as None instead of UNSET. This is also true for enum properties, and probably oth...
Open Graph Description: Describe the bug If a model has an optional nullable model property, then in the from_dict, if the key is not present in the dictionary, it is deserialized as None instead of UNSET. This is also tr...
X Description: Describe the bug If a model has an optional nullable model property, then in the from_dict, if the key is not present in the dictionary, it is deserialized as None instead of UNSET. This is also tr...
Opengraph URL: https://github.com/openapi-generators/openapi-python-client/issues/381
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Optional nullable model properties are deserialized from `UNSET` to `None`","articleBody":"**Describe the bug**\r\nIf a model has an optional nullable model property, then in the `from_dict`, if the key is not present in the dictionary, it is deserialized as `None` instead of `UNSET`.\r\n\r\nThis is also true for enum properties, and probably other types as well, but we haven't done an exhaustive search.\r\n\r\n**To Reproduce**\r\nThis can already be seen in `end_to_end_tests/golden-record/my_test_api_client/models/a_model.py:345`, where the deserialized value is initialized to `None`.\r\n\r\n**Expected behavior**\r\n`UNSET` keys should be deserialized as `UNSET`.\r\n\r\n**OpenAPI Spec File**\r\nExisting `openapi.json`\r\n\r\n**Desktop (please complete the following information):**\r\n - OS: [e.g. macOS 10.15.1]\r\n - Python Version: [e.g. 3.8.0]\r\n - openapi-python-client version [e.g. 0.1.0]\r\n\r\n**Additional context**\r\n","author":{"url":"https://github.com/forest-benchling","@type":"Person","name":"forest-benchling"},"datePublished":"2021-04-07T13:54:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/381/openapi-python-client/issues/381"}
| 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:14a32d57-2820-7cca-f672-64f77ffb334f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E49C:5695:18B61B:20C6CA:69809338 |
| html-safe-nonce | c5de2c6ba95a8b9fcf5884664a2c78f8f7781745282cf1a20162ac065d5918fb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNDlDOjU2OTU6MThCNjFCOjIwQzZDQTo2OTgwOTMzOCIsInZpc2l0b3JfaWQiOiIyMzA0NjEwOTY1MjU1MTMxOTYwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f925d41fcc099e9fc7a5547e5d9926ec4865fe9f38a2087887a47cb296581463 |
| hovercard-subject-tag | issue:852435921 |
| 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/openapi-generators/openapi-python-client/381/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2c73e826f1a2e177546f0b5aa5af41bf0b90ba79414db410cee49889c3185841/openapi-generators/openapi-python-client/issues/381 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2c73e826f1a2e177546f0b5aa5af41bf0b90ba79414db410cee49889c3185841/openapi-generators/openapi-python-client/issues/381 |
| og:image:alt | Describe the bug If a model has an optional nullable model property, then in the from_dict, if the key is not present in the dictionary, it is deserialized as None instead of UNSET. This is also tr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | forest-benchling |
| hostname | github.com |
| expected-hostname | github.com |
| None | 469777838102ab297ec4fcad28d2f2800ba15f98fafe1027761c30ba1171be52 |
| turbo-cache-control | no-preview |
| go-import | github.com/openapi-generators/openapi-python-client git https://github.com/openapi-generators/openapi-python-client.git |
| octolytics-dimension-user_id | 84925606 |
| octolytics-dimension-user_login | openapi-generators |
| octolytics-dimension-repository_id | 240776275 |
| octolytics-dimension-repository_nwo | openapi-generators/openapi-python-client |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 240776275 |
| octolytics-dimension-repository_network_root_nwo | openapi-generators/openapi-python-client |
| 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 | abd13d780acc53a8d052b86a5b6ac82b79676965 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width