Module schema

Module schema 

Source
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 .json extension.
schema_dir_exists
Check if a schema directory exists and is valid.