Ovi / DummyJSON

DummyJSON.com provides different types of REST Endpoints filled with JSON data which you can use in developing the frontend with your favorite framework and library without worrying about writing a backend.
http://dummyjson.com
Other
1.66k stars 183 forks source link

OpenApi json file support #31

Open mehdihadeli opened 1 year ago

mehdihadeli commented 1 year ago

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

SrGeneroso commented 10 months ago

Yep, I was looking for that. Bump this.

c4rth commented 10 months ago

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, ...)

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

swagger-products swagger-products-get
Ovi commented 10 months ago

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.

safdevke commented 5 months ago

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.

image