Title: Duplicate declarations in generated types · Issue #256 · oapi-codegen/oapi-codegen · GitHub
Open Graph Title: Duplicate declarations in generated types · Issue #256 · oapi-codegen/oapi-codegen
X Title: Duplicate declarations in generated types · Issue #256 · oapi-codegen/oapi-codegen
Description: Hi, I'm getting duplicate declarations of types in the generated code. I'm using this YAML file. Code to reproduce: curl "https://raw.githubusercontent.com/radiantearth/stac-api-spec/47eaaee5b22bc9fde796972c0206f964407fed09/STAC.yaml" >S...
Open Graph Description: Hi, I'm getting duplicate declarations of types in the generated code. I'm using this YAML file. Code to reproduce: curl "https://raw.githubusercontent.com/radiantearth/stac-api-spec/47eaaee5b22bc9...
X Description: Hi, I'm getting duplicate declarations of types in the generated code. I'm using this YAML file. Code to reproduce: curl "https://raw.githubusercontent.com/radiantearth/stac-api-spec/4...
Opengraph URL: https://github.com/oapi-codegen/oapi-codegen/issues/256
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Duplicate declarations in generated types","articleBody":"Hi,\r\n\r\nI'm getting duplicate declarations of types in the generated code. I'm using [this YAML file](https://github.com/radiantearth/stac-api-spec/blob/f19b49f44ac57f9398d9c7cb446df80492130eb9/STAC.yaml).\r\n\r\nCode to reproduce:\r\n```bash\r\ncurl \"https://raw.githubusercontent.com/radiantearth/stac-api-spec/47eaaee5b22bc9fde796972c0206f964407fed09/STAC.yaml\" >STAC.yaml\r\noapi-codegen -generate types STAC.yaml > types.gen.go\r\n```\r\n\r\nIn the generated code I get duplicate declarations:\r\n\r\n\r\nSeems like the duplicate declarations are all from `#/components/parameters`, `#/componenters/responses` and `#/components/schemas` from the YAML file when there is name collision. For example there is bbox in `#/components/parameters` and `#/components/schemas` and they both get generated as Bbox type.","author":{"url":"https://github.com/popsu","@type":"Person","name":"popsu"},"datePublished":"2020-11-20T15:18:56Z","url":"https://github.com/oapi-codegen/oapi-codegen/issues/256"}
| 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:dac66118-7e9d-c94c-830d-739baf199517 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CDAA:3DEE78:2C038A1:39E6F9C:6AF9C4C4 |
| html-safe-nonce | 36fb84db02c988a564361df7991c7758442fefb872016ff92de7aed0e5a40722 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDREFBOjNERUU3ODoyQzAzOEExOjM5RTZGOUM6NkFGOUM0QzQiLCJ2aXNpdG9yX2lkIjoiMzIzMTMzNjQ3OTY0NDU2NjcyNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ed772621c51febf6e5a6a44210afd261047ac5fcaae4e78071d1c3fb4de6be95 |
| hovercard-subject-tag | issue:747571921 |
| 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/256/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1d1e4ad860ae36075904410a7982126529cf3d79db9e763f3d6e9364c6b5b2f3/oapi-codegen/oapi-codegen/issues/256 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1d1e4ad860ae36075904410a7982126529cf3d79db9e763f3d6e9364c6b5b2f3/oapi-codegen/oapi-codegen/issues/256 |
| og:image:alt | Hi, I'm getting duplicate declarations of types in the generated code. I'm using this YAML file. Code to reproduce: curl "https://raw.githubusercontent.com/radiantearth/stac-api-spec/47eaaee5b22bc9... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | popsu |
| 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