This PR improves the JSON encoding of non-standard types by introducing and using the .defaults module. The .defaults module adds helper functions that can test and apply formatting for types not supported by a given encoder.
Please note that in doing so, some outputs of the JsonFormatter have changed. That said these changes return more "reasonable" results rather the the original str(o) fallback.
For more detailed list of changes to the encoders see the CHANGELOG.
Test Plan
Have added additional tests and now check for specific output.
This PR improves the JSON encoding of non-standard types by introducing and using the
.defaults
module. The.defaults
module adds helper functions that can test and apply formatting for types not supported by a given encoder.Please note that in doing so, some outputs of the
JsonFormatter
have changed. That said these changes return more "reasonable" results rather the the originalstr(o)
fallback.For more detailed list of changes to the encoders see the CHANGELOG.
Test Plan
Have added additional tests and now check for specific output.