

Sealed case classes only need to implement the marker interface, no further configuration needed.

The solution has almost no boilerplate on the domain classes.The solution properly serializes and deserializes sealed cases classes (see Tests).Implementation details and discussion are provided afterĭefine a single marker interface in your domain module. The following example demonstrates the solution. Most importantly, it correctly deserializes an previously serialized value. The solution has minimal boilerplate and the class naming strategy can beĬonfigured once and for all case classes. This repository presents a solution based on a single marker interface that fulfills the three initially Proposed solution for handling sealed cases classes Therefore, we aim for a solution that works that configures the object mapper to work without annotations. However, that would be verbose and clutter an otherwise concise domain representation. These issues might be resolvable by annotations on SealedClass and the subtypes A, B, and C.

