operations

package
Version: v0.26.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MyFunc added in v0.17.0

func MyFunc()

MyFunc contains a struct with parameters.

func MyOwnFunc added in v0.17.0

func MyOwnFunc()

MyOwnFunc contains a response inside it.

func ServeAPI

func ServeAPI(host, basePath string, schemes []string) error

ServeAPI serves the API for this record store

Types

type ComplexerOne

type ComplexerOne struct {
	SimpleOne
	mods.NotSelected
	mods.Notable
	CreatedAt strfmt.DateTime `json:"createdAt"`
	NoTagName string          `json:",omitempty"`
}

A ComplexerOne is composed of a SimpleOne and some extra fields. swagger:response complexerOne

type ComplexerOneParams

type ComplexerOneParams struct {
	SimpleOne
	mods.NotSelected
	mods.Notable
	CreatedAt strfmt.DateTime `json:"createdAt"`
	Secret    string          `json:"-"`

	// in: formData
	Informity string `json:"informity"`

	NoTagName string `json:",omitempty"`
}

A ComplexerOneParams is composed of a SimpleOne and some extra fields swagger:parameters yetAnotherOperation

type ComplexerPointerOne added in v0.17.0

type ComplexerPointerOne struct {
	*SimpleOne
	Extra int64 `json:"extra"`
}

A ComplexerPointerOne is composed of a *SimpleOne and some extra fields. swagger:response complexerPointerOne

type EmbeddedFileParams added in v0.17.0

type EmbeddedFileParams struct {
	*MyFileParams

	// ExtraParam desc.
	// in: formData
	// required: true
	ExtraParam int `json:"extraParam"`
}

EmbeddedFileParams embeds a *MyFileParams swagger:parameters myOtherOperation

type FileResponse added in v0.19.0

type FileResponse struct {
	// swagger:file
	// in:  body
	File []byte
}

File response

swagger:response fileResponse

type GenericError

type GenericError struct {
	// The error message
	// in: body
	Body struct {
		Message string
	}
}

A GenericError is an error that is used when no other error is appropriate swagger:response genericError

type GetConfiguration added in v0.26.0

type GetConfiguration struct {
	// in:body
	Value map[string]string
}

Success swagger:response GetConfiguration

type ListPetParams

type ListPetParams struct {
	// OutOfStock when set to true only the pets that are out of stock will be returned
	OutOfStock bool
}

ListPetParams the params for the list pets query

type MultipleOrderParams added in v0.17.0

type MultipleOrderParams struct {
	// The orders
	// required: true
	Orders []*OrderBodyParams `json:"orders"`

	// And another thing
	// in: body
	Another []struct {
		That string `json:"that"`
	} `json:"another"`
}

An MultipleOrderParams model.

This is used for operations that want multiple orders as the body swagger:parameters getOrders

type MyFileParams added in v0.17.0

type MyFileParams struct {
	// MyFormFile desc.
	//
	// in: formData
	//
	// swagger:file
	MyFormFile *bytes.Buffer `json:"myFormFile"`
}

MyFileParams contains the uploaded file data swagger:parameters myOperation

type NoParams

type NoParams struct {
	// ID of this no model instance.
	// ids in this application start at 11 and are smaller than 1000
	//
	// required: true
	// minimum: > 10
	// maximum: < 1000
	// in: path
	// default: 1
	ID int64 `json:"id"`

	// The Score of this model
	//
	// required: true
	// minimum: 3
	// maximum: 45
	// multiple of: 3
	// in: query
	// default: 2
	// example: 27
	Score int32 `json:"score"`

	// Name of this no model instance
	//
	// min length: 4
	// max length: 50
	// pattern: [A-Za-z0-9-.]*
	// required: true
	// in: header
	Name string `json:"x-hdr-name"`

	// Created holds the time when this entry was created
	//
	// required: false
	// in: query
	Created strfmt.DateTime `json:"created"`

	// The Category of this model
	//
	// required: true
	// enum: foo,bar,none
	// default: bar
	// in: query
	Category string `json:"category"`

	// Type of this model
	//
	// enum: 1,3,5
	// default: 1
	// in: query
	Type int `json:"type"`

	// This is mix in enum. And actually on output should be valid form where int will be int and
	// string will also be presented.
	//
	// enum: 1,rsq,qaz
	// in: query
	BadEnum int `json:"bad_enum"`

	// a FooSlice has foos which are strings
	//
	// min items: 3
	// max items: 10
	// unique: true
	// items.minLength: 3
	// items.maxLength: 10
	// items.pattern: \w+
	// collection format: pipe
	// items.default: bar
	// in: query
	FooSlice []string `json:"foo_slice"`

	// a BarSlice has bars which are strings
	//
	// min items: 3
	// max items: 10
	// unique: true
	// items.minItems: 4
	// items.maxItems: 9
	// items.enum: bar1,bar2,bar3
	// items.default: bar2
	// items.items.minItems: 5
	// items.items.maxItems: 8
	// items.items.items.minLength: 3
	// items.items.items.maxLength: 10
	// items.items.items.pattern: \w+
	// collection format: pipe
	// in: query
	BarSlice [][][]string `json:"bar_slice"`

	// the items for this order
	//
	// in: body
	Items []struct {
		// ID of this no model instance.
		// ids in this application start at 11 and are smaller than 1000
		//
		// required: true
		// minimum: > 10
		// maximum: < 1000
		// default: 3
		ID int32 `json:"id"`

		// The Pet to add to this NoModel items bucket.
		// Pets can appear more than once in the bucket
		//
		// required: true
		Pet *mods.Pet `json:"pet"`

		// The amount of pets to add to this bucket.
		//
		// required: true
		// minimum: 1
		// maximum: 10
		Quantity int16 `json:"quantity"`

		// Notes to add to this item.
		// This can be used to add special instructions.
		//
		//
		// required: false
		Notes string `json:"notes"`
	} `json:"items"`
}

NoParams is a struct that exists in a package but is not annotated with the swagger params annotations so it should now show up in a test

swagger:parameters someOperation swagger:parameters anotherOperation

type NoParamsAlias added in v0.17.0

type NoParamsAlias struct {
	// default "in" is "query" => this params should be aliased
	// required: true
	// minimum: 1
	// maximum: 10
	IntAlias    SomeIntType    `json:"intAlias"`
	StringAlias SomeStringType `json:"stringAlias"`
	// in: path
	IntAliasPath SomeIntType `json:"intAliasPath"`
	// in: formData
	IntAliasForm SomeIntType `json:"intAliasForm"`
}

NoParamsAlias is a struct that exists in a package but is not annotated with the swagger params annotations so it should now show up in a test

swagger:parameters someAliasOperation

type NumPlates added in v0.26.0

type NumPlates struct {
	// in: body
	NumPlates interface{} `json:"num_plates"`
}

swagger:parameters putNumPlate

type NumPlatesResp added in v0.26.0

type NumPlatesResp struct {
	// in: body
	NumPlates interface{} `json:"num_plates"`
}

swagger:response

type OrderBodyParams

type OrderBodyParams struct {
	// The order to submit.
	//
	// in: body
	// required: true
	Order *models.StoreOrder `json:"order"`
}

An OrderBodyParams model.

This is used for operations that want an Order as body of the request swagger:parameters updateOrder swagger:parameters createOrder

type Resp

type Resp struct {
	// in: body
	Body *user `json:"user"`

	// swagger:strfmt uuid
	UUID string
}

Resp a response for testing

swagger:response resp

type SetConfiguration added in v0.26.0

type SetConfiguration struct {
	// in:body
	Value map[string]string
}

Success swagger:parameters getConfiguration

type SimpleOne

type SimpleOne struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
	Age  int32  `json:"age"`
}

A SimpleOne is a model with a few simple fields

type SimpleOnes added in v0.17.0

type SimpleOnes struct {
	Ones []*SimpleOne `json:"ones"`
}

SimpleOnes is a collection of SimpleOne swagger:response simpleOnes

type SomeIntType added in v0.17.0

type SomeIntType int64

SomeIntType is a type that refines int64

type SomeResponse

type SomeResponse struct {
	// ID of this some response instance.
	// ids in this application start at 11 and are smaller than 1000
	//
	// minimum: > 10
	// maximum: < 1000
	// default: 11
	ID int64 `json:"id"`

	// The Score of this model
	//
	// minimum: 3
	// maximum: 45
	// multiple of: 3
	// example: 27
	Score int32 `json:"score"`

	// Active state of the record
	//
	// default: true
	Active bool `json:"active"`

	// Name of this some response instance
	//
	// min length: 4
	// max length: 50
	// pattern: [A-Za-z0-9-.]*
	Name string `json:"x-hdr-name"`

	// Created holds the time when this entry was created
	Created strfmt.DateTime `json:"created"`

	// a FooSlice has foos which are strings
	//
	// min items: 3
	// max items: 10
	// unique: true
	// items.minLength: 3
	// items.maxLength: 10
	// items.pattern: \w+
	// items.example: foo
	// collection format: pipe
	FooSlice []string `json:"foo_slice"`

	// a BarSlice has bars which are strings
	//
	// min items: 3
	// max items: 10
	// unique: true
	// items.minItems: 4
	// items.maxItems: 9
	// items.items.minItems: 5
	// items.items.maxItems: 8
	// items.items.items.minLength: 3
	// items.items.items.maxLength: 10
	// items.items.items.pattern: \w+
	// collection format: pipe
	BarSlice [][][]string `json:"bar_slice"`

	// the items for this order
	//
	// in: body
	Items []struct {
		// ID of this some response instance.
		// ids in this application start at 11 and are smaller than 1000
		//
		// required: true
		// minimum: > 10
		// maximum: < 1000
		ID int32 `json:"id"`

		// The Pet to add to this NoModel items bucket.
		// Pets can appear more than once in the bucket
		//
		// required: true
		Pet *mods.Pet `json:"pet"`

		// The amount of pets to add to this bucket.
		//
		// required: true
		// minimum: 1
		// maximum: 10
		Quantity int16 `json:"quantity"`

		// Notes to add to this item.
		// This can be used to add special instructions.
		//
		// required: false
		Notes string `json:"notes"`
	} `json:"items"`
}

A SomeResponse is a dummy response object to test parsing.

The properties are the same as the other structs used to test parsing.

swagger:response someResponse

type SomeStringType added in v0.17.0

type SomeStringType string

SomeStringType is a type that refines string

type ValidationError

type ValidationError struct {
	// in: header
	// enum: foo,bar
	// default: 400
	Code int `json:"code"`

	// The error message
	// in: body
	Body struct {
		// The validation message
		Message string
		// An optional field name to which this validation applies
		FieldName string
	}
}

A ValidationError is an error that is used when the required input fails validation. swagger:response validationError

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL