openapi3_util

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Doc2ProtocolTool added in v0.2.5

func Doc2ProtocolTool(doc *openapi3.T, operationID string) (*protocol.Tool, error)

func Doc2ProtocolTools added in v0.2.5

func Doc2ProtocolTools(doc *openapi3.T) ([]*protocol.Tool, error)

func FilterDocOperations added in v0.2.5

func FilterDocOperations(doc *openapi3.T, operationIDs []string) *openapi3.T

func FilterSchemaOperations added in v0.2.5

func FilterSchemaOperations(ctx context.Context, data []byte, operationIDs []string) ([]byte, error)

func LoadFromData

func LoadFromData(ctx context.Context, data []byte) (*openapi3.T, error)

func Operation2ProtocolTool added in v0.2.5

func Operation2ProtocolTool(operation *openapi3.Operation) *protocol.Tool

func ParameterType2ProtocolDataType added in v0.2.5

func ParameterType2ProtocolDataType(param *openapi3.Parameter) protocol.DataType

ParameterType2ProtocolDataType 获取参数类型

func Parameters2ProtocolProperties added in v0.2.5

func Parameters2ProtocolProperties(parameters openapi3.Parameters) (map[string]*protocol.Property, []string)

func Schema2ProtocolTool added in v0.2.5

func Schema2ProtocolTool(ctx context.Context, schema []byte, operationID string) (*protocol.Tool, error)

func Schema2ProtocolTools added in v0.2.5

func Schema2ProtocolTools(ctx context.Context, schema []byte) ([]*protocol.Tool, error)

func SchemaProperties2ProtocolProperties added in v0.2.5

func SchemaProperties2ProtocolProperties(properties openapi3.Schemas) map[string]*protocol.Property

func SchemaType2ProtocolDataType added in v0.2.5

func SchemaType2ProtocolDataType(schema *openapi3.Schema) protocol.DataType

SchemaType2ProtocolDataType 获取 schema 的类型

func ValidateDoc

func ValidateDoc(ctx context.Context, doc *openapi3.T) error

func ValidateSchema

func ValidateSchema(ctx context.Context, data []byte) error

Types

type Auth added in v0.2.6

type Auth struct {
	Type  string `json:"type" validate:"omitempty,oneof='none' 'apiKey'"` //
	In    string `json:"in" validate:"omitempty,oneof='header' 'query'"`  // header or query
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Client added in v0.2.5

type Client struct {
	// contains filtered or unexported fields
}

func NewClient added in v0.2.5

func NewClient(ctx context.Context, schema []byte) (*Client, error)

func NewClientByDoc added in v0.2.5

func NewClientByDoc(doc *openapi3.T) *Client

func (*Client) DoRequestByMethodPath added in v0.2.5

func (c *Client) DoRequestByMethodPath(ctx context.Context, method, path string, params *RequestParams) (interface{}, error)

func (*Client) DoRequestByOperationID added in v0.2.5

func (c *Client) DoRequestByOperationID(ctx context.Context, operationID string, params *RequestParams) (interface{}, error)

type RequestParams added in v0.2.5

type RequestParams struct {
	HeaderParams map[string]string
	PathParams   map[string]interface{}
	QueryParams  map[string]interface{}
	BodyParams   map[string]interface{}
}

Jump to

Keyboard shortcuts

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