openapi

package
v0.0.0-...-51a8023 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: EUPL-1.2 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 ParseOutput

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

ParseOutput converts the text output of Spectral into structured messages.

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) []problem.InvalidParam

ValidateApi fills missing fields from the request body and collects missing errors.

Types

type FetchOpts

type FetchOpts struct {
	Origin     string       // bv. "https://developer.overheid.nl"
	HTTPClient *http.Client // optioneel
}

type OASResult

type OASResult struct {
	Spec        *v3.Document // high-level v3 model
	Hash        string       // sha256 van de genormaliseerde spec
	Raw         []byte       // oorspronkelijke bytes zoals opgehaald
	ContentType string       // content-type header van de response (kan leeg zijn)
	Version     string       // volledige openapi versiestring, bv. 3.0.3
	Major       int
	Minor       int
	Patch       int
}

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