parser

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	ValidateDocument bool
	// contains filtered or unexported fields
}

Parser represents an OpenAPI parser

func NewParser

func NewParser() *Parser

NewParser creates a new OpenAPI parser

func (*Parser) GetDocument

func (p *Parser) GetDocument() *openapi3.T

GetDocument returns the parsed OpenAPI document

func (*Parser) GetInfo

func (p *Parser) GetInfo() *openapi3.Info

GetInfo returns the info section of the OpenAPI document

func (*Parser) GetOperationID

func (p *Parser) GetOperationID(path string, method string, operation *openapi3.Operation) string

GetOperationID generates an operation ID if one is not provided

func (*Parser) GetPaths

func (p *Parser) GetPaths() map[string]*openapi3.PathItem

GetPaths returns all paths in the OpenAPI document

func (*Parser) GetServers

func (p *Parser) GetServers() []*openapi3.Server

GetServers returns all servers in the OpenAPI document

func (*Parser) Parse

func (p *Parser) Parse(data []byte) error

Parse parses an OpenAPI document from bytes

func (*Parser) ParseFile

func (p *Parser) ParseFile(filePath string) error

ParseFile parses an OpenAPI document from a file

func (*Parser) SetValidation

func (p *Parser) SetValidation(validate bool)

SetValidation sets whether to validate the OpenAPI document

Jump to

Keyboard shortcuts

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