Generate Swagger/OpenAPI document from schema
An extremely common task for me is to create a REST API for a collection in a MongoDB database.
For me, this involves creating a Swager/OpenAPI document that describes both "sides" of the API. For the most part this corresponds almost exactly to the schema of the documents in a collection and the set queries I use to retrieve them.
It seems to me that it would be possible (and relatively easy) to generate a schema from a collection and filter it into a Swagger/OpenAPI yaml file. It would be a great starting point for building the REST API. It also seems possible to add similar entries to the file example query JSON.
1
vote
Paul Uzee
shared this idea