Title: Non-Existent Types Referenced by `Response` `Schema` · Issue #636 · oapi-codegen/oapi-codegen · GitHub
Open Graph Title: Non-Existent Types Referenced by `Response` `Schema` · Issue #636 · oapi-codegen/oapi-codegen
X Title: Non-Existent Types Referenced by `Response` `Schema` · Issue #636 · oapi-codegen/oapi-codegen
Description: I'm not sure why but sometimes generated type GetExampleResponse struct {}s reference non-existent types whose names start with a status code (illegal to have a type start with a digit so this refuses to format). This is only happening w...
Open Graph Description: I'm not sure why but sometimes generated type GetExampleResponse struct {}s reference non-existent types whose names start with a status code (illegal to have a type start with a digit so this refu...
X Description: I'm not sure why but sometimes generated type GetExampleResponse struct {}s reference non-existent types whose names start with a status code (illegal to have a type start with a digit so this ...
Opengraph URL: https://github.com/oapi-codegen/oapi-codegen/issues/636
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Non-Existent Types Referenced by `Response` `Schema`","articleBody":"I'm not sure why but sometimes generated `type GetExampleResponse struct {}`s reference non-existent types whose names start with a status code (illegal to have a type start with a digit so this refuses to format). This is only happening when the [Schema](https://pkg.go.dev/github.com/getkin/kin-openapi/openapi3#Schema) type lacks a `Title`, so I'm guessing it's something to do with the substitution.\r\n\r\n```go\r\ntype GetExampleResponse struct {\r\n\tBody []byte\r\n\tHTTPResponse *http.Response\r\n\tJSON200 *struct {\r\n\t\tLimit int `json:\"limit\"`\r\n\t\tOffset int `json:\"offset\"`\r\n\t\tResults []200_Results_Item `json:\"results\"`\r\n\t\tTotal int `json:\"total\"`\r\n\t}\r\n}\r\n```\r\n\r\nHere's a simplified example of what it looks like, notice the `Results` field references a (non-existent) type named `200_Results_Item`.\r\nI'm trying to generate a wrapper around [this spec](https://github.com/hirosystems/stacks-blockchain-api/blob/master/docs/openapi.yaml), let me know if you need more information.","author":{"url":"https://github.com/linden","@type":"Person","name":"linden"},"datePublished":"2022-06-19T01:15:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/636/oapi-codegen/issues/636"}
| 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:8bf74afc-7163-6ec4-80a0-c40e3010aaa7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EC72:2FEA35:A04E5F:E01943:6A4E7E3A |
| html-safe-nonce | f66f218374fda51665ec03fcb11179ae3ce3301769961178f1cef77359f04ead |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzcyOjJGRUEzNTpBMDRFNUY6RTAxOTQzOjZBNEU3RTNBIiwidmlzaXRvcl9pZCI6IjgwMTg2NjY3MTQ2MzkwMDcyOTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b55a915e56d27d4932730023cd962053d3d303c79f046037f48b48239e08a46a |
| hovercard-subject-tag | issue:1275923619 |
| 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/636/issue_layout |
| twitter:image | https://opengraph.githubassets.com/949a2d98cbee1d0ed91f9220c7421d66e4c883716913a1f5685b0c6577987a16/oapi-codegen/oapi-codegen/issues/636 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/949a2d98cbee1d0ed91f9220c7421d66e4c883716913a1f5685b0c6577987a16/oapi-codegen/oapi-codegen/issues/636 |
| og:image:alt | I'm not sure why but sometimes generated type GetExampleResponse struct {}s reference non-existent types whose names start with a status code (illegal to have a type start with a digit so this refu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | linden |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| 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 | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width