Documentation ¶
Overview ¶
Package internal keeps reusable internal code.
Index ¶
- func ReflectJSONResponse(r *jsonschema.Reflector, output interface{}, ...) (schema *jsonschema.Schema, err error)
- func ReflectParametersIn(r *jsonschema.Reflector, oc openapi.OperationContext, c openapi.ContentUnit, ...) (jsonschema.Schema, error)
- func ReflectRequestBody(is31 bool, r *jsonschema.Reflector, cu openapi.ContentUnit, httpMethod string, ...) (schema *jsonschema.Schema, hasFileUpload bool, err error)
- func ReflectResponseHeader(r *jsonschema.Reflector, oc openapi.OperationContext, cu openapi.ContentUnit, ...) (jsonschema.Schema, error)
- type OperationContext
- func (o *OperationContext) AddReqStructure(s interface{}, options ...openapi.ContentOption)
- func (o *OperationContext) AddRespStructure(s interface{}, options ...openapi.ContentOption)
- func (o *OperationContext) IsProcessingResponse() bool
- func (o *OperationContext) Method() string
- func (o *OperationContext) PathPattern() string
- func (o *OperationContext) ProcessingIn() openapi.In
- func (o *OperationContext) Request() []openapi.ContentUnit
- func (o *OperationContext) Response() []openapi.ContentUnit
- func (o *OperationContext) SetIsProcessingResponse(is bool)
- func (o *OperationContext) SetMethod(method string)
- func (o *OperationContext) SetPathPattern(pattern string)
- func (o *OperationContext) SetProcessingIn(in openapi.In)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReflectJSONResponse ¶ added in v0.2.42
func ReflectJSONResponse( r *jsonschema.Reflector, output interface{}, reflOptions ...func(rc *jsonschema.ReflectContext), ) (schema *jsonschema.Schema, err error)
ReflectJSONResponse reflects JSON schema of response.
func ReflectParametersIn ¶ added in v0.2.43
func ReflectParametersIn( r *jsonschema.Reflector, oc openapi.OperationContext, c openapi.ContentUnit, in openapi.In, collectDefinitions func(name string, schema jsonschema.Schema), interceptProp jsonschema.InterceptPropFunc, additionalTags ...string, ) (jsonschema.Schema, error)
ReflectParametersIn reflects JSON schema of request parameters.
func ReflectRequestBody ¶ added in v0.2.42
func ReflectRequestBody( is31 bool, r *jsonschema.Reflector, cu openapi.ContentUnit, httpMethod string, mapping map[string]string, tag string, additionalTags []string, reflOptions ...func(rc *jsonschema.ReflectContext), ) (schema *jsonschema.Schema, hasFileUpload bool, err error)
ReflectRequestBody reflects JSON schema of request body.
func ReflectResponseHeader ¶ added in v0.2.43
func ReflectResponseHeader( r *jsonschema.Reflector, oc openapi.OperationContext, cu openapi.ContentUnit, interceptProp jsonschema.InterceptPropFunc, ) (jsonschema.Schema, error)
ReflectResponseHeader reflects response headers from content unit.
Types ¶
type OperationContext ¶
type OperationContext struct {
// contains filtered or unexported fields
}
OperationContext implements openapi.OperationContext.
func NewOperationContext ¶
func NewOperationContext(method, pathPattern string) *OperationContext
NewOperationContext creates OperationContext.
func (*OperationContext) AddReqStructure ¶
func (o *OperationContext) AddReqStructure(s interface{}, options ...openapi.ContentOption)
AddReqStructure adds request content schema.
func (*OperationContext) AddRespStructure ¶
func (o *OperationContext) AddRespStructure(s interface{}, options ...openapi.ContentOption)
AddRespStructure adds response content schema.
func (*OperationContext) IsProcessingResponse ¶
func (o *OperationContext) IsProcessingResponse() bool
IsProcessingResponse indicates if response is being processed.
func (*OperationContext) Method ¶
func (o *OperationContext) Method() string
Method returns HTTP method of an operation.
func (*OperationContext) PathPattern ¶
func (o *OperationContext) PathPattern() string
PathPattern returns operation HTTP URL path pattern.
func (*OperationContext) ProcessingIn ¶
func (o *OperationContext) ProcessingIn() openapi.In
ProcessingIn return which content location is being processed now.
func (*OperationContext) Request ¶
func (o *OperationContext) Request() []openapi.ContentUnit
Request returns list of operation request content schemas.
func (*OperationContext) Response ¶
func (o *OperationContext) Response() []openapi.ContentUnit
Response returns list of operation response content schemas.
func (*OperationContext) SetIsProcessingResponse ¶
func (o *OperationContext) SetIsProcessingResponse(is bool)
SetIsProcessingResponse sets current processing state.
func (*OperationContext) SetMethod ¶
func (o *OperationContext) SetMethod(method string)
SetMethod sets HTTP method of an operation.
func (*OperationContext) SetPathPattern ¶
func (o *OperationContext) SetPathPattern(pattern string)
SetPathPattern sets URL path pattern of an operation.
func (*OperationContext) SetProcessingIn ¶
func (o *OperationContext) SetProcessingIn(in openapi.In)
SetProcessingIn sets current content location being processed.