Bs-json Encoder Examples?


I’m trying to figure out how to write a custom Json Encoder using bs-json, and I’m having trouble understanding the examples in the repo. The object I want to encode is in the format list(customType). Any idea on how to approach this?



Maybe my old article can help you:


@gladimdim Thanks for the help! I looked at your guide and the examples again, and I was able to come up with a solution. I figure I’ll leave this here in case it helps anyone else


I see the issues here. In bs-json the tests are in OCaml with it’s respective syntax, not in reason. I will try and work on getting some examples in the bs-json.


You can copy and paste the code to the OCaml section of to get ReasonML back