openapi

package
v0.0.0-...-1a2561a Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: EUPL-1.2 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthTypeFromSpec

func AuthTypeFromSpec(spec *v3.Document) string

func BuildApi

func BuildApi(spec *v3.Document, requestBody models.ApiPost, label string) *models.Api

BuildApi constructs a models.Api based on the OpenAPI spec (pb33f v3) and request body.

func CorsGet

func CorsGet(c *http.Client, u string, corsurl string) (*http.Response, error)

CorsGet performs a GET request including an Origin header.

func DeriveAuthType

func DeriveAuthType(spec *v3.Document) string

DeriveAuthType determines authentication type from security schemes (pb33f v3).

func IsHTTPStatus

func IsHTTPStatus(err error, statusCode int) bool

func ParseOutput

func ParseOutput(out string, timenow time.Time) []models.LintMessage

ParseOutput converts the text output of Spectral into structured messages.

func ProcessOAS

func ProcessOAS(ctx context.Context, input tools.OASInput, opts FetchOpts, consume func(*OASResult) error) error

ProcessOAS owns one complete libopenapi document lifecycle. libopenapi uses process-global caches and node pools, so model consumers are serialized and the caches are cleared before another document can be processed.

func UpdateApiFromSpec

func UpdateApiFromSpec(api *models.Api, spec *v3.Document, requestBody models.ApiPost, label string)

UpdateApiFromSpec mutates an existing models.Api with values derived from the OpenAPI spec.

func ValidateApi

func ValidateApi(api *models.Api, requestBody models.ApiPost) []problem.InvalidParam

ValidateApi checks fields needed to persist an API.

Types

type FetchOpts

type FetchOpts = models.FetchOpts

type HTTPStatusError

type HTTPStatusError = models.HTTPStatusError

type OASResult

type OASResult = models.OASResult

func FetchParseValidateAndHash

func FetchParseValidateAndHash(ctx context.Context, input tools.OASInput, opts FetchOpts) (*OASResult, error)

Jump to

Keyboard shortcuts

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