validation

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllPaths

func AllPaths(spec *openapi.Spec) map[string][]string

AllPaths returns all unique paths with their defined methods

func GetSupportedOperations

func GetSupportedOperations(spec *openapi.Spec) []*openapi.Operation

GetSupportedOperations returns only GET and POST operations

Types

type ValidationError

type ValidationError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
	Path    string `json:"path,omitempty"`
	Method  string `json:"method,omitempty"`
}

ValidationError represents a single validation failure

type ValidationResult

type ValidationResult struct {
	Valid  bool              `json:"valid"`
	Errors []ValidationError `json:"errors,omitempty"`
}

ValidationResult holds all validation results

func Validate

func Validate(spec *openapi.Spec, profile jsp.ProfileID) *ValidationResult

Validate runs all validations on the parsed spec using the given schema profile for response schema validation via the jsonschemaprofiles library.

func (*ValidationResult) FormatJSON

func (r *ValidationResult) FormatJSON() string

FormatJSON returns validation result as JSON

func (*ValidationResult) FormatText

func (r *ValidationResult) FormatText() string

FormatText returns validation result as human-readable text

Jump to

Keyboard shortcuts

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