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 examples are not rendered in OpenAPI Spec #246

Open
ingoboerner opened this issue Apr 17, 2024 · 1 comment
Open

XML examples are not rendered in OpenAPI Spec #246

ingoboerner opened this issue Apr 17, 2024 · 1 comment
Labels

Comments

@ingoboerner
Copy link
Collaborator

I loaded the OpenAPI Spec into the Swagger Editor https://editor.swagger.io (while documenting #172) . The XML examples of the responses are not rendered, Swagger Editor displays an error

<?xml version="1.0" encoding="UTF-8"?>
<!-- XML example cannot be generated; root element name is undefined -->

This also affects Swagger UI, e.g. https://dracor.org/doc/api#/public/play-tei

Bildschirmfoto 2024-04-17 um 11 03 41
@cmil
Copy link
Member

cmil commented Apr 17, 2024

I think the problem is that we don't define a schema for the response.

For the example endpoint and response (/corpora/{corpusname}/plays/{playname}/tei) we don't actually provide a literal XML. But for /corpora/{corpusname}/plays/{playname}/relations/gexf we actually do and if I'm not completely mistaken this used to render just fine in the past. (Maybe it broke when upgrading Swagger UI in dracor-org/dracor-frontend@7af2edc)

Anyway, the OpenAPI documentation on how to specify XML responses at https://swagger.io/docs/specification/data-models/representing-xml/ seems to require a JSON schema. Which would seem to be quite challenge to come up with for TEI and other complex XML vocabularies. Is there a way to reference other existing schemas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants