Documentation
¶
Index ¶
- func BuildApi(spec *v3.Document, requestBody models.ApiPost, label string) *models.Api
- func CorsGet(c *http.Client, u string, corsurl string) (*http.Response, error)
- func DeriveAuthType(spec *v3.Document) string
- func ParseOutput(out string, timenow time.Time) []models.LintMessage
- func UpdateApiFromSpec(api *models.Api, spec *v3.Document, requestBody models.ApiPost, label string)
- func ValidateApi(api *models.Api) []problem.InvalidParam
- type FetchOpts
- type OASResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildApi ¶
BuildApi constructs a models.Api based on the OpenAPI spec (pb33f v3) and request body.
func DeriveAuthType ¶
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
}
Click to show internal directories.
Click to hide internal directories.