traverse

package
v0.0.0-...-5da7bf1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RequestType   = "request"
	ResponseType  = "response"
	ParameterType = "parameter"
	SchemaType    = "schema"

	TypeKey      = "type"
	NameKey      = "name"
	InKey        = "in"
	PathKey      = "path"
	MethodKey    = "method"
	OperationKey = "operation"
	ContentKey   = "content"
	StatusKey    = "status"
)

Functions

func Callback

func Callback(callback *openapi3.CallbackRef, visitor SchemaVisitor, levelNames map[string][]string) error

Callback traverses all unique non-reference schemas in the given callback.

func Components

func Components(components *openapi3.Components, visitor SchemaVisitor, levelNames map[string][]string) error

Components traverses the given components and all unique non-reference schemas in it.

func Document

func Document(t *openapi3.T, visitor SchemaVisitor, levelNames ...map[string][]string) error

Document traverses the given document and calls the visitor for each schema.

func Header(header *openapi3.HeaderRef, visitor SchemaVisitor, levelNames map[string][]string) error

Header traverses the given header and all unique non-reference schemas in it.

func MediaType

func MediaType(mediaType *openapi3.MediaType, visitor SchemaVisitor, levelNames map[string][]string) error

MediaType traverses the given media type and all unique non-reference schemas in it.

func Operation

func Operation(operation *openapi3.Operation, visitor SchemaVisitor, levelNames map[string][]string) error

func Parameter

func Parameter(parameter *openapi3.ParameterRef, visitor SchemaVisitor, levelNames map[string][]string) error

Parameter traverses the given parameter and all unique non-reference schemas in it.

func ParameterSchema

func ParameterSchema(parameter *openapi3.Parameter, visitor SchemaVisitor, levelNames map[string][]string) error

func PathItem

func PathItem(pathItem *openapi3.PathItem, visitor SchemaVisitor, levelNames map[string][]string) error

PathItem traverses the given path item and calls the visitor for each schema.

func RequestBody

func RequestBody(requestBody *openapi3.RequestBodyRef, visitor SchemaVisitor, levelNames map[string][]string) error

RequestBody traverses the given request body and all unique non-reference schemas in it.

func Response

func Response(response *openapi3.ResponseRef, visitor SchemaVisitor, levelNames map[string][]string) error

Response traverses the given response and all unique non-reference schemas in it.

func ResponseSchema

func ResponseSchema(response *openapi3.Response, visitor SchemaVisitor, levelNames map[string][]string) error

func Responses

func Responses(responses openapi3.Responses, visitor SchemaVisitor, levelNames map[string][]string) error

Responses traverses the given responses and all unique non-reference schemas in it.

Types

type SchemaVisitor

type SchemaVisitor func(schemaRef *openapi3.SchemaRef, levelNames map[string][]string) error

Jump to

Keyboard shortcuts

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