validate

package
v1.23.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 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).

A valid spec yields a non-nil empty Findings (nil only for the nil-spec guard), so the formatters' nil guard doesn't collapse `[]` to empty bytes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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