Title: Model Composition with ‘allOf’ Is Missing Fields · Issue #1392 · openapi-generators/openapi-python-client · GitHub
Open Graph Title: Model Composition with ‘allOf’ Is Missing Fields · Issue #1392 · openapi-generators/openapi-python-client
X Title: Model Composition with ‘allOf’ Is Missing Fields · Issue #1392 · openapi-generators/openapi-python-client
Description: Describe the bug Using a composition model (https://spec.openapis.org/oas/v3.0.4.html#models-with-composition) does not generate the target type but only the underlying type. For a type A which consists of the fields of B and some additi...
Open Graph Description: Describe the bug Using a composition model (https://spec.openapis.org/oas/v3.0.4.html#models-with-composition) does not generate the target type but only the underlying type. For a type A which con...
X Description: Describe the bug Using a composition model (https://spec.openapis.org/oas/v3.0.4.html#models-with-composition) does not generate the target type but only the underlying type. For a type A which con...
Opengraph URL: https://github.com/openapi-generators/openapi-python-client/issues/1392
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Model Composition with ‘allOf’ Is Missing Fields","articleBody":"**Describe the bug**\nUsing a composition model (https://spec.openapis.org/oas/v3.0.4.html#models-with-composition) does not generate the target type but only the underlying type. For a type `A` which consists of the fields of `B` and some additional fields, only `B` is generated. Furthermore, `A` is replaced by `B`.\n\nThe spec below generates the following function:\n\n```py\ndef sync_detailed(\n *,\n client: AuthenticatedClient | Client,\n body: Base,\n) -\u003e Response[Any]: ...\n```\n\nI would expect that the model `Network` is generated and used instead of `Base`. The `Network` model should include the field of `Base` and the field `non_base_field`.\n\n**OpenAPI Spec File**\n```yaml\nopenapi: 3.0.0\ninfo:\n title: Service\n version: 0.0.0\npaths:\n /widgets:\n get:\n responses:\n \"200\":\n description: The request has succeeded.\n content:\n application/json:\n schema:\n nullable: true\n requestBody:\n required: true\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/Network\"\ncomponents:\n schemas:\n Base:\n type: object\n required:\n - base_field\n properties:\n base_field:\n type: string\n Network:\n type: object\n required:\n - non_base_field\n properties:\n non_base_field:\n type: string\n allOf:\n - $ref: \"#/components/schemas/Base\"\n```\n\n**Desktop (please complete the following information):**\n - OS: Linux \n - Python Version: 3.13.11\n - openapi-python-client version: 0.28.1\n\n**Additional context**\nAdd any other context about the problem here.\n","author":{"url":"https://github.com/jmpunkt","@type":"Person","name":"jmpunkt"},"datePublished":"2026-01-30T20:01:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1392/openapi-python-client/issues/1392"}
| 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:553ac12f-e422-77a6-774f-a09eb3bfe80b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A7EA:3FDB33:200BDE7:296D9A4:697FC9EF |
| html-safe-nonce | 77599a03000b70daef7cef6d0de4eb40ef303779261cc08d16eba1ba5f01835a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBN0VBOjNGREIzMzoyMDBCREU3OjI5NkQ5QTQ6Njk3RkM5RUYiLCJ2aXNpdG9yX2lkIjoiMzU2NjUwNjQ4MDMzNTA0NzE1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 856e5187b668c94b94e29e1e3cb956222d85d80a1b21888eceb3ac09f730ec25 |
| hovercard-subject-tag | issue:3877171131 |
| 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/1392/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2f8b3fc54309f7ae0796aa6dccd4cc297c53f5c9e0f0074ebe9e40f552e8fd4a/openapi-generators/openapi-python-client/issues/1392 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2f8b3fc54309f7ae0796aa6dccd4cc297c53f5c9e0f0074ebe9e40f552e8fd4a/openapi-generators/openapi-python-client/issues/1392 |
| og:image:alt | Describe the bug Using a composition model (https://spec.openapis.org/oas/v3.0.4.html#models-with-composition) does not generate the target type but only the underlying type. For a type A which con... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jmpunkt |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6 |
| 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 | 7c85641c598ad130c74f7bcc27f58575cac69551 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width