External references are not propagated recursively when merging "allOf" fields
Consider these two specifications:
#a.yaml
openapi: 3.0.0
components:
schemas:
Merged:
allOf:
- $ref: '#/components/schemas/Example'
- $ref: 'b.yaml#/components/schemas/Merge'
Example:
type: object
properties:
a:
type: string
c:
$ref: 'b.yaml#/components/schemas/Element'
#b.yaml
openapi: 3.0.0
components:
schemas:
Merge:
type: object
properties:
b:
type: array
items:
$ref: "#/components/schemas/Element"
Element:
type: object
properties:
c:
type: string
As well as the following options:
package: example
generate:
models: true
import-mapping:
b.yaml: example.com/b
output-options:
skip-prune: true
Running oapi-codegen/oapi-codegen -config options.yaml a.yaml results in the following type for Merged:
type Merged struct {
A *string `json:"a,omitempty"`
B *[]Element `json:"b,omitempty"`
C *externalRef0.Element `json:"c,omitempty"`
}
Where B should be *[]externalRef0.Element instead.
I've created a fix for it: https://github.com/oapi-codegen/oapi-codegen/pull/1842
Can the PR please get a bump? Ran into this bug today and would love for it to get fixed.
Also experiencing the same issue, can we please get a fix in?
Seems to be duplicate of https://github.com/oapi-codegen/oapi-codegen/issues/1202 and https://github.com/oapi-codegen/oapi-codegen/issues/632.