Documentation ¶
Index ¶
- func NewDocumentFromFile(filePath string) (openapi.Document, error)
- func NewSchemaFromKin(schema *openapi3.Schema, parseConfig *config.ParseConfig) *openapi.Schema
- func NewValidator(_ openapi.Document) openapi.Validator
- type Document
- type KinOperation
- func (op *KinOperation) GetParameters() openapi.Parameters
- func (op *KinOperation) GetRequestBody() (*openapi.Schema, string)
- func (op *KinOperation) GetResponse() *openapi.Response
- func (op *KinOperation) ID() string
- func (op *KinOperation) WithParseConfig(config *config.ParseConfig) openapi.Operation
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDocumentFromFile ¶
NewDocumentFromFile creates a new Document from a file path
func NewSchemaFromKin ¶
NewSchemaFromKin creates a new Schema from a Kin schema
Types ¶
type Document ¶
Document is a wrapper around openapi3.T Implements Document interface
func (*Document) FindOperation ¶
func (d *Document) FindOperation(options *openapi.OperationDescription) openapi.Operation
FindOperation finds an operation by resource and method.
func (*Document) GetResources ¶
GetResources returns a map of resource names and their methods.
func (*Document) GetVersion ¶
GetVersion returns the version of the document
func (*Document) Provider ¶
func (d *Document) Provider() config.SchemaProvider
Provider returns the SchemaProvider for this document
type KinOperation ¶
KinOperation is a wrapper around openapi3.Operation
func (*KinOperation) GetParameters ¶
func (op *KinOperation) GetParameters() openapi.Parameters
GetParameters returns the operation parameters
func (*KinOperation) GetRequestBody ¶
func (op *KinOperation) GetRequestBody() (*openapi.Schema, string)
GetRequestBody returns the operation request body
func (*KinOperation) GetResponse ¶
func (op *KinOperation) GetResponse() *openapi.Response
GetResponse returns the operation response
func (*KinOperation) WithParseConfig ¶
func (op *KinOperation) WithParseConfig(config *config.ParseConfig) openapi.Operation
WithParseConfig sets the parse config for this operation
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
func (*Validator) ValidateRequest ¶
func (v *Validator) ValidateRequest(req *openapi.GeneratedRequest) []error
ValidateRequest validates GeneratedRequest against a schema.
func (*Validator) ValidateResponse ¶
func (v *Validator) ValidateResponse(res *openapi.GeneratedResponse) []error
ValidateResponse validates a response against an Operation. GeneratedResponse must contain non-empty headers or it'll fail validation.