I am rescuing this topic as I believe adding choice would be great for the
swagger spec. We have got, for instance, an IP that queries billing events.
Such events could be calls, SMSs, data traffic, or digital assets such as a
movie download. They have a common part (the ID, time, etc.) and a specific
part depending on the event type. We are having trouble documenting it as
Swagger today cannot cope with the requirement. My proposal would be to add
it this way:
"properties": [{
...
"element": {
"type": "choice",
"choices": [{
"$ref": "#/definitions/possibleType1"
},
{
"$ref": "#/definitions/possibleType2"
},
{
"type": "string"
}]
}
...
}]
Same way an array has its "items" field or a string has its "enum" or
format field, choice would have an array of possible choices which would
contain either a type or a reference.
--
You received this message because you are subscribed to the Google Groups
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.