diff options
author | inv2004 <inv2004@gmail.com> | 2021-01-06 20:42:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-06 18:42:49 +0100 |
commit | 0d5cab77f65df1431ed417a666ba49136af3b2c1 (patch) | |
tree | 3be7eee23052b510b38ba8ecfc0088b7305e529b /lib/std/jsonutils.nim | |
parent | 58b9191354aa99ac2d17f9a7db3bdf239c7bce6b (diff) | |
download | Nim-0d5cab77f65df1431ed417a666ba49136af3b2c1.tar.gz |
jsonutils: fromJson forward opt param fix (#16612)
Diffstat (limited to 'lib/std/jsonutils.nim')
-rw-r--r-- | lib/std/jsonutils.nim | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/jsonutils.nim b/lib/std/jsonutils.nim index 24935f511..4dca024c1 100644 --- a/lib/std/jsonutils.nim +++ b/lib/std/jsonutils.nim @@ -201,17 +201,17 @@ proc fromJson*[T](a: var T, b: JsonNode, opt = Joptions()) = if b.kind == JNull: a = nil else: a = T() - fromJson(a[], b) + fromJson(a[], b, opt) elif T is array: checkJson a.len == b.len, $(a.len, b.len, $T) var i = 0 for ai in mitems(a): - fromJson(ai, b[i]) + fromJson(ai, b[i], opt) i.inc elif T is seq: a.setLen b.len for i, val in b.getElems: - fromJson(a[i], val) + fromJson(a[i], val, opt) elif T is object: template fun(key, typ): untyped {.used.} = if b.hasKey key: @@ -237,7 +237,7 @@ proc fromJson*[T](a: var T, b: JsonNode, opt = Joptions()) = checkJson b.kind == JArray, $(b.kind) # we could customize whether to allow JNull var i = 0 for val in fields(a): - fromJson(val, b[i]) + fromJson(val, b[i], opt) i.inc checkJson b.len == i, $(b.len, i, $T, b) # could customize else: |