a-h / rest

Generate OpenAPI 3.0 specifications from Go code.
MIT License
55 stars 22 forks source link

feat: support primitive schema types for path params #2

Closed DandyCodes closed 1 year ago

DandyCodes commented 1 year ago

Support primitive schema types for path parameters:

api := rest.NewAPI("API")
api.Get("/user/{id}").HasPathParameter("id", rest.PathParam{Type: "integer"})

This provides the swagger ui (and auto-generated api clients) with additional type information for sending the correct type of path params to the server.

a-h commented 1 year ago

Thanks a lot for the contribution, nice one!

DandyCodes commented 1 year ago

Awesome project. Cheers!