swagger-api / swagger-parser

Swagger Spec to Java POJOs
http://swagger.io
Apache License 2.0
782 stars 529 forks source link

XML attributes not parsed #1005

Open earniedyke opened 5 years ago

earniedyke commented 5 years ago

I have to define an older schema that is XML and I need to use xml: attribute, name and wrapped attributes but when I parse my swagger doc these attributes do not appear in the related pojos. swagger.-doc.zip

gracekarina commented 5 years ago

Hi, @earniedyke. I was looking at this issue and reviewing the documentation about xml attribute in openapi 2.0, it says that it will only be taking in account when located at a property level, if you place it at a schema in root level it won't be parse. I did a local test with your spec, and saw that xml and wrapped attribute are in fact parsed but only in a property. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#schema-object This MAY be used only on properties schemas. It has no effect on root schemas. Adds Additional metadata to describe the XML representation format of this property.

Please let us know if this helps you, and if this is no longer an issue it may be closed.