x.json2.decoder2: support nesteded maps (#23027)

This commit is contained in:
Hitalo Souza 2024-12-01 08:08:37 -04:00 committed by GitHub
parent e421cb2bc2
commit d8021bd459
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 11 deletions

View file

@ -322,7 +322,7 @@ fn (mut checker Decoder) check_json_format(val string) ! {
}
}
}
if checker.checker_idx < checker_end - 1 {
if checker.checker_idx < checker_end - 2 {
checker.checker_idx++
}
}
@ -748,9 +748,12 @@ fn (mut decoder Decoder) decode_map[K, V](mut val map[K]V) ! {
mut map_value := V{}
decoder.decode_value(mut map_value)!
val[key] = map_value
$if V is $map {
val[key] = map_value.move()
} $else {
val[key] = map_value
}
decoder.decode_value(mut val[key])!
}
}
}