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.
Consider these two specifications:
As well as the following options:
Running
oapi-codegen/oapi-codegen -config options.yaml a.yamlresults in the following type forMerged:Where
Bshould be*[]externalRef0.Elementinstead.