clean-gin icon indicating copy to clipboard operation
clean-gin copied to clipboard

Add swagger documentation for API

Open dipeshdulal opened this issue 3 years ago • 4 comments

Swagger Documentation for clean-gin

dipeshdulal avatar Jul 30 '21 06:07 dipeshdulal

In order to continue the template with a swagger documentation. I propose to use an OpenApi v3 interface contract in json format in an api folder: swagger.json.

Moreover, it could be interesting to add a schema validator like https://github.com/getkin/kin-openapi on the requests made on the server through the creation of a middleware.

Fimeo avatar Feb 22 '23 14:02 Fimeo

@Fimeo Thank you. Didn't know about kin-openapi project. Looks interesting and useful.

So, kin-openapi can validate request inputs and response output from the openapi schema as well or just validate schema only? 🤔

dipeshdulal avatar Feb 23 '23 05:02 dipeshdulal

Yes kin openapi takes the request and validates all schema against the openapi definition.

It was really usefull for standard validation and provides low code and easy validation.

You can validate the input request and if an error was found, cancel the request with appropriate error message.

Fimeo avatar Feb 27 '23 23:02 Fimeo

Wow. 🤩 This really looks useful. I will try to integrate with our architecture soon. 🏃 💨

dipeshdulal avatar Feb 28 '23 06:02 dipeshdulal