Title: allow coexistence of anyOf and oneOf fields in single schema definition · Issue #839 · oapi-codegen/oapi-codegen · GitHub
Open Graph Title: allow coexistence of anyOf and oneOf fields in single schema definition · Issue #839 · oapi-codegen/oapi-codegen
X Title: allow coexistence of anyOf and oneOf fields in single schema definition · Issue #839 · oapi-codegen/oapi-codegen
Description: allow coexistence of anyOf and oneOf fields in single schema definition If some schema has anyOf, oneOf field, generating code get failed. (A while ago (before of commit:5a1784a), generating get success, but generated code didn't work) I...
Open Graph Description: allow coexistence of anyOf and oneOf fields in single schema definition If some schema has anyOf, oneOf field, generating code get failed. (A while ago (before of commit:5a1784a), generating get su...
X Description: allow coexistence of anyOf and oneOf fields in single schema definition If some schema has anyOf, oneOf field, generating code get failed. (A while ago (before of commit:5a1784a), generating get su...
Opengraph URL: https://github.com/oapi-codegen/oapi-codegen/issues/839
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"allow coexistence of anyOf and oneOf fields in single schema definition","articleBody":"# allow coexistence of anyOf and oneOf fields in single schema definition\r\n\r\nIf some schema has anyOf, oneOf field, generating code get failed. (A while ago (before of commit:5a1784a), generating get success, but generated code didn't work)\r\nIts reason is that created internal type name for additional type related to anyOf or oneOf.\r\n\r\nI want to fix it, but have no idea how to escape the name conflict, using Any and One suffixes for them?\r\n\r\n## example\r\nWe can reproduce it executing `go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml spec.yaml` with following files.\r\n\r\n**config.yml**\r\n```yaml\r\n---\r\npackage: issue_any_w_one\r\ngenerate:\r\n models: true\r\noutput: issue.gen.go\r\noutput-options:\r\n skip-prune: true\r\n```\r\n\r\n**spec.yaml**\r\n\r\n```yaml\r\nopenapi: 3.0.2\r\ninfo:\r\n version: \"0.0.1\"\r\ncomponents:\r\n schemas:\r\n Orange:\r\n desription: anyOf with oneOf\r\n oneOf:\r\n - required:\r\n - attrA0\r\n - required:\r\n - attrA1\r\n anyOf:\r\n - required:\r\n - attrB\r\n - required:\r\n - attrC\r\n properties:\r\n attrA0: {type: string}\r\n attrA1: {type: string}\r\n attrB: {type: string}\r\n attrC: {type: string}\r\n type: object\r\n```\r\n","author":{"url":"https://github.com/masu-mi","@type":"Person","name":"masu-mi"},"datePublished":"2022-11-04T08:03:37Z","url":"https://github.com/oapi-codegen/oapi-codegen/issues/839"}
| 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:71537be9-b412-f309-645c-af6273c9458e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B116:3F3090:2E0E5F4:3C49ED1:6AF9CA20 |
| html-safe-nonce | 2b87fc0615bdecb2afc9160f38819b5b4a77e744b4bc9c821265e176e8855e00 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTE2OjNGMzA5MDoyRTBFNUY0OjNDNDlFRDE6NkFGOUNBMjAiLCJ2aXNpdG9yX2lkIjoiMjIxNjg0MTg2OTc3MjA0ODkyOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 50537a127756634aa31b6c0109852e7ca0fa3445fdcc06122c956952f65d537e |
| hovercard-subject-tag | issue:1435700869 |
| 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/839/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ae13010302b75004d32a1f7956552515d2e323ce2c93d7c7790d20540374f197/oapi-codegen/oapi-codegen/issues/839 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ae13010302b75004d32a1f7956552515d2e323ce2c93d7c7790d20540374f197/oapi-codegen/oapi-codegen/issues/839 |
| og:image:alt | allow coexistence of anyOf and oneOf fields in single schema definition If some schema has anyOf, oneOf field, generating code get failed. (A while ago (before of commit:5a1784a), generating get su... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | masu-mi |
| 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