Closed kuujo closed 4 years ago
May supersede #8
I'm trying to ensure this PR is consistent with the added types supported by #8
@lemmy I think I got everything covered. The converters now support all the types in #8, there are tests for JsonSerialize
and JsonDeserialize
, and the Jackson jars are stored locally rather than downloaded.
I modified .gitignore
to only ignore the tla2tools.jar
in the lib
directory and put the Jackson jars there. I'm not familiar with Ant so that may be a bad idea. I can put them somewhere else if you have any suggestions, but that seemed the most sensible.
Ahh wait I didn't add specs for the operators...
Thanks for your contribution!
Merged in https://github.com/tlaplus/CommunityModules/commit/1b78c803ce60a22e1692921fa5c70ba40da646d4
This pull request adds new JSON operators for reading and writing JSON files and additional operators for encoding values to JSON:
JsonSerialize
serializes a tuple to a line-delimited JSON fileJsonDeserialize
deserializes a tuple from a line-delimited JSON fileToJson
encodes a value to JSONToJsonObject
encodes a record to a JSON objectToJsonArray
encodes a record to a JSON arrayJSON parsing and encoding is done using the Jackson library. Dependencies are added to the build to download Jackson jars.
Tests are added for the
ToJson
,ToJsonObject
andToJsonArray
operators, but I wasn't sure how to test the file-dependent operators.