I have an enum of other definitions in my Swagger spec:
"action": {
"title": "Action",
"description": "Action to apply to matching requests",
"type": "object",
"enum": [
{"delayAction": {"$ref": "#/definitions/delayAction"}},
{"abortAction": {"$ref": "#/definitions/abortAction"}},
{"traceAction": {"$ref": "#/definitions/traceAction"}}
]
}
and delayAction
, abortAction
, and traceAction
are all defined.
But in the Swagger UI the model for action
is empty.
How can I modify my Swagger definition so Swagger UI can show the definition of action
in the model?
ChartFormat:
type: object
description: chart info
properties:
chartMode:
oneOf:
- $ref: '#/components/schemas/NumberMode'
- $ref: '#/components/schemas/BarChartMode'
- $ref: '#/components/schemas/LineChartMode'
- $ref: '#/components/schemas/PieMode'
use oneOf keyword
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With