aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorOskari Timperi <oskari.timperi@iki.fi>2018-04-27 19:46:51 +0300
committerOskari Timperi <oskari.timperi@iki.fi>2018-04-27 19:46:51 +0300
commit44b39c7f5cdd93065d653a1428f9bd3c6f56618b (patch)
treead3cfcc3e954c9ea534b918ea737695d59257128 /examples
parent15d74f0e3a53d04e96b22a83b9a94535cc8ef931 (diff)
downloadnimpb-44b39c7f5cdd93065d653a1428f9bd3c6f56618b.tar.gz
nimpb-44b39c7f5cdd93065d653a1428f9bd3c6f56618b.zip
Fix Duration JSON parsing
I use `include duration_pb` in the `duration.nim` file. This has the effect of not using the property setter procs when doing assignments! Instead, we directly use the member variable bypassing the setter. This means that `hasField` is not updated. Which means that when serializing a message that was parsed from JSON, we don't serialize the `Duration.seconds` and `Duration.nanos` fields because the library thinks they are not set. The fix for now is to use the dedicated `setFoo` procs for setting fields in these WKT extra functionality files which include the corresponding `*_pb.nim` file. This is not a problem when using `import`, as the fields are private to the `*_pb.nim` module, so outside code uses the property setters when doing assignments.
Diffstat (limited to 'examples')
0 files changed, 0 insertions, 0 deletions