mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 09:54:49 +00:00
16 lines
259 B
Nim
16 lines
259 B
Nim
discard """
|
|
output: '''{"foo":{"test":"123"}}'''
|
|
"""
|
|
|
|
import json, options
|
|
|
|
type
|
|
Foo = ref object
|
|
test: string
|
|
Test = object
|
|
foo: Option[Foo]
|
|
|
|
let js = """{"foo": {"test": "123"}}"""
|
|
let parsed = parseJson(js)
|
|
let a = parsed.to(Test)
|
|
echo $(%*a) |