mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 11:42:33 +00:00
[json] document fact that key ordering is preserved (#10020)
This commit is contained in:
committed by
Andreas Rumpf
parent
fc7df3283c
commit
6cbe1d48d7
@@ -134,6 +134,13 @@
|
||||
## j2["details"] = %* {"age":35, "pi":3.1415}
|
||||
## echo j2
|
||||
|
||||
runnableExamples:
|
||||
## Note: for JObject, key ordering is preserved, unlike in some languages,
|
||||
## this is convenient for some use cases. Example:
|
||||
type Foo = object
|
||||
a1, a2, a0, a3, a4: int
|
||||
doAssert $(%* Foo()) == """{"a1":0,"a2":0,"a0":0,"a3":0,"a4":0}"""
|
||||
|
||||
import
|
||||
hashes, tables, strutils, lexbase, streams, unicode, macros, parsejson
|
||||
|
||||
|
||||
Reference in New Issue
Block a user