Title: Name conflict of components/schemas and operationId response objects · Issue #1357 · oapi-codegen/oapi-codegen · GitHub
Open Graph Title: Name conflict of components/schemas and operationId response objects · Issue #1357 · oapi-codegen/oapi-codegen
X Title: Name conflict of components/schemas and operationId response objects · Issue #1357 · oapi-codegen/oapi-codegen
Description: I attempted to generate a client using the official OpenAI specifications found at GitHub - openai/openai-openapi, but encountered a naming conflict. For example: openapi: 3.0.0 info: title: OpenAI API version: 2.0.0 paths: /assistants: ...
Open Graph Description: I attempted to generate a client using the official OpenAI specifications found at GitHub - openai/openai-openapi, but encountered a naming conflict. For example: openapi: 3.0.0 info: title: OpenAI...
X Description: I attempted to generate a client using the official OpenAI specifications found at GitHub - openai/openai-openapi, but encountered a naming conflict. For example: openapi: 3.0.0 info: title: OpenAI...
Opengraph URL: https://github.com/oapi-codegen/oapi-codegen/issues/1357
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Name conflict of components/schemas and operationId response objects","articleBody":"I attempted to generate a client using the official OpenAI specifications found at [GitHub - openai/openai-openapi](https://github.com/openai/openai-openapi/blob/a7a0b63d1fac3acac9a223d57da1219c8a97c01e/openapi.yaml), but encountered a naming conflict.\r\n\r\nFor example:\r\n```yaml\r\nopenapi: 3.0.0\r\ninfo:\r\n title: OpenAI API\r\n version: 2.0.0\r\npaths:\r\n /assistants:\r\n get:\r\n operationId: listAssistants\r\n responses:\r\n \"200\":\r\n description: OK\r\n content:\r\n application/json:\r\n schema:\r\n $ref: \"#/components/schemas/ListAssistantsResponse\"\r\ncomponents:\r\n schemas:\r\n ListAssistantsResponse:\r\n type: string\r\n```\r\n\r\nThis specification generates two types:\r\n```go\r\n// this for schemas\r\ntype ListAssistantsResponse = string\r\n\r\n// and this for response object\r\ntype ListAssistantsResponse struct {\r\n\tBody []byte\r\n\tHTTPResponse *http.Response\r\n\tJSON200 *ListAssistantsResponse\r\n}\r\n```\r\nI'm considering making a merge request to fix this, but I'm unsure of the best approach. Here are some options:\r\n\r\n1. Rename the response object to operationID+OperationResponse or something similar.\r\n2. Append a suffix like Model to all schemas.\r\n3. Identify all conflicts at the end of generation and rename one of them.\r\n","author":{"url":"https://github.com/Hrom-in-space","@type":"Person","name":"Hrom-in-space"},"datePublished":"2023-11-17T14:05:01Z","url":"https://github.com/oapi-codegen/oapi-codegen/issues/1357"}
| 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:93862b81-79f0-efe7-26a4-c0ab6d831b13 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B33C:79AE7:15BA46A:1C8574B:6AF9CF72 |
| html-safe-nonce | fa97e1f0dd09d34144a2faed5aebebc15e9e396f71e87ab57a184af85d2a2ead |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMzNDOjc5QUU3OjE1QkE0NkE6MUM4NTc0Qjo2QUY5Q0Y3MiIsInZpc2l0b3JfaWQiOiI3ODQ0Nzk2MjgwOTEwNDk5Njk4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d7b1ec4e0e28aba3748cea2c1249e790e22f60a24224618a4bfcdfbdb3c39011 |
| hovercard-subject-tag | issue:1999211921 |
| 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/1357/issue_layout |
| twitter:image | https://opengraph.githubassets.com/576e046c494ab9391fdcc723d893109a80a1f73b1b61d72d6f81ea8b5f5d82a1/oapi-codegen/oapi-codegen/issues/1357 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/576e046c494ab9391fdcc723d893109a80a1f73b1b61d72d6f81ea8b5f5d82a1/oapi-codegen/oapi-codegen/issues/1357 |
| og:image:alt | I attempted to generate a client using the official OpenAI specifications found at GitHub - openai/openai-openapi, but encountered a naming conflict. For example: openapi: 3.0.0 info: title: OpenAI... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Hrom-in-space |
| 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 | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width