You can have two different instances of the JsonEncoder, one for decoding and one for encoding.