You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because every serializer on classes marked as @Serializable is resolved statically in compile-time by plugin, this library is type-safe. You also can use explicit form of stringify(T, KSerializer<T>) if you prefer, for example, for lists (see #27).
One exception for now is user-registered external serializers. Because they are unknown at the time of compiling class itself, or there can be more than one serializer for specified class, their resolving is postponed until runtime (that's why you need to explicitly register them).
Is there any way to get compile-time safety with this library?
This was one of the reasons I wrote my own serialization library: https://medium.com/@spitzwegerich/generated-json-serialisation-for-kotlin-4470dabe40b8.
A main advantage is that I can be sure at compile-time that every (custom) type in every object has a proper adapter registered.
The text was updated successfully, but these errors were encountered: