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

Create openapi spec based on mongoose schema #26

Open
abelhbeyene opened this issue Apr 14, 2020 · 0 comments
Open

Create openapi spec based on mongoose schema #26

abelhbeyene opened this issue Apr 14, 2020 · 0 comments

Comments

@abelhbeyene
Copy link
Contributor

abelhbeyene commented Apr 14, 2020

Create an endpoint which shows an OpenApi spec for all the endpoints. The actual spec can be created using mongoose-to-swagger.

This can be automated so that as we iterate on the Models the doc is automatically updated.

This is assuming that the Models are a representation of the data they expose through one of the handlers.

@naody - thoughts?

Example implementation:

// In a handler
const swaggerSpecs = Object.keys(Models).map((model) => {
    return m2s(Models[model])
 })
handleResponse(callback, swaggerSpecs)
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

1 participant