-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XML example cannot be generated; root element name is undefined #2136
Comments
Hi @fdcds, thanks for the detailed report. This issue is already tracked in swagger-api/swagger-ui#4650, so I'll close this one as a duplicate. Please follow the linked issue for updates. |
Any updates on this issue? Thanks |
Found it, you also need to include wrapped: true next to the name, so the full example should read:
|
@JeroenHeemskerk Thanks for this but where to add
|
Q&A (please complete the following information)
Content & configuration
I took the Swagger Editor example (Swagger 2.0), saved it, converted it to OpenAPI 3.0, and loaded it into the editor again.
Example Swagger/OpenAPI definition:
Swagger-Editor configuration options: defaults for the Application Container from docker.io/swaggerapi/swagger-editor:v3.8.0@sha256:8a4fd361c61415ddfc30390d345ddaf4eccaabde240f610020fe4cbef8e2fd31, I did not change any settings.
Describe the bug you're encountering
Looking at the example for
/pet/findByTags
, Swagger Editor displays for Media Typeapplication/xml
:Changing the declaration to:
Will make the example render as:
Note that there is no
XYZ
tag anywhere and no root tag either.To reproduce...
Steps to reproduce the behavior:
application/xml
/pet/findByTags
Expected behavior
When adding xml: name: XYZ, I would expect a root tag "XYZ" to be rendered around the example data. Alternatively the editor should not complain and just render the example.
The text was updated successfully, but these errors were encountered: