I'm trying to decode nested values from JSON like this:
{
name: 'exo',
code: '1212',
nested: {
name: 'lika',
code: '020202',
place: 'somewhere'
},
other1: 'oooo',
other2: 8989
}
and got an error:
The value `undefined` is not of type `string`, but is of type `undefined`
when trying to decode the key `place` in `{"name":"exo","code":"1212","nested":{"name":"lika","code":"020202","place":"somewhere"},"other1":"oooo","other2":8989}
This is my decoder function:
const dataDecoder = record({
name: field('nested', field('name', string)),
place: field('nested', field('place', string))
});
How can I decode values from nested objects?
I'm trying to decode nested values from JSON like this:
and got an error:
This is my decoder function:
How can I decode values from nested objects?