safe_json library
Safe JSON converters for deserializing API responses without crashing when the backend sends wrong types (e.g. int instead of String).
Classes
- SafeBool
- SafeDateTime
- ISO8601 DateTime ("2026-01-29T12:34:56Z" or with offset)
- SafeDouble
-
SafeEnum<
T extends Enum> - =============================== ENUM (supports String name or int index)
- SafeInt
- SafeMap
- =============================== MAP
-
SafeObject<
T> - =============================== OBJECT (Model)
-
SafeObjectList<
T> - LIST of objects (models)
-
SafePrimitiveList<
T> - =============================== LIST of primitive
- SafeString
- =============================== PRIMITIVES