How do I report a bug?
I think I've found a bug.
In our Swagger Hub listing for our API, for “POST /v2/document”, for Properties, Parameters, Datasources, and DataSets (inside Datasources) it’s not doing the Property, … inside it for the request body as application/xml.
For example it has:
<Properties>
<Name>string</Name>
<Value>string</Value>
</Properties>
When it should have:
<Properties>
<Property>
<Name>string</Name>
<Value>string</Value>
</Property>
</Properties>
For application/json it appears to be correct (an array):
"Properties": [
{
"Name": "string",
"Value": "string"
}
],
Is this a bug in my yaml or a bug in SwaggerHub?
Thanks - dave
Hi Dave,
You need to add a couple of XML-specific attributes to the schemas:
1) In Template.Properties, add xml.wrapped=true:
Template: type: object properties: ... Properties: description: "Windward properties for this document. These override any properties set in the configuration file on the server side." type: array items: $ref: '#/components/schemas/Property' xml: wrapped: true ...
2) In the Property schema, add xml.name:
Property: type: object description: "A property set at the individual document generation level." properties: ... xml: name: Property