openapi

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package openapi loads OpenAPI documents, serves a spec as YAML, and validates a recorded response against it. The services use it for their published specs and for contract tests that check a handler's output against openapi.yaml.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(data []byte) (*openapi3.T, error)

Load parses and validates an OpenAPI 3 document.

func ServeYAML

func ServeYAML(w http.ResponseWriter, spec []byte)

ServeYAML writes an embedded OpenAPI document with the standard YAML content type.

func ValidateResponse

func ValidateResponse(doc *openapi3.T, method, path string, status int, body []byte, contentType string) error

ValidateResponse is a test/CI helper that checks an HTTP response body against the committed OpenAPI spec. It rebuilds routing state per call and is not intended for live request-path enforcement.

Types

This section is empty.

Jump to

Keyboard shortcuts

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