xml example cannot be generated for response type of array
See original GitHub issueQ&A (please complete the following information)
- OS: Windows 10
- Browser: Firefox, Chrome, Edge
- Method of installation: npm
- Swagger-UI version: 3.11.0
- Swagger/OpenAPI version: Swagger 2.0
Content & configuration
I’ve reproduced this locally, but even easier to demonstrate, petstore has the same issue.
Example Swagger/OpenAPI definition: https://generator.swagger.io/api/swagger.json
snippet from swagger.json
responses:
200:
description: "successful operation"
schema:
type: "array"
items:
$ref: "#/definitions/Pet"
Describe the bug you’re encountering
In swagger ui, when you have a GET that has a response that is a list, and you selected content type of xml, the Example Value has an error “XML example cannot be generated”.
To reproduce…
Steps to reproduce the behavior:
- Go to https://editor.swagger.io
- Expand /pet/findByStatus
- Make sure Response content type is application/xml
- Example Value for status code 200 has “XML example cannot be generated”
Expected behavior
I would expect to see the example xml for the response.
Screenshots
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:34
Top Results From Across the Web
Representing XML - Swagger
In your API specification, you can describe data in both XML and JSON formats as ... books: type: array; items: type: string; xml:...
Read more >How can I add xml example in Swagger documentation
Hello I am creating swagger documentation for an api and I would like to add xml example but I can`t ...
Read more >XMLHttpRequest.responseType - Web APIs | MDN
The XMLHttpRequest property responseType is an enumerated string value specifying the type of data contained in the response.
Read more >Question: Parsing/Mapping JSON profile to XML Response ...
I have imported a json profile containing an example response and i generated a response profile, this one holds an array of these...
Read more >Working With SOAP Request and Response Messages - SoapUI
Depending on the field type, ReadyAPI renders different editors, including special editors for dates, times, arrays, lists and so on. For example, below...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found a work-around for this https://app.swaggerhub.com/apis/whateverxforever/SampleApi/v1-oas3
I hope this helped! 😉
I made an issue for it https://github.com/eclipse/microprofile-open-api/issues/530