I am trying to auto-generate swagger.yaml
file using go-swagger
in my golang
project. I understood difference between path and operation. And here are links for individual documentation for swagger:router and swagger:operator. As I see the syntax for both looks same and I don't understand the nuance between them and when one should be used over another and in what cases ?
Asked
Active
Viewed 401 times
1

BhanuKiran
- 2,631
- 3
- 20
- 36
1 Answers
1
swagger:route is a bespoke syntax that has nothing to do with yaml, you'll notice this especially when you are defining responses
swagger:operation serves the same purpose in that it also allows you to define and describe routes, but the way you define parameters and responses is the regular swagger spec yaml. So with swagger:operation you are basically defining yaml snippets that get put verbatim in the swagger spec file.

Casual Jim
- 1,179
- 7
- 13