diff --git a/singer_sdk/_singerlib/schema.py b/singer_sdk/_singerlib/schema.py index 9ef615e0d..41dd8104b 100644 --- a/singer_sdk/_singerlib/schema.py +++ b/singer_sdk/_singerlib/schema.py @@ -21,6 +21,7 @@ "minLength", "format", "type", + "default", "required", "enum", "pattern", @@ -47,6 +48,7 @@ class Schema: """ type: str | list[str] | None = None # noqa: A003 + default: t.Any | None = None properties: dict | None = None items: t.Any | None = None description: str | None = None diff --git a/tests/_singerlib/test_schema.py b/tests/_singerlib/test_schema.py index 07589f431..4fa72c5a8 100644 --- a/tests/_singerlib/test_schema.py +++ b/tests/_singerlib/test_schema.py @@ -4,10 +4,10 @@ from singer_sdk._singerlib import Schema, resolve_schema_references -STRING_SCHEMA = Schema(type="string", maxLength=32) -STRING_DICT = {"type": "string", "maxLength": 32} -INTEGER_SCHEMA = Schema(type="integer", maximum=1000000) -INTEGER_DICT = {"type": "integer", "maximum": 1000000} +STRING_SCHEMA = Schema(type="string", maxLength=32, default="") +STRING_DICT = {"type": "string", "maxLength": 32, "default": ""} +INTEGER_SCHEMA = Schema(type="integer", maximum=1000000, default=0) +INTEGER_DICT = {"type": "integer", "maximum": 1000000, "default": 0} ARRAY_SCHEMA = Schema(type="array", items=INTEGER_SCHEMA) ARRAY_DICT = {"type": "array", "items": INTEGER_DICT} OBJECT_SCHEMA = Schema(