[DEPRECATED]
Pick Swagger from code which wrote by gin
*gin.Engine
or *gin.RouterGroup
*gin.RouterGroup
will be prefix of path of *gin.Engine
GET
POST
PUT
PATCH
HEAD
DELETE
OPTIONS
:id
=> {id}
, double check with parameter definitions, undefined path parameter will be use 0
instead.operationId
req
or request
in scope of gin-handler will be used for picking parameters.in
of struct field must be defined, expect body parameter, but need to use fieldName Body
.json
will be used as name
status
will be picked by gin-context render method.c.JSON
will set schema by type of return value and with produce application/json
c.HTML
will with produce application/html
c.Rediect
c.Data
and c.Render
will be no responcejson
json:"key,string"
will force converting to string
default
will be set the default value, if it not exists, we will set field required
validate
will be set common validations, for example, validate:"@int[0,100)"
will be { "minimum": 0, "exclusiveMinimum": true, "maximum": 100 }
allOf
pick enum
from commented swagger:enum
type
string enum
from const
// swagger:enum State
type State int
const (
STATE_UNKNOWN = iota
STATE__ONE // one
STATE__TWO // two
STATE__THREE // three
)
will be
{
"enum": [
"ONE",
"TWO",
"THREE"
],
"x-enum-labels": [
"one",
"two",
"three"
],
"x-enum-type": "State"
}
validate:"@string{ONE,TWO}"
or validate:"@int{1,2}"
will be used for partial pick enum values;swagger:strfmt <format-name>
type