github.com/go-swagger/go-swagger@v0.31.0/docs/reference/annotations/type.md (about) 1 --- 2 title: type 3 date: 2023-01-01T01:01:01-08:00 4 draft: true 5 --- 6 # swagger:type 7 8 **swagger:type** can be used to mark a struct with its type. This will override the type inferred by go-swagger. 9 10 [These data types](https://swagger.io/docs/specification/data-models/data-types/) are supported by Swagger. 11 12 ##### Syntax 13 14 ```go 15 swagger:type [type] 16 ``` 17 18 ##### Example 19 20 ```go 21 // swagger:type string 22 type NullString struct { 23 sql.NullString 24 } 25 26 // swagger:model myString 27 type MyString struct { 28 NS NullString 29 } 30 ``` 31 32 ##### Result 33 34 ```yaml 35 ```