Documentation ¶
Overview ¶
Package components provides primitives to interact with the openapi HTTP API.
Code generated by github.com/KosyanMedia/oapi-codegen/v2 version (devel) DO NOT EDIT.
Index ¶
- func GetSwagger() (swagger *openapi3.T, err error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func RegisterHandlers(router EchoRouter, si ServerInterface, m ...echo.MiddlewareFunc)
- func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string, ...)
- type AdditionalPropertiesObject1
- type AdditionalPropertiesObject2
- type AdditionalPropertiesObject3
- func (a AdditionalPropertiesObject3) Get(fieldName string) (value interface{}, found bool)
- func (a AdditionalPropertiesObject3) MarshalJSON() ([]byte, error)
- func (a *AdditionalPropertiesObject3) Set(fieldName string, value interface{})
- func (a *AdditionalPropertiesObject3) UnmarshalJSON(b []byte) error
- type AdditionalPropertiesObject4
- func (a AdditionalPropertiesObject4) Get(fieldName string) (value interface{}, found bool)
- func (a AdditionalPropertiesObject4) MarshalJSON() ([]byte, error)
- func (a *AdditionalPropertiesObject4) Set(fieldName string, value interface{})
- func (a *AdditionalPropertiesObject4) UnmarshalJSON(b []byte) error
- type AdditionalPropertiesObject4_Inner
- func (a AdditionalPropertiesObject4_Inner) Get(fieldName string) (value interface{}, found bool)
- func (a AdditionalPropertiesObject4_Inner) MarshalJSON() ([]byte, error)
- func (a *AdditionalPropertiesObject4_Inner) Set(fieldName string, value interface{})
- func (a *AdditionalPropertiesObject4_Inner) UnmarshalJSON(b []byte) error
- type AdditionalPropertiesObject5
- type BodyWithAddPropsJSONBody
- type BodyWithAddPropsJSONRequestBody
- type EchoRouter
- type EnsureEverythingIsReferencedJSONRequestBody
- type EnsureEverythingIsReferencedResponse
- type Enum1
- type Enum2
- type Enum3
- type Enum4
- type Enum5
- type EnumParam1
- type EnumParam2
- type EnumParam3
- type ObjectWithJsonField
- type ParameterObject
- type ParamsWithAddPropsParams
- type ParamsWithAddPropsParams_P1
- type RequestBody
- type ResponseObject
- type SchemaObject
- type ServerInterface
- type ServerInterfaceWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.
func PathToRawSpec ¶
Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
func RegisterHandlers ¶
func RegisterHandlers(router EchoRouter, si ServerInterface, m ...echo.MiddlewareFunc)
RegisterHandlers adds each server route to the EchoRouter.
func RegisterHandlersWithBaseURL ¶
func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string, m ...echo.MiddlewareFunc)
Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.
Types ¶
type AdditionalPropertiesObject1 ¶
type AdditionalPropertiesObject1 struct { Id int `json:"id" validate:"required"` Name string `json:"name" validate:"required"` Optional *string `json:"optional,omitempty"` AdditionalProperties map[string]int `json:"-"` }
Has additional properties of type int
func (AdditionalPropertiesObject1) Get ¶
func (a AdditionalPropertiesObject1) Get(fieldName string) (value int, found bool)
Getter for additional properties for AdditionalPropertiesObject1. Returns the specified element and whether it was found
func (AdditionalPropertiesObject1) MarshalJSON ¶
func (a AdditionalPropertiesObject1) MarshalJSON() ([]byte, error)
Override default JSON handling for AdditionalPropertiesObject1 to handle AdditionalProperties
func (*AdditionalPropertiesObject1) Set ¶
func (a *AdditionalPropertiesObject1) Set(fieldName string, value int)
Setter for additional properties for AdditionalPropertiesObject1
func (*AdditionalPropertiesObject1) UnmarshalJSON ¶
func (a *AdditionalPropertiesObject1) UnmarshalJSON(b []byte) error
Override default JSON handling for AdditionalPropertiesObject1 to handle AdditionalProperties
type AdditionalPropertiesObject2 ¶
type AdditionalPropertiesObject2 struct { Id int `json:"id" validate:"required"` Name string `json:"name" validate:"required"` }
Does not allow additional properties
type AdditionalPropertiesObject3 ¶
type AdditionalPropertiesObject3 struct { Name string `json:"name" validate:"required"` AdditionalProperties map[string]interface{} `json:"-"` }
Allows any additional property
func (AdditionalPropertiesObject3) Get ¶
func (a AdditionalPropertiesObject3) Get(fieldName string) (value interface{}, found bool)
Getter for additional properties for AdditionalPropertiesObject3. Returns the specified element and whether it was found
func (AdditionalPropertiesObject3) MarshalJSON ¶
func (a AdditionalPropertiesObject3) MarshalJSON() ([]byte, error)
Override default JSON handling for AdditionalPropertiesObject3 to handle AdditionalProperties
func (*AdditionalPropertiesObject3) Set ¶
func (a *AdditionalPropertiesObject3) Set(fieldName string, value interface{})
Setter for additional properties for AdditionalPropertiesObject3
func (*AdditionalPropertiesObject3) UnmarshalJSON ¶
func (a *AdditionalPropertiesObject3) UnmarshalJSON(b []byte) error
Override default JSON handling for AdditionalPropertiesObject3 to handle AdditionalProperties
type AdditionalPropertiesObject4 ¶
type AdditionalPropertiesObject4 struct { Inner AdditionalPropertiesObject4_Inner `json:"inner" validate:"required"` Name string `json:"name" validate:"required"` AdditionalProperties map[string]interface{} `json:"-"` }
Has anonymous field which has additional properties
func (AdditionalPropertiesObject4) Get ¶
func (a AdditionalPropertiesObject4) Get(fieldName string) (value interface{}, found bool)
Getter for additional properties for AdditionalPropertiesObject4. Returns the specified element and whether it was found
func (AdditionalPropertiesObject4) MarshalJSON ¶
func (a AdditionalPropertiesObject4) MarshalJSON() ([]byte, error)
Override default JSON handling for AdditionalPropertiesObject4 to handle AdditionalProperties
func (*AdditionalPropertiesObject4) Set ¶
func (a *AdditionalPropertiesObject4) Set(fieldName string, value interface{})
Setter for additional properties for AdditionalPropertiesObject4
func (*AdditionalPropertiesObject4) UnmarshalJSON ¶
func (a *AdditionalPropertiesObject4) UnmarshalJSON(b []byte) error
Override default JSON handling for AdditionalPropertiesObject4 to handle AdditionalProperties
type AdditionalPropertiesObject4_Inner ¶
type AdditionalPropertiesObject4_Inner struct { Name string `json:"name" validate:"required"` AdditionalProperties map[string]interface{} `json:"-"` }
AdditionalPropertiesObject4_Inner defines model for AdditionalPropertiesObject4.Inner.
func (AdditionalPropertiesObject4_Inner) Get ¶
func (a AdditionalPropertiesObject4_Inner) Get(fieldName string) (value interface{}, found bool)
Getter for additional properties for AdditionalPropertiesObject4_Inner. Returns the specified element and whether it was found
func (AdditionalPropertiesObject4_Inner) MarshalJSON ¶
func (a AdditionalPropertiesObject4_Inner) MarshalJSON() ([]byte, error)
Override default JSON handling for AdditionalPropertiesObject4_Inner to handle AdditionalProperties
func (*AdditionalPropertiesObject4_Inner) Set ¶
func (a *AdditionalPropertiesObject4_Inner) Set(fieldName string, value interface{})
Setter for additional properties for AdditionalPropertiesObject4_Inner
func (*AdditionalPropertiesObject4_Inner) UnmarshalJSON ¶
func (a *AdditionalPropertiesObject4_Inner) UnmarshalJSON(b []byte) error
Override default JSON handling for AdditionalPropertiesObject4_Inner to handle AdditionalProperties
type AdditionalPropertiesObject5 ¶
type AdditionalPropertiesObject5 map[string]SchemaObject
Has additional properties with schema for dictionaries
type BodyWithAddPropsJSONBody ¶
type BodyWithAddPropsJSONBody struct { Inner map[string]int `json:"inner" validate:"required"` Name string `json:"name" validate:"required"` AdditionalProperties map[string]interface{} `json:"-"` }
BodyWithAddPropsJSONBody defines parameters for BodyWithAddProps.
func (BodyWithAddPropsJSONBody) Get ¶
func (a BodyWithAddPropsJSONBody) Get(fieldName string) (value interface{}, found bool)
Getter for additional properties for BodyWithAddPropsJSONBody. Returns the specified element and whether it was found
func (BodyWithAddPropsJSONBody) MarshalJSON ¶
func (a BodyWithAddPropsJSONBody) MarshalJSON() ([]byte, error)
Override default JSON handling for BodyWithAddPropsJSONBody to handle AdditionalProperties
func (*BodyWithAddPropsJSONBody) Set ¶
func (a *BodyWithAddPropsJSONBody) Set(fieldName string, value interface{})
Setter for additional properties for BodyWithAddPropsJSONBody
func (*BodyWithAddPropsJSONBody) UnmarshalJSON ¶
func (a *BodyWithAddPropsJSONBody) UnmarshalJSON(b []byte) error
Override default JSON handling for BodyWithAddPropsJSONBody to handle AdditionalProperties
type BodyWithAddPropsJSONRequestBody ¶
type BodyWithAddPropsJSONRequestBody BodyWithAddPropsJSONBody
BodyWithAddPropsJSONRequestBody defines body for BodyWithAddProps for application/json ContentType.
type EchoRouter ¶
type EchoRouter interface { CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route }
This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration
type EnsureEverythingIsReferencedJSONRequestBody ¶
type EnsureEverythingIsReferencedJSONRequestBody RequestBody
EnsureEverythingIsReferencedJSONRequestBody defines body for EnsureEverythingIsReferenced for application/json ContentType.
type EnsureEverythingIsReferencedResponse ¶
type EnsureEverythingIsReferencedResponse struct { Code int JSON200 *struct { // Has additional properties with schema for dictionaries Five AdditionalPropertiesObject5 `json:"five,omitempty"` // Has anonymous field which has additional properties Four *AdditionalPropertiesObject4 `json:"four,omitempty"` JsonField *ObjectWithJsonField `json:"jsonField,omitempty"` // Has additional properties of type int One *AdditionalPropertiesObject1 `json:"one,omitempty"` // Allows any additional property Three *AdditionalPropertiesObject3 `json:"three,omitempty"` // Does not allow additional properties Two *AdditionalPropertiesObject2 `json:"two,omitempty"` } JSONDefault *struct { Field SchemaObject `json:"Field" validate:"required"` } }
type Enum1 ¶ added in v2.1.0
type Enum1 string
Conflicts with Enum2, enum values need to be prefixed with type name.
type Enum2 ¶ added in v2.1.0
type Enum2 string
Conflicts with Enum1, enum values need to be prefixed with type name.
type Enum3 ¶ added in v2.1.0
type Enum3 string
Enum values conflict with Enums above, need to be prefixed with type name.
type EnumParam1 ¶ added in v2.1.0
type EnumParam1 string
EnumParam1 defines model for EnumParam1.
const ( EnumParam1Both EnumParam1 = "both" EnumParam1False EnumParam1 = "false" EnumParam1True EnumParam1 = "true" )
Defines values for EnumParam1.
type EnumParam2 ¶ added in v2.1.0
type EnumParam2 string
EnumParam2 defines model for EnumParam2.
const ( EnumParam2Both EnumParam2 = "both" EnumParam2False EnumParam2 = "false" EnumParam2True EnumParam2 = "true" )
Defines values for EnumParam2.
type EnumParam3 ¶ added in v2.1.0
type EnumParam3 string
EnumParam3 defines model for EnumParam3.
const ( Alice EnumParam3 = "alice" Bob EnumParam3 = "bob" Eve EnumParam3 = "eve" )
Defines values for EnumParam3.
type ObjectWithJsonField ¶
type ObjectWithJsonField struct { Name string `json:"name" validate:"required"` Value1 json.RawMessage `json:"value1" validate:"required"` Value2 json.RawMessage `json:"value2,omitempty"` }
ObjectWithJsonField defines model for ObjectWithJsonField.
type ParamsWithAddPropsParams ¶
type ParamsWithAddPropsParams struct { // This parameter has additional properties P1 ParamsWithAddPropsParams_P1 `json:"p1" validate:"required"` // This parameter has an anonymous inner property which needs to be // turned into a proper type for additionalProperties to work P2 struct { Inner map[string]string `json:"inner" validate:"required"` } `form:"p2" json:"p2" validate:"required"` }
ParamsWithAddPropsParams defines parameters for ParamsWithAddProps.
type ParamsWithAddPropsParams_P1 ¶
type ParamsWithAddPropsParams_P1 map[string]interface{}
ParamsWithAddPropsParams_P1 defines parameters for ParamsWithAddProps.
type RequestBody ¶
type RequestBody struct {
Field SchemaObject `json:"Field" validate:"required"`
}
RequestBody defines model for RequestBody.
type ResponseObject ¶
type ResponseObject struct {
Field SchemaObject `json:"Field" validate:"required"`
}
ResponseObject defines model for ResponseObject.
type SchemaObject ¶
type SchemaObject struct { FirstName string `json:"firstName" validate:"required"` // This property is required and readOnly, so the go model should have it as a pointer, // as it will not be included when it is sent from client to server. ReadOnlyRequiredProp *string `json:"readOnlyRequiredProp,omitempty" validate:"required"` Role string `json:"role" validate:"required"` WriteOnlyRequiredProp *int `json:"writeOnlyRequiredProp,omitempty" validate:"required"` }
SchemaObject defines model for SchemaObject.
type ServerInterface ¶
type ServerInterface interface { // (GET /ensure-everything-is-referenced) EnsureEverythingIsReferenced(ctx echo.Context, requestBody RequestBody) (resp *EnsureEverythingIsReferencedResponse, err error) // (GET /params_with_add_props) ParamsWithAddProps(ctx echo.Context, params ParamsWithAddPropsParams) (code int, err error) // (POST /params_with_add_props) BodyWithAddProps(ctx echo.Context, requestBody BodyWithAddPropsJSONBody) (code int, err error) }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) BodyWithAddProps ¶
func (w *ServerInterfaceWrapper) BodyWithAddProps(ctx echo.Context) error
BodyWithAddProps converts echo context to params.
func (*ServerInterfaceWrapper) EnsureEverythingIsReferenced ¶
func (w *ServerInterfaceWrapper) EnsureEverythingIsReferenced(ctx echo.Context) error
EnsureEverythingIsReferenced converts echo context to params.
func (*ServerInterfaceWrapper) ParamsWithAddProps ¶
func (w *ServerInterfaceWrapper) ParamsWithAddProps(ctx echo.Context) error
ParamsWithAddProps converts echo context to params.