René's URL Explorer Experiment


Title: Use default value for ref property by github-abcde · Pull Request #1202 · openapi-generators/openapi-python-client · GitHub

Open Graph Title: Use default value for ref property by github-abcde · Pull Request #1202 · openapi-generators/openapi-python-client

X Title: Use default value for ref property by github-abcde · Pull Request #1202 · openapi-generators/openapi-python-client

Description: When the OpenAPI spec contains an optional enum property with a default value, the default value is ignored and is always set to UNSET in the generated client (current behavior). This PR attempts to address this, checking if a default is defined for a referenced property and applying that. If no default is defined on the property itself, the current behavior is applied (fetching the default from the parent if present and falling back to None (UNSET) if absent). I hope I've provided everything required in this PR, but if not, please let me know :-)

Open Graph Description: When the OpenAPI spec contains an optional enum property with a default value, the default value is ignored and is always set to UNSET in the generated client (current behavior). This PR attempts t...

X Description: When the OpenAPI spec contains an optional enum property with a default value, the default value is ignored and is always set to UNSET in the generated client (current behavior). This PR attempts t...

Opengraph URL: https://github.com/openapi-generators/openapi-python-client/pull/1202

X: @github

direct link

Domain: patch-diff.githubusercontent.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:68937e0f-f5d8-62bd-e3e7-0f6daff5726e
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA128:60067:532C52:729341:6981116D
html-safe-noncebaca6880c44b3ba5b05c2163bf0d78ced868bd87331b6a265468aa1f07de0430
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTI4OjYwMDY3OjUzMkM1Mjo3MjkzNDE6Njk4MTExNkQiLCJ2aXNpdG9yX2lkIjoiMjg5NzEzNjI3Njk3NTgyNDQ1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac516d5b753ca495fefa14e783d3eea885a9f98b5e02c3e0a52d0bda4cf8f913a4
hovercard-subject-tagpull_request:2321918603
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/openapi-generators/openapi-python-client/pull/1202/files
twitter:imagehttps://avatars.githubusercontent.com/u/6707706?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/6707706?s=400&v=4
og:image:altWhen the OpenAPI spec contains an optional enum property with a default value, the default value is ignored and is always set to UNSET in the generated client (current behavior). This PR attempts t...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None39fe8101494cbb823c09b619b68c80cd4d05ab7279997038dbe06bb91608abe1
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/openapi-generators/openapi-python-client git https://github.com/openapi-generators/openapi-python-client.git
octolytics-dimension-user_id84925606
octolytics-dimension-user_loginopenapi-generators
octolytics-dimension-repository_id240776275
octolytics-dimension-repository_nwoopenapi-generators/openapi-python-client
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id240776275
octolytics-dimension-repository_network_root_nwoopenapi-generators/openapi-python-client
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
released5b34a4e4898b066c629879feb4b184bc471d6a7
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenapi-generators%2Fopenapi-python-client%2Fpull%2F1202%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenapi-generators%2Fopenapi-python-client%2Fpull%2F1202%2Ffiles
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=openapi-generators%2Fopenapi-python-client
Reloadhttps://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes
Reloadhttps://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes
Reloadhttps://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes
openapi-generators https://patch-diff.githubusercontent.com/openapi-generators
openapi-python-clienthttps://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client
Please reload this pagehttps://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fopenapi-generators%2Fopenapi-python-client
Fork 264 https://patch-diff.githubusercontent.com/login?return_to=%2Fopenapi-generators%2Fopenapi-python-client
Star 1.9k https://patch-diff.githubusercontent.com/login?return_to=%2Fopenapi-generators%2Fopenapi-python-client
Code https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client
Issues 77 https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/issues
Pull requests 14 https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pulls
Discussions https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/discussions
Actions https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/actions
Security 2 https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/security
Insights https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pulse
Code https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client
Issues https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/issues
Pull requests https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pulls
Discussions https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/discussions
Actions https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/actions
Security https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/security
Insights https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pulse
Sign up for GitHub https://patch-diff.githubusercontent.com/signup?return_to=%2Fopenapi-generators%2Fopenapi-python-client%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://patch-diff.githubusercontent.com/login?return_to=%2Fopenapi-generators%2Fopenapi-python-client%2Fissues%2Fnew%2Fchoose
github-abcdehttps://patch-diff.githubusercontent.com/github-abcde
openapi-generators:mainhttps://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/tree/main
github-abcde:use_default_value_for_ref_propertyhttps://patch-diff.githubusercontent.com/github-abcde/openapi-python-client/tree/use_default_value_for_ref_property
Conversation 2 https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202
Commits 4 https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/commits
Checks 1 https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/checks
Files changed https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/files
Please reload this pagehttps://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes
Use default value for ref property https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes#top
Show all changes 4 commits https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/files
1b65c5d Add test model to baseline OpenAPI specs github-abcde Feb 6, 2025 https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/commits/1b65c5dffc7e946cdca5fae29548e8f87ff96236
b013093 Add desired/correct generated code to golden-record github-abcde Feb 6, 2025 https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/commits/b013093c585995498a1f1eb13e8aa7e9752c6885
1dd1efe Add processing of object default if present, fallback to old behavior… github-abcde Feb 7, 2025 https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/commits/1dd1efebb9486b17ac393e11450307d50319570e
5d34403 Add changeset documentation github-abcde Feb 7, 2025 https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/commits/5d3440371db20503cf4980a789c6f013ba057da4
Clear filters https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/files
Please reload this pagehttps://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes
Please reload this pagehttps://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes
use_default_value_for_ref_property.md https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes#diff-c4d391b3133da92308eb77e9da00012f7de36cc43c057418d202d880c4ffcd97
baseline_openapi_3.0.json https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes#diff-77684f26aa921fc62d68726ed5ff58c4f476b3d33708bbc21b960aefeec84157
baseline_openapi_3.1.yaml https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes#diff-b77a91ff888a9cbfeea6ffa04777347cbc2ab62a2f16479ce2827a6a0f36ac6d
__init__.py https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes#diff-b559da36cbc384fc7e69fbd9357aeaeec4263efa53e42c4f07d003f913cc4b3e
a_model_with_optional_property_ref_and_default_value.py https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes#diff-3d5244a74a879d04dbf4043876de8f4835e5b72f0ebdb29f94b82e0f70e8dcc1
__init__.py https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes#diff-61e8ac1a0d02be37f61e720be24f89c399fc6325938adfe140017e45198dc241
.changeset/use_default_value_for_ref_property.mdhttps://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes#diff-c4d391b3133da92308eb77e9da00012f7de36cc43c057418d202d880c4ffcd97
View file https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/blob/5d3440371db20503cf4980a789c6f013ba057da4/.changeset/use_default_value_for_ref_property.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/{{ revealButtonHref }}
end_to_end_tests/baseline_openapi_3.0.jsonhttps://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes#diff-77684f26aa921fc62d68726ed5ff58c4f476b3d33708bbc21b960aefeec84157
View file https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/blob/5d3440371db20503cf4980a789c6f013ba057da4/end_to_end_tests/baseline_openapi_3.0.json
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/{{ revealButtonHref }}
https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes#diff-77684f26aa921fc62d68726ed5ff58c4f476b3d33708bbc21b960aefeec84157
https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes#diff-77684f26aa921fc62d68726ed5ff58c4f476b3d33708bbc21b960aefeec84157
end_to_end_tests/baseline_openapi_3.1.yamlhttps://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes#diff-b77a91ff888a9cbfeea6ffa04777347cbc2ab62a2f16479ce2827a6a0f36ac6d
View file https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/blob/5d3440371db20503cf4980a789c6f013ba057da4/end_to_end_tests/baseline_openapi_3.1.yaml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/{{ revealButtonHref }}
https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes#diff-b77a91ff888a9cbfeea6ffa04777347cbc2ab62a2f16479ce2827a6a0f36ac6d
https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes#diff-b77a91ff888a9cbfeea6ffa04777347cbc2ab62a2f16479ce2827a6a0f36ac6d
end_to_end_tests/golden-record/my_test_api_client/models/__init__.pyhttps://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes#diff-b559da36cbc384fc7e69fbd9357aeaeec4263efa53e42c4f07d003f913cc4b3e
View file https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/blob/5d3440371db20503cf4980a789c6f013ba057da4/end_to_end_tests/golden-record/my_test_api_client/models/__init__.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/{{ revealButtonHref }}
https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes#diff-b559da36cbc384fc7e69fbd9357aeaeec4263efa53e42c4f07d003f913cc4b3e
https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes#diff-b559da36cbc384fc7e69fbd9357aeaeec4263efa53e42c4f07d003f913cc4b3e
https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes#diff-b559da36cbc384fc7e69fbd9357aeaeec4263efa53e42c4f07d003f913cc4b3e
https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes#diff-b559da36cbc384fc7e69fbd9357aeaeec4263efa53e42c4f07d003f913cc4b3e
...-record/my_test_api_client/models/a_model_with_optional_property_ref_and_default_value.pyhttps://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes#diff-3d5244a74a879d04dbf4043876de8f4835e5b72f0ebdb29f94b82e0f70e8dcc1
View file https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/blob/5d3440371db20503cf4980a789c6f013ba057da4/end_to_end_tests/golden-record/my_test_api_client/models/a_model_with_optional_property_ref_and_default_value.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/{{ revealButtonHref }}
openapi_python_client/parser/properties/__init__.pyhttps://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes#diff-61e8ac1a0d02be37f61e720be24f89c399fc6325938adfe140017e45198dc241
View file https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/blob/5d3440371db20503cf4980a789c6f013ba057da4/openapi_python_client/parser/properties/__init__.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/{{ revealButtonHref }}
https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes#diff-61e8ac1a0d02be37f61e720be24f89c399fc6325938adfe140017e45198dc241
https://patch-diff.githubusercontent.com/openapi-generators/openapi-python-client/pull/1202/changes#diff-61e8ac1a0d02be37f61e720be24f89c399fc6325938adfe140017e45198dc241
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.