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

Serve JSON spec too #10

Open
zupo opened this issue Apr 15, 2019 · 1 comment
Open

Serve JSON spec too #10

zupo opened this issue Apr 15, 2019 · 1 comment

Comments

@zupo
Copy link
Collaborator

zupo commented Apr 15, 2019

Besides serving the YAML spec, we should serve the JSON spec too.

See #9 (review).

@zupo zupo changed the title Server JSON spec too Serve JSON spec too May 8, 2019
@sayanarijit
Copy link
Contributor

Should we make add_spec_view auto-detect the file extension and serve the spec in that format?

e.g.

This will serve YAML spec:

add_spec_view(
    filepath: "/openapi.yaml",
    route: str = "/openapi.yaml",
)

This will serve JSON spec:

add_spec_view(
    filepath: "/openapi.yaml",
    route: str = "/openapi.json",
)

Also, I'm inclining towards defaulting route to /openapi.json regardless of the filepath format. Because that spec will mostly be read by programs/non-human entities. For humans, there is a UI based explorer.

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

No branches or pull requests

2 participants