2022-11-20 12:18:14 +03:00
|
|
|
import x.json2 as json
|
|
|
|
|
|
|
|
struct TodoDto {
|
|
|
|
foo int
|
|
|
|
}
|
|
|
|
|
|
|
|
fn test_decode_with_encode_arg() {
|
|
|
|
body := TodoDto{}
|
2022-12-05 17:32:15 +03:00
|
|
|
ret := json.decode[TodoDto](json.encode(body))!
|
2022-11-20 12:18:14 +03:00
|
|
|
println(ret)
|
|
|
|
assert ret.foo == 0
|
|
|
|
}
|