Declares the value of the parameter that the server will use if none is provided, for example a “count” to control the number of results per page might default to 100 if not supplied by the client in the request. (Note: “default” has no meaning for required parameters.) See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2. Unlike JSON Schema this value MUST conform to the defined type for this parameter.
Determines the format of the array if type array is used. Possible values are:
csv - comma separated values foo,bar.
ssv - space separated values foo bar.
tsv - tab separated values foo\tbar.
pipes - pipe separated values foo|bar.
multi - corresponds to multiple parameter instances instead of multiple values for a single instance foo=bar&foo=baz. This is valid only for parameters in “query” or “formData”.
Default value is csv.
提示
具有数组类型的用户定义结构
1
// @Success 200 {array} model.Account <-- This is a user defined struct.
1 2 3 4 5 6
package model
type Account struct { ID int`json:"id" example:"1"` Name string`json:"name" example:"account name"` }
type Account struct { ID int`json:"id" example:"1"` Name string`json:"name" example:"account name"` PhotoUrls []string`json:"photo_urls" example:"http://test/image/1.jpg,http://test/image/2.jpg"` }