[Article] Type-safe JSON encoding and decoding

Hello! I’ve written down an article summarizing my experience of working with JSON in ReScript. I’m not pretending to describe some kind of an idiomatic way; it’s just a framework that works OK for me. Nevertheless:

I wonder if someone came with a solution that’s still type-safe but requiring less boilerplate. I’m annoyed a little about the fact that if one has Js.Json.t he effectively has a DTO already, just unchecked/unvalidate. An open question: is there a way to employ ReScript type system to gracefully perform validation and completely avoid repacking the data during this process?!

14 Likes

@nkrkv

Just passing by in order to thank you for this amazing lib :grinning_face_with_smiling_eyes:

Best regards :wink:

1 Like