schemas

package
v2.1.21 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package schemas provides primitives to interact with the openapi HTTP API.

Code generated by github.com/KosyanMedia/oapi-codegen/v2 version (devel) DO NOT EDIT.

Index

Constants

View Source
const (
	Access_tokenScopes = "access_token.Scopes"
)

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

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

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

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 AnyType1

type AnyType1 = interface{}

AnyType1 defines model for AnyType1.

type AnyType2

type AnyType2 = interface{}

AnyType2 represents any type.

This should be an interface{}

type CustomStringType

type CustomStringType = string

CustomStringType defines model for CustomStringType.

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 EnsureDefaultsNoPointersJSONBody added in v2.1.20

type EnsureDefaultsNoPointersJSONBody = EnsuredefaultsnopointersJSONRequestBodySchema

EnsureDefaultsNoPointersJSONBody defines parameters for EnsureDefaultsNoPointers.

type EnsureDefaultsNoPointersJSONRequestBody added in v2.1.20

type EnsureDefaultsNoPointersJSONRequestBody = EnsureDefaultsNoPointersJSONBody

EnsureDefaultsNoPointersJSONRequestBody defines body for EnsureDefaultsNoPointers for application/json ContentType.

type EnsureEverythingIsReferencedResponse

type EnsureEverythingIsReferencedResponse struct {
	Code    int
	JSON200 *Ensureeverythingisreferenced200JSONResponseBodySchema
}

type EnsuredefaultsnopointersJSONRequestBodySchema added in v2.1.20

type EnsuredefaultsnopointersJSONRequestBodySchema struct {
	BoolField   *bool    `default:"false" json:"bool_field,omitempty"`
	FloatField  *float64 `default:"0" json:"float_field,omitempty"`
	IntField    *int     `default:"0" json:"int_field,omitempty"`
	StringField *string  `default:"" json:"string_field,omitempty"`
}

EnsuredefaultsnopointersJSONRequestBodySchema defines model for EnsuredefaultsnopointersJSONRequestBodySchema.

type Ensureeverythingisreferenced200JSONResponseBodySchema added in v2.1.12

type Ensureeverythingisreferenced200JSONResponseBodySchema struct {
	AnyType1 AnyType1 `json:"anyType1,omitempty"`

	// AnyType2 represents any type.
	//
	// This should be an interface{}
	AnyType2         AnyType2          `json:"anyType2,omitempty"`
	CustomStringType *CustomStringType `foo:"bar" json:"customStringType,omitempty"`
}

Ensureeverythingisreferenced200JSONResponseBodySchema defines model for Ensureeverythingisreferenced200JSONResponseBodySchema.

type EnumInObjInArray

type EnumInObjInArray = []struct {
	Val *EnumInObjInArrayVal `json:"val,omitempty" validate:"omitempty,oneof=first second"`
}

EnumInObjInArray defines model for EnumInObjInArray.

type EnumInObjInArrayVal

type EnumInObjInArrayVal string

EnumInObjInArrayVal defines model for EnumInObjInArray.Val.

const (
	First  EnumInObjInArrayVal = "first"
	Second EnumInObjInArrayVal = "second"
)

Defines values for EnumInObjInArrayVal.

type GenericObject

type GenericObject = map[string]interface{}

GenericObject defines model for GenericObject.

type GetIssues375Response

type GetIssues375Response struct {
	Code    int
	JSON200 EnumInObjInArray
}

type Issue127Response

type Issue127Response struct {
	Code        int
	JSON200     GenericObject
	XML200      GenericObject
	YAML200     GenericObject
	JSONDefault GenericObject
}

type Issue185JSONBody

type Issue185JSONBody = NullableProperties

Issue185JSONBody defines parameters for Issue185.

type Issue185JSONRequestBody

type Issue185JSONRequestBody = Issue185JSONBody

Issue185JSONRequestBody defines body for Issue185 for application/json ContentType.

type Issue9JSONBody

type Issue9JSONBody = interface{}

Issue9JSONBody defines parameters for Issue9.

type Issue9JSONRequestBody

type Issue9JSONRequestBody = Issue9JSONBody

Issue9JSONRequestBody defines body for Issue9 for application/json ContentType.

type Issue9Params

type Issue9Params struct {
	Foo string `form:"foo" json:"foo" validate:"required"`
}

Issue9Params defines parameters for Issue9.

type N5StartsWithNumber

type N5StartsWithNumber = map[string]interface{}

This schema name starts with a number

type NullableProperties

type NullableProperties struct {
	Optional            *string `json:"optional,omitempty"`
	OptionalAndNullable *string `json:"optionalAndNullable,omitempty"`
	Required            string  `json:"required" validate:"required"`
	RequiredAndNullable *string `json:"requiredAndNullable" validate:"required"`
}

NullableProperties defines model for NullableProperties.

type ServerInterface

type ServerInterface interface {

	// (GET /ensure-defaults-no-pointers)
	EnsureDefaultsNoPointers(ctx echo.Context, requestBody EnsureDefaultsNoPointersJSONBody) (code int, err error)

	// (GET /ensure-everything-is-referenced)
	EnsureEverythingIsReferenced(ctx echo.Context) (resp *EnsureEverythingIsReferencedResponse, err error)

	// (GET /issues/127)
	Issue127(ctx echo.Context) (resp *Issue127Response, err error)

	// (GET /issues/185)
	Issue185(ctx echo.Context, requestBody Issue185JSONBody) (code int, err error)

	// (GET /issues/209/${str})
	Issue209(ctx echo.Context, str StringInPath) (code int, err error)

	// (GET /issues/30/{fallthrough})
	Issue30(ctx echo.Context, pFallthrough string) (code int, err error)

	// (GET /issues/375)
	GetIssues375(ctx echo.Context) (resp *GetIssues375Response, err error)

	// (GET /issues/41/{1param})
	Issue41(ctx echo.Context, n1param N5StartsWithNumber) (code int, err error)

	// (GET /issues/9)
	Issue9(ctx echo.Context, params Issue9Params, requestBody Issue9JSONBody) (code int, err error)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) EnsureDefaultsNoPointers added in v2.1.20

func (w *ServerInterfaceWrapper) EnsureDefaultsNoPointers(ctx echo.Context) error

EnsureDefaultsNoPointers converts echo context to params.

func (*ServerInterfaceWrapper) EnsureEverythingIsReferenced

func (w *ServerInterfaceWrapper) EnsureEverythingIsReferenced(ctx echo.Context) error

EnsureEverythingIsReferenced converts echo context to params.

func (*ServerInterfaceWrapper) GetIssues375

func (w *ServerInterfaceWrapper) GetIssues375(ctx echo.Context) error

GetIssues375 converts echo context to params.

func (*ServerInterfaceWrapper) Issue127

func (w *ServerInterfaceWrapper) Issue127(ctx echo.Context) error

Issue127 converts echo context to params.

func (*ServerInterfaceWrapper) Issue185

func (w *ServerInterfaceWrapper) Issue185(ctx echo.Context) error

Issue185 converts echo context to params.

func (*ServerInterfaceWrapper) Issue209

func (w *ServerInterfaceWrapper) Issue209(ctx echo.Context) error

Issue209 converts echo context to params.

func (*ServerInterfaceWrapper) Issue30

func (w *ServerInterfaceWrapper) Issue30(ctx echo.Context) error

Issue30 converts echo context to params.

func (*ServerInterfaceWrapper) Issue41

func (w *ServerInterfaceWrapper) Issue41(ctx echo.Context) error

Issue41 converts echo context to params.

func (*ServerInterfaceWrapper) Issue9

func (w *ServerInterfaceWrapper) Issue9(ctx echo.Context) error

Issue9 converts echo context to params.

type StringInPath

type StringInPath = string

StringInPath defines model for StringInPath.

Jump to

Keyboard shortcuts

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