Eric
10271bd494
feat: improve deserialization from string ( #23 )
...
Improves how types handle deserialization from string, including Option[T], seq[T], and Option[seq[T]]
Empty and null strings are no longer deserialized to 0, instead an error Result is returned
If an error occurs when parsing json, a JsonParseError is returned.
2024-05-16 17:57:42 +10:00
Eric
6d2fc9406a
feat: improve stint parsing ( #22 )
...
- change empty string value to none when optional
- handle null, "null", JNull, seq[stint], seq[?string]
2024-05-16 15:09:01 +10:00
Eric
bd262054f2
fix: add missing test update ( #20 )
2024-05-14 14:52:32 +10:00
Eric
2fcdc9e9c5
chore: reorganize deserialize tests ( #19 )
...
Distribute deserialization tests so they are organized up by type.
2024-05-14 14:49:15 +10:00
Eric
3957da5b52
fix: UInt256 not correctly deserializing from string ( #18 )
...
fix: UInt256 not correctly deserialzing from string
UInt256 was being deserialized as an object when being deserialized from a string (not a JString).
2024-05-14 14:45:42 +10:00
Eric
baa847e937
chore[formatting]: update formatting ( #16 )
...
update formatting
2024-05-13 15:09:34 +10:00
Eric
fbabe954b4
add empty string test for UInt256 ( #15 )
2024-05-13 15:07:00 +10:00
Eric
e67f7e4b04
deserialize seq[T] and Option[T] from string ( #9 )
2024-02-14 15:42:42 +11:00
Eric
a2cca7788b
deserialize non-prefixed stuint ( #10 )
2024-02-14 15:40:32 +11:00
Eric
b04435fb88
Change parseJson to JsonNode.parse ( #4 )
...
* Change parseJson to JsonNode.parse
Exporting `parseJson` causes symbol clashes in downstream repos that import std/json, so changing the signature completely avoid this clash.
* Fix usages of parseJson, update README
2024-02-09 11:08:14 +11:00
Eric
1b77afcbf1
Fix deserialization of openArray[byte] ( #2 )
2024-02-09 10:33:14 +11:00
Eric
681f32aba6
chore: format using nph
2024-02-08 09:18:55 +11:00
Eric
d877872127
Add prettified option for toJson
2024-02-08 08:09:14 +11:00
Eric
f8260e9154
Update readme
2024-02-07 18:03:17 +11:00
Eric
92f7f7e6c5
Move modules into json folder, to make way for other types of serde
2024-02-07 14:44:13 +11:00
Eric
e15c8b71d7
Renamed serialize and deserialize to avoid clash with pramgas
...
Working 0.1.0!
2024-02-07 13:41:37 +11:00
Eric
d0a67a8eb0
initial impl, not compiling
2024-02-07 09:40:48 +11:00