github.com/go-swagger/go-swagger@v0.31.0/docs/reference/annotations/ignore.md (about) 1 --- 2 title: ignore 3 date: 2023-01-01T01:01:01-08:00 4 draft: true 5 --- 6 # swagger:ignore 7 8 ## Syntax 9 10 ```go 11 swagger:ignore 12 ``` 13 14 ### Example 1: Marks a struct as explicitly ignore from the Swagger spec output 15 16 ```go 17 //swagger: ignore 18 type Patient struct { 19 // example: John Doe 20 name string `json:"name"` 21 // example: 27 22 age int `json:"age""` 23 // example: New York 24 city string `json:"city"` 25 // example: 1234567890 26 phone string `json:"phone"` 27 // example: 1A2B3C 28 uniqueId string `json:"unique_id"` 29 } 30 ``` 31 32 ### Example 2: Exclude a specific field from swagger spec output 33 34 ```go 35 //swagger: model Person 36 type Person struct { 37 // example: John Doe 38 name string `json:"name"` 39 // example: 27 40 age int `json:"age""` 41 // example: New York 42 city string `json:"city"` 43 // example: 1234567890 44 phone string `json:"phone"` 45 // example: 1A2B3C 46 // swagger: ignore 47 uniqueId string `json:"unique_id"` 48 } 49 ```