singer_sdk.schema.source.SchemaSource¶
- class singer_sdk.schema.source.SchemaSource[source]¶
Abstract base class for schema sources.
- abstractmethod fetch_schema(key)[source]¶
Retrieve a JSON schema from this source.
- Parameters:
key (_TKey) – The schema component name to retrieve.
- Returns:
A JSON schema dictionary.
- Raises:
ValueError – If the component is not found or invalid.
requests.RequestException – If fetching schema from URL fails.
- Return type:
- final get_schema(key, /, *, key_properties=())[source]¶
Convenience method to get a schema component.
- Parameters:
key (_TKey) – The schema component name to retrieve.
key_properties (Sequence[str]) – The stream’s key properties.
- Returns:
A JSON schema dictionary.
- Raises:
SchemaNotFoundError – If the schema is not found or cannot be fetched.
SchemaNotValidError – If the schema is not a JSON object.
- Return type: