I used a oneOf and it rendered as an empty object. It seems to be ignored right now.
oneOf is not supported by the Swagger specification.
Not even in the part where it delegates to jsonschema?
Not anywhere. We don't delegate to JSON Schema. The spec is very specific about it. We use an extended subset of JSON Schema, and explicitly don't support oneOf.
Unfortunately no. It uses a subset of the draft-4.
You could adapt the swagger-client.js by adding an extra model type and resolve it accordingly.
Just curious. Why was oneOf explicitly not supported?
@willshulman - https://github.com/swagger-api/swagger-spec/issues/57
This way something like defining a tree structure is not possible ..... Really bad news (Thought Swagger is good, but - oh, well ....)
E.g.
"ModelFolder": {
"properties": {
"id": {
"type": "number",
"format": "integer"
},
"parentId": {
"type": "number",
"format": "integer"
},
"name": {
"type": "string"
},
"itemType": {
"type": "string"
},
"children": {
"type": "array",
"items": {
"anyOf":[
{ "$ref": "#/definitions/ModelFolder" },
{ "$ref": "#/definitions/Model" }
]
}
}
},
"Model": {
"properties": {
"id": {
"type": "number",
"format": "integer"
},
"parentId": {
"type": "number",
"format": "integer"
},
"name": {
"type": "string"
},
"itemType": {
"type": "string"
}
}
is not possible ?!?!?!?
I don't get it (Please be more pragmatic. But maybe its technically simply not doable in the Swagger implementation).
It is doable, but please send your question to the google group. It has nothing to do with the UI.