validity
validity copied to clipboard
Aeson tests don't validate toJSON and toEncoding agree
It's recommended to implement toEncoding
when instantiating ToJSON
, but there's no validation ensuring it agrees with toJSON
(which is a requirement since it doesn't go the other way).
A simple workaround might be to encode toJSON v
and v
both while testing round tripping. They don't need to end with identical representations, but the decoder needs to agree that they're equivalent.
Sounds good!
PR welcome