correctly do the JSON backport

This commit is contained in:
narimiran
2023-04-24 09:43:55 +02:00
parent bce9a9daed
commit a5a2c57e88

View File

@@ -1121,7 +1121,7 @@ when defined(nimFixedForwardGeneric):
dst = cast[T](jsonNode.num)
proc initFromJson[T: SomeFloat](dst: var T; jsonNode: JsonNode; jsonPath: var string) =
verifyJsonKind(jsonNode, {JInt, JFloat}, jsonPath)
verifyJsonKind(jsonNode, {JInt, JFloat, JString}, jsonPath)
if jsonNode.kind == JString:
case jsonNode.str
of "nan":