Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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
Click to show internal directories.
Click to hide internal directories.