Expand description
Schema path resolution with .json extension fallback.
Port of Go’s pkg/schema/schema.go.
Provides file path resolution for JSON schema files, trying the
exact path first, then falling back to appending .json.
Constants§
- SCHEMA_
CONTENT_ TYPE - The content type for JSON schema responses.
Functions§
- get_
schema_ dir - Get the schema directory path from the app path.
- normalize_
schema_ request - Normalize a request path for schema lookup. Strips leading slashes and ensures no directory traversal.
- resolve_
schema_ path - Resolve a schema file path, trying the exact path first, then with
.jsonextension. - schema_
dir_ exists - Check if a schema directory exists and is valid.