DummyJSON
DummyJSON copied to clipboard
OpenApi json file support
Hi,
Thanks for this useful apis.
Is it possible to add openapi like swagger to this app? For example, a swagger.json
file.
We could use this swagger.json file for generating different clients
Yep, I was looking for that. Bump this.
Hi, I made an experiment with swagger-jsdoc and swagger-ui-express. Fork available here
I only did it for the products API (and without descriptions, examples, ...)
- add new Swagger routes in index.js
- configure Swagger JsDoc in apiDocs.js
- add JsDoc comments in product.js
The Open API json file is available at '/api-docs/swagger.json' and the Swagger UI at '/api-docs'.
This could be a solution, surely not the only one. Embed Swagger UI is not necessary if you only want the json file, but it could replace a large part of the docs files.
Best Regards
json file swagger.json
screenshots
Thank you @c4rth for this, I (or someone else) can use this as a starting point to implement this feature, I'm trying to make up some time to start working on this.
Hi, would you consider adding a 'feature/openapi' branch for this feature? I have added docs for carts and partially updated docs for users, building upon @c4rth products' example.