Title: Anonymous object schema with oneof cannot be generated properly · Issue #1496 · oapi-codegen/oapi-codegen · GitHub
Open Graph Title: Anonymous object schema with oneof cannot be generated properly · Issue #1496 · oapi-codegen/oapi-codegen
X Title: Anonymous object schema with oneof cannot be generated properly · Issue #1496 · oapi-codegen/oapi-codegen
Description: Following example masked any identifying information responses: 200: description: "Success" content: application/json: schema: title: SomethingSuccess type: object required: - results properties: results: type: array items: anyOf: - type...
Open Graph Description: Following example masked any identifying information responses: 200: description: "Success" content: application/json: schema: title: SomethingSuccess type: object required: - results properties: r...
X Description: Following example masked any identifying information responses: 200: description: "Success" content: application/json: schema: title: SomethingSuccess type: object required: - results pro...
Opengraph URL: https://github.com/oapi-codegen/oapi-codegen/issues/1496
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Anonymous object schema with oneof cannot be generated properly","articleBody":"Following example masked any identifying information\r\n\r\n```\r\n responses:\r\n 200:\r\n description: \"Success\"\r\n content:\r\n application/json:\r\n schema:\r\n title: SomethingSuccess\r\n type: object\r\n required:\r\n - results\r\n properties:\r\n results:\r\n type: array\r\n items:\r\n anyOf:\r\n - type: object\r\n properties:\r\n order:\r\n $ref: '#/components/schemas/Order'\r\n - type: object\r\n properties:\r\n error:\r\n type: object\r\n properties:\r\n code:\r\n type: number\r\n example: 400\r\n error:\r\n type: string\r\n example: ERROR_MISSING_PARAMETER\r\n message:\r\n type: string\r\n example: Parameter `id` is missing\r\n```\r\n\r\nThe above example will generate a struct with field `Results` of type `[]200_Results_Item` in-line in the generated go code, example:\r\n\r\n```go\r\nvar dest struct {\r\n Results []200_Results_Item`json:results`\r\n}\r\n```\r\n\r\nI am using v1.15.0","author":{"url":"https://github.com/alexpyc","@type":"Person","name":"alexpyc"},"datePublished":"2024-03-11T07:51:07.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/1496/oapi-codegen/issues/1496"}
| 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:19ce47bf-ca92-5e75-ad00-edf607837a37 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D240:162B2:2450A41:321AF8F:6A4EE9DE |
| html-safe-nonce | aff934ace31afc1a132fa5a315a4a8cd33d48b07cdc8930a97344ac6dd51ecaa |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjQwOjE2MkIyOjI0NTBBNDE6MzIxQUY4Rjo2QTRFRTlERSIsInZpc2l0b3JfaWQiOiI4ODU1ODU1NTU2ODg1MTQ2MDc4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 78b10299ae68d0b4afa7f2cbbeb4e82f9c894d4e0af4e49f08c3fd903a47ee81 |
| hovercard-subject-tag | issue:2178462670 |
| 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/1496/issue_layout |
| twitter:image | https://opengraph.githubassets.com/83e4e3f5332ba3bd0ff93c3c165758866b01abfdee0eb110635713f0fbf16295/oapi-codegen/oapi-codegen/issues/1496 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/83e4e3f5332ba3bd0ff93c3c165758866b01abfdee0eb110635713f0fbf16295/oapi-codegen/oapi-codegen/issues/1496 |
| og:image:alt | Following example masked any identifying information responses: 200: description: "Success" content: application/json: schema: title: SomethingSuccess type: object required: - results properties: r... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | alexpyc |
| hostname | github.com |
| expected-hostname | github.com |
| None | d12176b31601daf8d3de9a378cbbcf7dac6f33d990d1faedcb9c9b9ff3cbb1ed |
| 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 | 9420180b23897f48b04b8d47ee8b1a9341197b64 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width