Yojson won’t be very helpful here as jsoo already provides json encoding/decoding via the browser API.
However, it’s still not ideal to tie an encoding/decoding API to the underlying json implementation. It would be nice if encoders/decoders were more usable.
This all just reminded me of https://github.com/OCamlPro/ocplib-json-typed. I wonder why don’t we just use that, it seems to offer everything we want for the browser side.