response

swagger:response #

Reads a struct decorated with swagger:response and uses that information to fill up the headers and the schema for a response. A swagger:route can specify a response name for a status code and then the matching response will be used for that operation in the swagger definition.

Syntax: #
swagger:response [?response name]
Properties #
AnnotationDescription
Items.n.Maximumspecifies the maximum a number or integer value can have at the level n
Items.n.Minimumspecifies the minimum a number or integer value can have at the level n
Items.n.Multiple ofspecifies a value a number or integer value must be a multiple of
Items.n.Minimum lengththe minimum length for a string value at the level n
Items.n.Maximum lengththe maximum length for a string value at the level n
Items.n.Patterna regular expression a string value needs to match at the level n
Items.n.Minimum itemsthe minimum number of items a slice needs to have at the level n
Items.n.Maximum itemsthe maximum number of items a slice can have at the level n
Items.n.Uniquewhen set to true the slice can only contain unique items at the level n
Example #
// A ValidationError is an error that is used when the required input fails validation.
// swagger:response validationError
type ValidationError struct {
	// The error message
	// in: body
	Body struct {
		// The validation message
		//
		// Required: true
		// Example: Expected type int
		Message string
		// An optional field name to which this validation applies
		FieldName string
	}
}
Result #