glsp icon indicating copy to clipboard operation
glsp copied to clipboard

EMF to JSon serialization doesn't work for nested data types

Open CamilleLetavernier opened this issue 4 years ago • 0 comments

To configure the JSon serializer/deserializer, we use a TypeMap to define the mapping between the EMF Interfaces and their respective Implementation class. However, this TypeMap is only used in the GModelElementTypeAdapter, which means only direct children of a GModelElement (and GModelElements themselves) can be properly serialized. When introducing a deeper data-type structure, (de)serialization fails, and we need to introduce custom TypeAdapters to solve it.

Instead of defining the TypeMap inside of the GModelElementTypeAdapter, we should (automatically) instantiate 1 TypeAdapter per EClass, so that all EMF-based TypeAdapters can work properly.

CamilleLetavernier avatar Sep 15 '21 13:09 CamilleLetavernier