Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CoerceMode ¶
type CoerceMode string
CoerceMode specifies the coercion aggressiveness.
const ( CoerceModeConservative CoerceMode = "conservative" CoerceModePermissive CoerceMode = "permissive" CoerceModeOff CoerceMode = "off" )
type CoerceOptions ¶
type CoerceOptions struct {
Mode CoerceMode
DryRun bool
}
CoerceOptions configures coercion behavior.
type Finding ¶
type Finding struct {
Severity Severity `json:"severity"`
Code string `json:"code"`
Path string `json:"path"`
Message string `json:"message"`
Hint string `json:"hint,omitempty"`
Rule string `json:"rule,omitempty"`
}
Finding represents a single validation or coercion finding.
type Report ¶
Report is the canonical output of validation or coercion.
func CoerceSchema ¶
func CoerceSchema(profileID string, schemaFile string, metaSchemaYAML []byte, schemaBytes []byte, opts *CoerceOptions) ([]byte, *Report, bool, error)
CoerceSchema attempts to make a schema compliant with a profile. Returns the coerced schema bytes, a report of changes, and whether any changes were made.
func ValidateSchema ¶
func ValidateSchema(profileID string, schemaFile string, metaSchemaYAML []byte, schemaBytes []byte, opts *ValidateOptions) (*Report, error)
ValidateSchema validates a candidate JSON Schema against a profile. It runs Phase 1 (meta-schema validation) and Phase 2 (provider-specific code checks).
func (*Report) AddFinding ¶
AddFinding adds a finding and updates validity.
func (*Report) HasWarnings ¶
HasWarnings returns true if any finding has warning severity.
type SchemaMetrics ¶
type SchemaMetrics struct {
TotalProperties int
MaxDepth int
TotalEnumValues int
StringBudget int
LargeEnums []largeEnum // enums with >250 values
}
SchemaMetrics holds computed metrics from a schema graph traversal.
type ValidateOptions ¶
type ValidateOptions struct {
// Strict treats warnings as errors.
Strict bool
// ModelTarget applies additional model-specific restrictions (e.g. OpenAI fine-tuned).
ModelTarget string
}
ValidateOptions configures validation behavior.