Title: response.union undefined · Issue #2539 · oapi-codegen/oapi-codegen · GitHub
Open Graph Title: response.union undefined · Issue #2539 · oapi-codegen/oapi-codegen
X Title: response.union undefined · Issue #2539 · oapi-codegen/oapi-codegen
Description: Version 2.7.2. go version 1.26.6. runtime 1.4.2. A natural migration from 2.6 -> 2.7.2 breaks for us. Going from 2.6 to 2.7.2 introduced this: #2403 for our spec. The claimed fix is to upgrade the runtime to 1.4.2 https://github.com/oapi...
Open Graph Description: Version 2.7.2. go version 1.26.6. runtime 1.4.2. A natural migration from 2.6 -> 2.7.2 breaks for us. Going from 2.6 to 2.7.2 introduced this: #2403 for our spec. The claimed fix is to upgrade the ...
X Description: Version 2.7.2. go version 1.26.6. runtime 1.4.2. A natural migration from 2.6 -> 2.7.2 breaks for us. Going from 2.6 to 2.7.2 introduced this: #2403 for our spec. The claimed fix is to upgrade t...
Opengraph URL: https://github.com/oapi-codegen/oapi-codegen/issues/2539
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"response.union undefined","articleBody":"Version 2.7.2. go version 1.26.6. runtime 1.4.2.\n\nA natural migration from 2.6 -> 2.7.2 breaks for us.\n\nGoing from 2.6 to 2.7.2 introduced this: https://github.com/oapi-codegen/oapi-codegen/issues/2403 for our spec. The claimed fix is to upgrade the runtime to 1.4.2 `https://github.com/oapi-codegen/oapi-codegen/issues/2403#issuecomment-4756703428`.\n\nBumping the runtime to 1.4.2 then introduces `response.union undefined` for responses that utilize `oneOf`. I see numerous issues and questions lingering around this, so I'll not link them here. I would have expected a version bump for this lib just for this.\n\nChasing this down it looks like the first version it breaks on is 2.7.0. Similar reasons to other issues already opened.\n\n---\n\nReproducible spec:\n\n```\npackage: openapi\ngenerate:\n std-http-server: true\n strict-server: true\n models: true\n embedded-spec: true\noutput-options:\n skip-prune: true\n```\n\n```\nopenapi: 3.0.3\ninfo:\n title: repro\n version: 1.0.0\npaths:\n /things:\n get:\n operationId: listThings\n responses:\n '200':\n description: OK\n content:\n application/json:\n schema:\n type: array\n items:\n $ref: '#/components/schemas/Thing'\n '400':\n $ref: '#/components/responses/BadRequest'\n '404':\n $ref: '#/components/responses/NotFound'\ncomponents:\n responses:\n # This breaks: a *shared* (components/responses) response whose inline schema is a oneOf. Referenced from an operation via $ref.\n BadRequest:\n description: Invalid request\n content:\n application/json:\n schema:\n oneOf:\n - $ref: '#/components/schemas/Error'\n - $ref: '#/components/schemas/ValidationError'\n # Doesn't break: same shape, but a plain $ref schema. Generates fine.\n NotFound:\n description: Resource not found\n content:\n application/json:\n schema:\n $ref: '#/components/schemas/Error'\n schemas:\n Thing:\n type: object\n required: [id]\n properties:\n id:\n type: string\n Error:\n type: object\n required: [error, message]\n properties:\n error:\n type: string\n message:\n type: string\n ValidationError:\n type: object\n required: [error, message]\n properties:\n error:\n type: string\n message:\n type: string\n fields:\n type: array\n items:\n type: string\n\n```","author":{"url":"https://github.com/hammypants","@type":"Person","name":"hammypants"},"datePublished":"2026-08-21T19:02:25Z","url":"https://github.com/oapi-codegen/oapi-codegen/issues/2539"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| 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:55afcf58-22ed-0225-1fc0-cf8d877ed101 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8B2A:8748A:2E9ECDD:3D2C5DF:6AF9CFEB |
| html-safe-nonce | d41ce038fd20f7e3283c3c4c6a20cecd7adcdb3430ac3a5621af6a2ebe2e7faa |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjJBOjg3NDhBOjJFOUVDREQ6M0QyQzVERjo2QUY5Q0ZFQiIsInZpc2l0b3JfaWQiOiI0MTc2MDU5MjExNjIyNTIyNjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 8a52634a64de2ec400780f126dcff1abe033eca1af1cd6c5d47a55f0a9b46c5d |
| hovercard-subject-tag | issue:5217298419 |
| 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/oapi-codegen/oapi-codegen/2539/issue_layout |
| twitter:image | https://opengraph.githubassets.com/be15dc8ae94b151385f3e1106ffd7218652b84c2503bb48f67fa9f17903798e6/oapi-codegen/oapi-codegen/issues/2539 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/be15dc8ae94b151385f3e1106ffd7218652b84c2503bb48f67fa9f17903798e6/oapi-codegen/oapi-codegen/issues/2539 |
| og:image:alt | Version 2.7.2. go version 1.26.6. runtime 1.4.2. A natural migration from 2.6 -> 2.7.2 breaks for us. Going from 2.6 to 2.7.2 introduced this: #2403 for our spec. The claimed fix is to upgrade the ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hammypants |
| hostname | github.com |
| expected-hostname | github.com |
| None | 612d3e6ffd693e7ea8d9fcf452370995872baef31d825b1fedef704cd3d24ac7 |
| turbo-cache-control | no-preview |
| go-import | github.com/oapi-codegen/oapi-codegen git https://github.com/oapi-codegen/oapi-codegen.git |
| octolytics-dimension-user_id | 142752710 |
| octolytics-dimension-user_login | oapi-codegen |
| octolytics-dimension-repository_id | 173009358 |
| octolytics-dimension-repository_nwo | oapi-codegen/oapi-codegen |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 173009358 |
| octolytics-dimension-repository_network_root_nwo | oapi-codegen/oapi-codegen |
| 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 | 072e34035c13c31543fba9f025cbbbda4210dae4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width