モ
Size: a a a
モ
Б
YK
K
モ
Б
モ
モ
K
Б
モ
Б
Б
モ
YK
import json
# First we'll define our types
type
Element = object
name: string
atomicNumber: int
# Let's say this is the JSON we want to convert
let jsonObject = parseJson("""{"name": "Carbon", "atomicNumber": 6}""")
let element = to(jsonObject, Element)
# This will print Carbon
echo element.name
# This will print 6
echo element.atomicNumber
K
Б
P
K
import json
# First we'll define our types
type
Element = object
name: string
atomicNumber: int
# Let's say this is the JSON we want to convert
let jsonObject = parseJson("""{"name": "Carbon", "atomicNumber": 6}""")
let element = to(jsonObject, Element)
# This will print Carbon
echo element.name
# This will print 6
echo element.atomicNumber
モ