Renames to_json and from_json on generated classes to to_json_data and from_json_data. From experience with the Ruby code generation, these names are less likely to lead to confusion. The functions work with data that conforms to the JSON data model, not JSON strings itself.
Instead of emitting str for a JTD timestamp, this PR has us emit a Python3 datetime.datetime.
Refactors generated code to always be compatible with mypy --strict. This is tested as part of the Docker testing regime.
Makes Python-specific modifications to custom-overrides.jtd.json to make the result type-check against mypy.
Moves utility functions to the end of the file using the new Postamble codegen functionality. _parse_rfc339 is added as a utility.
Also, this PR includes cargo fmt. This leads to some noisy diff across a few targets.
This PR introduces a few changes:
to_json
andfrom_json
on generated classes toto_json_data
andfrom_json_data
. From experience with the Ruby code generation, these names are less likely to lead to confusion. The functions work with data that conforms to the JSON data model, not JSON strings itself.str
for a JTDtimestamp
, this PR has us emit a Python3datetime.datetime
.mypy --strict
. This is tested as part of the Docker testing regime._parse_rfc339
is added as a utility.Also, this PR includes
cargo fmt
. This leads to some noisy diff across a few targets.