parser

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CONTENT_JSON = "application/json"
View Source
const CONTENT_TEXT = "text/plain"
View Source
const CONTENT_URL = "application/x-www-form-urlencoded"
View Source
const CONTENT_XML = "application/xml"

Variables

This section is empty.

Functions

func GetEndpointName

func GetEndpointName(verb entity.Verb, operationId string, key string) string

func GetHeader

func GetHeader(
	operation *openapi3.Operation,
	securitySchemes []entity.Security,
) map[string]entity.HeaderProperty

func GetParams

func GetParams(operation *openapi3.Operation) []entity.ParamProperty

func GetPropertyName

func GetPropertyName(name string) string

func GetPropertyType

func GetPropertyType(name string) string

func GetResponseName

func GetResponseName(code string, key string) string

func GetSchemaName

func GetSchemaName(id string) string

func GetStatus

func GetStatus(status string) int

func IsRediret added in v0.0.3

func IsRediret(status string) bool

func KeyToName

func KeyToName(verb entity.Verb, key string) string

func KeyToPath

func KeyToPath(key string) string

func ParseDocument

func ParseDocument(ctx context.Context, options ParseOptions) (*entity.TemplateData, error)

Types

type ParseOptions

type ParseOptions struct {
	Input   string
	Output  string
	Package string
}

type SchemaParser

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

func NewSchemaParser

func NewSchemaParser() SchemaParser

func (*SchemaParser) AddArray

func (p *SchemaParser) AddArray(
	ref string,
	name string,
	schema *openapi3.Schema,
	display bool,
) *entity.Schema

func (*SchemaParser) AddBoolean

func (p *SchemaParser) AddBoolean(
	ref string,
	name string,
	schema *openapi3.Schema,
	display bool,
) *entity.Schema

func (*SchemaParser) AddFloat

func (p *SchemaParser) AddFloat(
	ref string,
	name string,
	schema *openapi3.Schema,
	display bool,
) *entity.Schema

func (*SchemaParser) AddInteger

func (p *SchemaParser) AddInteger(
	ref string,
	name string,
	schema *openapi3.Schema,
	display bool,
) *entity.Schema

func (*SchemaParser) AddObject

func (p *SchemaParser) AddObject(
	ref string,
	name string,
	schema *openapi3.Schema,
	display bool,
) *entity.Schema

func (*SchemaParser) AddString

func (p *SchemaParser) AddString(
	ref string,
	name string,
	schema *openapi3.Schema,
	display bool,
) *entity.Schema

func (*SchemaParser) GetBody

func (p *SchemaParser) GetBody(operation *openapi3.Operation) entity.BodyProperty

func (*SchemaParser) GetBySchema

func (p *SchemaParser) GetBySchema(oapiSchema *openapi3.Schema) *entity.Schema

func (*SchemaParser) GetEndpoints

func (p *SchemaParser) GetEndpoints() []*entity.Endpoint

func (*SchemaParser) GetQuery

func (p *SchemaParser) GetQuery(operation *openapi3.Operation) map[string]entity.QueryProperty

func (*SchemaParser) GetResponses

func (p *SchemaParser) GetResponses(operation *openapi3.Operation, s map[*openapi3.Schema]*entity.Schema) entity.Response

func (*SchemaParser) GetSchemas

func (p *SchemaParser) GetSchemas() []*entity.Schema

func (*SchemaParser) Parse

func (p *SchemaParser) Parse(doc *openapi3.T)

func (*SchemaParser) SetByName

func (p *SchemaParser) SetByName(oapiSchema *openapi3.Schema, schema *entity.Schema)

Jump to

Keyboard shortcuts

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