Skip to content
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 #82

Closed
cnizzardini opened this issue Jun 28, 2020 · 0 comments
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@cnizzardini
Copy link
Owner

Describe the bug
When using XML request or response the following error is generated in Swagger UI:

XML example cannot be generated; root element name is undefined

See swagger-api/swagger-ui#4650

To Reproduce
Set swagger_bake.php config to use XML and reload swagger page. Then go to any post/patch or response.

        'requestAccepts' => ['application/xml'],
        'responseContentTypes' => ['application/xml'],

Expected behavior

Renders example without error

@cnizzardini cnizzardini added the bug Something isn't working label Jun 28, 2020
@cnizzardini cnizzardini added this to the 1.4 milestone Jun 28, 2020
@cnizzardini cnizzardini self-assigned this Jun 28, 2020
cnizzardini added a commit that referenced this issue Jun 28, 2020
- Added new OpenApi/Xml class
- Updated assets to include xml->name = response
- Updated unit tests
- Added OpenApi/Schema::xml
- Update OperationRequestBody and OperationResponse to use new Xml class
- Created Yaml Schema and SchemaProperty factories which includes Xml
and other properties that were missed
cnizzardini added a commit that referenced this issue Jun 28, 2020
XML example cannot be generated; root element name is undefined (#82)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant