Title: [BUG] Golang - When using import mappings, import mapping is not properly generated when using composition plus slice pointer type · Issue #2008 · oapi-codegen/oapi-codegen · GitHub
Open Graph Title: [BUG] Golang - When using import mappings, import mapping is not properly generated when using composition plus slice pointer type · Issue #2008 · oapi-codegen/oapi-codegen
X Title: [BUG] Golang - When using import mappings, import mapping is not properly generated when using composition plus slice pointer type · Issue #2008 · oapi-codegen/oapi-codegen
Description: one.yaml schemas: Thing: type: object properties: Property: value Example: properties: Thing type: array items: $ref "#/components/schemas/Thing" two.yaml schemas: MyThing: allOf: - $ref: "one.yaml#/components/schemas/Example' - type: ob...
Open Graph Description: one.yaml schemas: Thing: type: object properties: Property: value Example: properties: Thing type: array items: $ref "#/components/schemas/Thing" two.yaml schemas: MyThing: allOf: - $ref: "one.yaml...
X Description: one.yaml schemas: Thing: type: object properties: Property: value Example: properties: Thing type: array items: $ref "#/components/schemas/Thing" two.yaml schemas: MyThing: allOf: - $ref:...
Opengraph URL: https://github.com/oapi-codegen/oapi-codegen/issues/2008
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[BUG] Golang - When using import mappings, import mapping is not properly generated when using composition plus slice pointer type","articleBody":"one.yaml\n```\nschemas:\n Thing:\n type: object\n properties:\n Property: value\n Example:\n properties:\n Thing\n type: array\n items: $ref \"#/components/schemas/Thing\"\n \n```\ntwo.yaml\n```\nschemas:\n MyThing:\n allOf:\n - $ref: \"one.yaml#/components/schemas/Example'\n - type: object\n properties: # whatever one might add here...\n```\n\nOutput when generating two.yaml:\n```\ntype MyThing struct {\n Thing *[]Thing\n}\n```\nExpected output generating two.yaml:\n```\ntype MyThing struct {\n Thing *[]externalRef0.Thing\n}\n```\n\n##### Steps to reproduce\n1) create two specs, one referencing the other\n2) Reference a slice type from 1 to another\n3) *optional* reference a non slice type to see desired behavior\n4) write configuration file to point import mapping of spec 2 to spec 1's output generation\n5) Run the generator\n\n##### Suggest a fix\n\nUse same external mapping logic when type is a slice pointer.\n","author":{"url":"https://github.com/chaslain","@type":"Person","name":"chaslain"},"datePublished":"2025-06-20T18:28:36Z","url":"https://github.com/oapi-codegen/oapi-codegen/issues/2008"}
| 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:7f946908-ac42-0818-9be9-147567516e80 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 97A2:1F25C3:7C0161:ACCC2B:6AFA06F2 |
| html-safe-nonce | 96f105e6865db6ade91f7b7114bd610e9e7997c42c0304cbaa80b50adaf97fa1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5N0EyOjFGMjVDMzo3QzAxNjE6QUNDQzJCOjZBRkEwNkYyIiwidmlzaXRvcl9pZCI6IjIwMjY3MTgzNzY4MTQyMDAxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 055de8464436fcfae0c96541db6a1d20de4dc11d8d047e21c8faa12e0d35f0b8 |
| hovercard-subject-tag | issue:3164092193 |
| 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/2008/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9102ab6f2e97db063784f98212914655ab70c8a2ccc8db7bdcca0105ad058fc0/oapi-codegen/oapi-codegen/issues/2008 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9102ab6f2e97db063784f98212914655ab70c8a2ccc8db7bdcca0105ad058fc0/oapi-codegen/oapi-codegen/issues/2008 |
| og:image:alt | one.yaml schemas: Thing: type: object properties: Property: value Example: properties: Thing type: array items: $ref "#/components/schemas/Thing" two.yaml schemas: MyThing: allOf: - $ref: "one.yaml... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | chaslain |
| 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