oaspec/codegen/validate
Types
Severity level for validation issues.
pub type Severity {
SeverityError
SeverityWarning
}
Constructors
-
SeverityError -
SeverityWarning
Target indicating which generation mode the issue applies to.
pub type Target {
TargetBoth
TargetClient
TargetServer
}
Constructors
-
TargetBoth -
TargetClient -
TargetServer
Values
pub fn error_to_string(error: ValidationError) -> String
Convert a validation error to a human-readable string.
pub fn errors_only(
issues: List(ValidationError),
) -> List(ValidationError)
Filter to only errors (not warnings).
pub fn filter_by_mode(
issues: List(ValidationError),
mode: config.GenerateMode,
) -> List(ValidationError)
Filter validation issues to those relevant for the selected generation mode.
pub fn validate(ctx: context.Context) -> List(ValidationError)
Validate the parsed spec for unsupported patterns. Returns a list of errors; empty list means validation passed. Name collisions and duplicate operationIds are handled by the dedup pass before validation, so they are no longer checked here.
pub fn warnings_only(
issues: List(ValidationError),
) -> List(ValidationError)
Filter to only warnings (not errors).