specvalidate

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Overview

Package specvalidate validates OpenAPI 3.0 documents in-process.

It parses a spec from YAML or JSON bytes and validates it against the OpenAPI 3.0 specification using github.com/getkin/kin-openapi. This is the primary structural gate behind the `validate` subcommand and the generator's `--validate` flag: it is deterministic and needs no network or external toolchain (unlike the redocly step run in CI).

This validation covers the *document* only — it confirms a generated or hand-edited OpenAPI file is structurally valid. Runtime request/response validation is out of scope.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(ctx context.Context, data []byte) error

Validate parses spec data (YAML or JSON) and validates it against OpenAPI 3.0 in-process, honouring ctx for cancellation. It returns a readable error if the bytes cannot be parsed as a spec or if the parsed document is not valid OpenAPI 3.0.

Types

This section is empty.

Jump to

Keyboard shortcuts

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