winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
4.73k stars 185 forks source link

Improve DX around serializing and deserializing types #6474

Open Chriscbr opened 1 month ago

Chriscbr commented 1 month ago

Serializing data to and from JSON for simulator resources can be cumbersome, we have some examples here:

https://github.com/winglang/wing/blob/58493d35bfc0267996df7609738f7348eaa6c50f/examples/tests/sdk_tests/resource/call.test.w#L111-L153

It would be nice to have some more uniform API to convert a type to/from Json. Separately it could also be nice to have some way to auto-generate these methods.