mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 03:32:32 +00:00
* fixes #21638; `fromJson` should supports empty objects * complete the logic
This commit is contained in:
@@ -438,6 +438,11 @@ template fn() =
|
||||
let json = inner.toJson(ToJsonOptions(enumMode: joptEnumSymbol))
|
||||
doAssert $json == """{"x":"hello","y":"A"}"""
|
||||
|
||||
block: # bug #21638
|
||||
type Something = object
|
||||
|
||||
doAssert "{}".parseJson.jsonTo(Something) == Something()
|
||||
|
||||
when false:
|
||||
## TODO: Implement support for nested variant objects allowing the tests
|
||||
## bellow to pass.
|
||||
|
||||
Reference in New Issue
Block a user