1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

json2: fix encoding of nested maps like map[string]map[string]int (#17924)

This commit is contained in:
Hitalo Souza
2023-04-10 12:57:02 -03:00
committed by GitHub
parent 4e498b4303
commit 4d4d76d65b
2 changed files with 29 additions and 25 deletions

View File

@@ -265,11 +265,11 @@ fn test_maps() {
'1': 1
}
}) == '{"val":{"1":1}}'
// assert json.encode(StructType[map[string]map[string]int]{
// val: {
// 'a': {
// '1': 1
// }
// }
// }) == '{"val":{"a":{"1":1}}}'
assert json.encode(StructType[map[string]map[string]int]{
val: {
'a': {
'1': 1
}
}
}) == '{"val":{"a":{"1":1}}}'
}