Title: Handle "empty" default values as null · Issue #1376 · openapi-generators/openapi-python-client · GitHub
Open Graph Title: Handle "empty" default values as null · Issue #1376 · openapi-generators/openapi-python-client
X Title: Handle "empty" default values as null · Issue #1376 · openapi-generators/openapi-python-client
Description: Describe the bug "empty" default values for optional fields throw an error. swagger-parser explicitly allows these (even though they are technically out-of-spec) by converting them silently to null. So, there exist openapi json in the wi...
Open Graph Description: Describe the bug "empty" default values for optional fields throw an error. swagger-parser explicitly allows these (even though they are technically out-of-spec) by converting them silently to null...
X Description: Describe the bug "empty" default values for optional fields throw an error. swagger-parser explicitly allows these (even though they are technically out-of-spec) by converting them silent...
Opengraph URL: https://github.com/openapi-generators/openapi-python-client/issues/1376
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Handle \"empty\" default values as null","articleBody":"**Describe the bug**\n\"empty\" default values for optional fields throw an error. `swagger-parser` explicitly allows these (even though they are technically out-of-spec) by converting them silently to `null`. So, there exist openapi json in the wild built by swagger tools that pass swagger validation, but throw an error here in openapi-python-client.\n\n**OpenAPI Spec File**\nhttps://www.marinespecies.org/rest/api-docs/openapi.yaml\n\ngrep for:\n\n schema:\n type: integer\n default: \"\"\n\nThere are three endpoints that have this property. One of which is `AphiaTaxonRanksByID`. It might be useful to check this endpoint out in the swagger docs [here](https://www.marinespecies.org/rest/).\n\n**Desktop (please complete the following information):**\n - openapi-python-client version 0.28.0\n\n**Additional context**\nI am in contact with the folks at WORMS to try and find out how their openapi.yaml got this way. Will update here when I get more info.\n","author":{"url":"https://github.com/csbrown-noaa","@type":"Person","name":"csbrown-noaa"},"datePublished":"2025-12-11T18:07:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1376/openapi-python-client/issues/1376"}
| 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:6647f89d-6d74-e360-9626-5206fbb3b3b2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CE56:121ADA:8B126D:BFB3C5:69811C63 |
| html-safe-nonce | a7ca523ad97167de0a37cb85c3556d56edbd0c30306c43e14238480a0cfb6d49 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRTU2OjEyMUFEQTo4QjEyNkQ6QkZCM0M1OjY5ODExQzYzIiwidmlzaXRvcl9pZCI6IjkxNzAyNjAxNzY2ODk3NjU0NzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ac082067348bc0c8b845418afda8c2222e59dea4388e0758171cc0deb66f0ec6 |
| hovercard-subject-tag | issue:3720441657 |
| 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/1376/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b088b3c3a4e7905a5a55f025fc237c5e0c2448fed9348b04a669a75f89962c85/openapi-generators/openapi-python-client/issues/1376 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b088b3c3a4e7905a5a55f025fc237c5e0c2448fed9348b04a669a75f89962c85/openapi-generators/openapi-python-client/issues/1376 |
| og:image:alt | Describe the bug "empty" default values for optional fields throw an error. swagger-parser explicitly allows these (even though they are technically out-of-spec) by converting them silently to null... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | csbrown-noaa |
| hostname | github.com |
| expected-hostname | github.com |
| None | 39fe8101494cbb823c09b619b68c80cd4d05ab7279997038dbe06bb91608abe1 |
| 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 | d5b34a4e4898b066c629879feb4b184bc471d6a7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width