Closed fehguy closed 10 years ago
Doesn't https://github.com/reverb/swagger-spec/blob/master/schemas/v2.0/schema.json#L465 apply to the root model schema?
no, I believe it just applies to properties. To apply to the root model, it needs to go around line 444 as well.
Extending https://github.com/reverb/swagger-spec/blob/master/fixtures/v2.0/json/models/modelWithXmlAttributes.json - I think the following is valid based on the current schema and applies to the root:
{
"description": "this model serves xml and json structures",
"properties": {
"id": {
"type": "integer",
"format": "int64",
"xml": {
"attribute": true,
"namespace": "ns1",
"prefix": "urn1"
}
},
"items": {
"type": "array",
"items": {
"type": "string"
},
"xml": {
"wrapped": true
}
}
},
"xml": {
"name": "Pet"
}
}
looks like it is supported.
Wait, does this mean I was right?
Yes Ron, you were/are right
Currently the
xml
decorations are allowed on a property but not the root model schema. This means you cannot override the name, namespace, prefix