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

Obtaining openapi.yaml instead of openapi.json #13

Closed
MeCode4Food opened this issue Jul 21, 2020 · 4 comments
Closed

Obtaining openapi.yaml instead of openapi.json #13

MeCode4Food opened this issue Jul 21, 2020 · 4 comments

Comments

@MeCode4Food
Copy link
Contributor

Hi, often when I am trying to share the openapi specs, I have to go to localhost:8080/openapi.json, grab the json, convert it to a YAML format, and then share it.

It seems like a lot of places that use OpenAPI tend to accept it in YAML format instead of json.

Do you think by any chance that there is a way to do so from within the express server itself?

@wesleytodd
Copy link
Owner

I think this would be a great addition. A PR for this would be awesome. I think just as you say, if the request was for .yml or .yaml then run it through a json to yaml step before responding.

@MeCode4Food
Copy link
Contributor Author

MeCode4Food commented Oct 4, 2020

Added a PR to support this feature @wesleytodd

#15

@MeCode4Food
Copy link
Contributor Author

Originally wanted to run multiple requests inside the "create a basic valid OpenAPI document and serve test on an express app" test, but I don't know if supertest supports that (tried with promises using async await, didn't really work). Hence the duplication of tests for different formats

@wesleytodd
Copy link
Owner

I am going to close this since there is a PR open. Still need that to be updated, but updates can happen over there from now on.

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