Documentation ¶
Index ¶
- func WithSchemaName(name string) func(*bodyOpt)
- type Response
- func (r *Response) Body(contentType string, data interface{}, opts ...func(*bodyOpt)) *Response
- func (r *Response) BodyWithSchema(contentType, schemaName string, schemaRef *openapi3.SchemaRef) *Response
- func (r *Response) Components(gen *openapi3gen.Generator, responseName, httpCode string) (components openapi3.Components, err error)
- func (r *Response) Description(desc string) *Response
- func (r *Response) Header(h *header.Header) *Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithSchemaName ¶
func WithSchemaName(name string) func(*bodyOpt)
WithSchemaName to override generated schema name from struct name to this name. For example, if you don't specify this it will use package.StructName as the schema name, but if you define this, then we will use this as the schema name.
Types ¶
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
func NewResponse ¶
func NewResponse() *Response
NewResponse only return one openapi3respRef openapi3.ResponseRef. If one path can contain multiple response openapi3schema, then it must have different http code.
func (*Response) BodyWithSchema ¶
func (*Response) Components ¶
func (r *Response) Components(gen *openapi3gen.Generator, responseName, httpCode string) (components openapi3.Components, err error)
Components returns openapi3.Components with the value of following fields: * openapi3.Schemas * openapi3.Headers * openapi3.Responses
func (*Response) Description ¶
Description will be added to new line each called.
Click to show internal directories.
Click to hide internal directories.