Commit Graph

3 Commits

Author SHA1 Message Date
Saurav Panda a27cc17f35 fix: optional enum fields default to None instead of empty string
Empty string is outside most enum value sets, so model_dump would
serialize an out-of-set value violating the schema. Use None with
a type union (same treatment as nested objects) since no in-set
default can be safely chosen.
2026-01-31 22:33:59 -08:00
Saurav Panda 69635e7745 fix: non-required fields no longer unconditionally nullable
Non-required fields were always unioned with None, allowing null values
even when the JSON Schema did not permit them. Now only explicitly
nullable fields accept null. Non-required primitives get type-appropriate
zero defaults (empty string, 0, 0.0, False), arrays get [], and nested
objects fall back to None only where constructing a default is infeasible.
2026-01-31 17:55:51 -08:00
Saurav Panda 69004dda09 schema enforcement in extract tool 2026-01-31 17:41:42 -08:00