theia-ide / sprotty

A next-gen web-based graphics framework
Apache License 2.0
138 stars 23 forks source link

Generically handle serialization of enums #41

Closed JanKoehnlein closed 7 years ago

JanKoehnlein commented 7 years ago

Currently, we serialize enum literals as strings from the Java side, while in Typescript we use numbers, as this is how TS converts them to JavaScript. We should find and implement a generic solution that does not require manual implementation by the framework user.

JanKoehnlein commented 7 years ago

See ChipModelFactory.getDirection

spoenemann commented 7 years ago

We should use integers only. That can be solved generically on the server side by adding a Gson type adapter for Enums.