amnaredo / test

0 stars 0 forks source link

Configurable Option encoding #119

Open amnaredo opened 3 years ago

amnaredo commented 3 years ago

I want to use uPickle to create rest services. There's a couple of things that I would like to change

1) Option values. case Some(10) => 10; case None => Null 2) Sum types. Remove the wrapping array and have the annotated type as a special field on the serialised json object {"$type$": "myPackage.Dog", "name": "Dogtanian"}

I've had a dig around to see if I could implement 1). This works apart from a couple of failed tests to do with tags. https://github.com/brendanator/upickle/commit/c5d924bbe523b0a20d933ca4a50b77a49c4585f6

2) would be covered by issue #55 (Configurable Sum encoding)

This is quite a large change so if you don't think it is worth it that is fine. However making this change would allow uPickle to be used with lots of different frontend clients which would be very cool :)

ID: 79 Original Author: brendanator

amnaredo commented 3 years ago

Closing in deference to the other two issues

Original Author: lihaoyi