hubvault.server.schemas
Request-normalization and small payload helpers for hubvault.server.
The current server phases keep request and response handling explicit instead of introducing a large schema layer all at once. This module centralizes the small validation helpers that readonly route modules need.
The module contains:
normalize_paths_request()- Normalize path-selection request bodiesnormalize_snapshot_plan_request()- Normalize snapshot-plan request bodiesnormalize_commit_manifest_request()- Normalize write-commit manifestsnormalize_gc_request()- Normalize GC request bodiesnormalize_squash_history_request()- Normalize history-squash request bodiesbuild_error_payload()- Build the stable JSON error wrapper
normalize_paths_request
- hubvault.server.schemas.normalize_paths_request(payload) List[str][source]
Normalize a
paths-inforequest body.The body may be either a raw JSON array or an object carrying a
pathsfield.- Parameters:
payload (object) – Raw decoded JSON payload
- Returns:
Normalized repo-relative path list
- Return type:
List[str]
- Raises:
HubVaultValidationError – Raised when the payload shape is invalid.
normalize_snapshot_plan_request
- hubvault.server.schemas.normalize_snapshot_plan_request(payload) dict[source]
Normalize a
snapshot-planrequest body.- Parameters:
payload (object) – Raw decoded JSON payload
- Returns:
Normalized snapshot-plan options
- Return type:
dict
- Raises:
HubVaultValidationError – Raised when the payload shape is invalid.
normalize_commit_manifest_request
- hubvault.server.schemas.normalize_commit_manifest_request(payload) dict[source]
Normalize a write-commit manifest or apply payload.
- Parameters:
payload (object) – Raw decoded JSON payload
- Returns:
Normalized write manifest payload
- Return type:
dict
- Raises:
HubVaultValidationError – Raised when the payload shape is invalid.
normalize_gc_request
- hubvault.server.schemas.normalize_gc_request(payload) dict[source]
Normalize a GC request body.
- Parameters:
payload (object) – Raw decoded JSON payload
- Returns:
Normalized GC options
- Return type:
dict
- Raises:
HubVaultValidationError – Raised when the payload shape is invalid.
normalize_squash_history_request
- hubvault.server.schemas.normalize_squash_history_request(payload) dict[source]
Normalize a history-squash request body.
- Parameters:
payload (object) – Raw decoded JSON payload
- Returns:
Normalized squash-history options
- Return type:
dict
- Raises:
HubVaultValidationError – Raised when the payload shape is invalid.
build_error_payload
- hubvault.server.schemas.build_error_payload(error_type: str, message: str) dict[source]
Build the stable JSON error wrapper used by the server layer.
- Parameters:
error_type (str) – Stable application error type name
message (str) – Human-readable error message
- Returns:
JSON-compatible error payload
- Return type:
dict