-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
Ref resolutiondiscriminatorRelated to polymorphic typesRelated to polymorphic typesenhancementflattenRelated to spec flatteningRelated to spec flattening
Description
Problem statement
Models not generated for subtypes of a type when both defined in external $ref
.
Swagger specification
In this example, WriteRequest
will not be generated.
swagger.yaml
:
...
paths:
/collections:
post:
...
parameters:
- name: serverRequest
shema:
$ref: 'collections.yaml/#BaseRequest'
collections.yaml
BaseRequest:
type: object
discriminator: '@type'
properties:
'@type':
type: string
...
WriteRequest:
type: object
allOf:
- $ref: '#BaseRequest'
- properties:
...
Steps to reproduce
Take something similar to the examples above and just do swagger generate server --spec=swagger.yaml
. The model for BaseRequest
will be present, but not for WriteRequest
.
Environment
swagger version: 0.18.0
go version: 1.11.4
OS: Ubuntu 18.04
zgramana and majodev
Metadata
Metadata
Assignees
Labels
Ref resolutiondiscriminatorRelated to polymorphic typesRelated to polymorphic typesenhancementflattenRelated to spec flatteningRelated to spec flattening