Title: 'Response' suffix causes duplicated structs · Issue #386 · oapi-codegen/oapi-codegen · GitHub
Open Graph Title: 'Response' suffix causes duplicated structs · Issue #386 · oapi-codegen/oapi-codegen
X Title: 'Response' suffix causes duplicated structs · Issue #386 · oapi-codegen/oapi-codegen
Description: I have some endpoints in my spec like this one: /v1/auth/phone/login: post: summary: 用手机登陆/注册 tags: - Auth operationId: LoginByPhone requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/LoginWithPhon...
Open Graph Description: I have some endpoints in my spec like this one: /v1/auth/phone/login: post: summary: 用手机登陆/注册 tags: - Auth operationId: LoginByPhone requestBody: required: true content: application/json: schema: $...
X Description: I have some endpoints in my spec like this one: /v1/auth/phone/login: post: summary: 用手机登陆/注册 tags: - Auth operationId: LoginByPhone requestBody: required: true content: application/json: schema: $...
Opengraph URL: https://github.com/oapi-codegen/oapi-codegen/issues/386
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"'Response' suffix causes duplicated structs","articleBody":"I have some endpoints in my spec like this one:\r\n\r\n```yaml\r\n /v1/auth/phone/login:\r\n post:\r\n summary: 用手机登陆/注册\r\n tags:\r\n - Auth\r\n operationId: LoginByPhone\r\n requestBody:\r\n required: true\r\n content:\r\n application/json:\r\n schema:\r\n $ref: '#/components/schemas/LoginWithPhoneRequest'\r\n responses:\r\n \"200\":\r\n content:\r\n application/json:\r\n schema:\r\n $ref: '#/components/schemas/LoginWithPhoneResponse'\r\n```\r\n\r\nIf I generate server code it is ok, but when I generate client code `oapi-codegen` creates structs with `Response` suffix which causes deduplication of my structs. \r\n\r\nMaybe it would be better to make this suffix configurable or change it and other suffix/prefix literals to with `_` at the beginning so it would be `OperationName_Response`?\r\n\r\nInitially I wanted to use a custom template, but this suffix is generated by the function.","author":{"url":"https://github.com/amanbolat","@type":"Person","name":"amanbolat"},"datePublished":"2021-06-19T15:25:09Z","url":"https://github.com/oapi-codegen/oapi-codegen/issues/386"}
| 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:4ce136b7-24a6-2ce7-23b5-3d1b45dba1d6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C816:3D6C24:668364:8EAB55:6AF9C4DD |
| html-safe-nonce | 02a6962e1e709e9952077c3280802a42130d019fbad0c215e0490d358f50754a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODE2OjNENkMyNDo2NjgzNjQ6OEVBQjU1OjZBRjlDNEREIiwidmlzaXRvcl9pZCI6IjU1NTM5NTU1MTUxNTIzMTk3MDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6ccdb547a1930b8e65abf4308d9f89843a277f2afc95d0f48f10a7e5179950b1 |
| hovercard-subject-tag | issue:925415699 |
| 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/386/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7b6d7db5204df02db326fce6a53059bf2c1e2c4fb6bfdc810a6e339949a31b1f/oapi-codegen/oapi-codegen/issues/386 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7b6d7db5204df02db326fce6a53059bf2c1e2c4fb6bfdc810a6e339949a31b1f/oapi-codegen/oapi-codegen/issues/386 |
| og:image:alt | I have some endpoints in my spec like this one: /v1/auth/phone/login: post: summary: 用手机登陆/注册 tags: - Auth operationId: LoginByPhone requestBody: required: true content: application/json: schema: $... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | amanbolat |
| 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