validate

package
v1.18.3 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package validate exposes spec validation as a public library API. Validate runs kin-openapi's spec validator and returns a structured list of findings (rule IDs, severities, source locations) so any caller can surface validation results in the same shape as `oasdiff validate` does on the command line.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(spec *openapi3.T, source string) formatters.Findings

Validate validates the spec against the OpenAPI and JSON Schema rules (kin-openapi's validator), returning a flat list of findings. Each finding carries a stable rule ID, severity, source location (when origin tracking is enabled on the loader), and a fingerprint for cross-spec matching.

source is the display name for the spec (typically its file path). It appears in each finding's Source.File so callers can render file:line:column anchors. Pass an empty string when there is no meaningful source name (e.g. specs loaded from memory).

Returns nil when the spec is fully valid.

Types

This section is empty.

Jump to

Keyboard shortcuts

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