github.com/go-swagger/go-swagger@v0.31.0/docs/reference/annotations/route.md (about) 1 --- 2 title: route 3 date: 2023-01-01T01:01:01-08:00 4 draft: true 5 --- 6 # swagger:route 7 8 A **swagger:route** annotation links a path to a method. 9 This operation gets a unique id, which is used in various places as method name. 10 One such usage is in method names for client generation for example. 11 12 Because there are many routers available, this tool does not try to parse the paths 13 you provided to your routing library of choice. So you have to specify your path pattern 14 yourself in valid swagger syntax. 15 16 <!--more--> 17 18 ##### Syntax: 19 20 ```go 21 swagger:route [method] [path pattern] [?tag1 tag2 tag3] [operation id] 22 ``` 23 24 ##### Properties 25 26 Annotation | Format 27 ``` 28 paths: 29 "/pets": 30 get: 31 operationId: listPets 32 deprecated: true 33 summary: Lists pets filtered by some parameters. 34 description: "This will show all available pets by default.\nYou can get the pets that are out of stock" 35 tags: 36 - pets 37 - users 38 consumes: 39 - application/json 40 - application/x-protobuf 41 produces: 42 - application/json 43 - application/x-protobuf 44 schemes: 45 - http 46 - https 47 - ws 48 - wss 49 security: 50 api_key: [] 51 oauth: 52 - read 53 - write 54 parameters: 55 description: maximum number of results to return 56 format: int43 57 in: query 58 name: limit 59 type: integer 60 responses: 61 default: 62 $ref: "#/responses/genericError" 63 200: 64 $ref: "#/responses/someResponse" 65 422: 66 $ref: "#/responses/validationError" 67 extensions: 68 x-example-flag: true 69 x-some-list: 70 - dog 71 - cat 72 - bird 73 ```