Validation¶
- ogcat.validate_metadata(metadata, schema, *, strict=False, schema_name='default')[source]¶
Validate metadata against a record schema.
- Parameters:
metadata (
object) – Metadata mapping to validate.schema (
RecordSchema) – Schema describing required fields and value types.strict (
bool) – Whether to apply strict schema options.schema_name (
str) – Human-readable schema name for messages.
- Return type:
- Returns:
Structured validation report.
- ogcat.validate_record(record, spec=None, *, strict=False)[source]¶
Validate a catalog record dataclass.
- Parameters:
record (
CatalogRecord) – Runtime catalog record to validate.spec (
CatalogSpec|None) – Optional catalog spec used for metadata schema validation.strict (
bool) – Whether to apply strict schema options.
- Return type:
- Returns:
Structured validation report.
- ogcat.validate_schema(schema, *, schema_name='default', base_path=None)[source]¶
Validate a record schema’s validation hints.
- Parameters:
schema (
RecordSchema) – Schema to validate.schema_name (
str) – Name used in issue paths and messages.base_path (
str|None) – Optional issue path prefix for the schema.
- Return type:
- Returns:
Structured validation report.
- ogcat.validate_spec(spec)[source]¶
Validate schema validation hints across a catalog spec.
- Return type:
- class ogcat.ValidationReport(issues=<factory>)[source]¶
Bases:
objectStructured validation result.
- Parameters:
issues (
list[ValidationIssue]) – Validation issues collected during a check.
- issues: list[ValidationIssue]¶
- property ok: bool¶
Return whether the report has no error issues.
- property errors: list[ValidationIssue]¶
Return validation errors.
- property warnings: list[ValidationIssue]¶
Return validation warnings.
- class ogcat.ValidationIssue(path, message, severity='error', code='validation.error', hint=None)[source]¶
Bases:
objectA single validation finding.
- Parameters:
path (
str) – Dot-separated path to the invalid value.message (
str) – Human-readable validation message.severity (
str) – Issue severity, usually"error"or"warning".code (
str) – Stable machine-readable issue code.hint (
str|None) – Optional user-facing remediation hint.
- path: str¶
- message: str¶
- severity: str¶
- code: str¶
- hint: str | None¶