play-swagger
play-swagger copied to clipboard
OneOf Support ?
Hi !
I am trying to generate an openapi spec with a oneOf field.
I've put the schema containing the oneOf in the conf/swagger.json file:
"components": {
"schemas": {
"models.RequestType": {
"oneOf": [
{"$ref" : "#/components/schemas/models.OccurenceData"},
{"$ref": "#/components/schemas/models.EntityOccurenceData"},
{"$ref": "#/components/schemas/models.CategoricalData"},
{"$ref": "#/components/schemas/models.EntityCategoricalData"},
{"$ref": "#/components/schemas/models.ValueData"},
{"$ref": "#/components/schemas/models.EntityValueData"}
]
},
"models.DatasetSpecs": {
"properties": {
"populationId":{"type": "string"},
"dataSpec": {
"type": "array",
"items": {
"$ref":"#/components/schemas/models.DataSpec"
}
},
"period":{
"type": "array",
"items": {
"$ref":"#/components/schemas/models.Period"
}
}
}
}
}
}
All the refered models are generated correctly. The DataSpec model is generated correctly. However, the route parameters will not refer to it:
###
# parameters:
# - name: body
# schema:
# $ref: '#/components/schemas/models.DatasetSpecs'
POST /dataset controllers.DatasetController.create
does render an empty post route.
Expected behavior:
The openapi file should contain a response type and a body parameter pointing to the documented ref.
@terence-bigtt 最終的に生成された YAML はどのようになっていますか?