If you write this dataset:
To a JSON file and let Easy Data Transform set the “Code” column type automatically, you get:
[
{
"code": 001
},
{
"code": 002
},
{
"code": 003
}
]
Which looks fine. But Easy Data Transform can’t then read it back in as an input.
The reason is that the JSON parser we use doesn’t treat anything starting with a ‘0’ as a number. The reason for this obscure decision is discussed here:
So it should have output “Code” as JSON strings by default:
[
{
"code": "001"
},
{
"code": "002"
},
{
"code": "003"
}
]
You can work around this issue by manually set the “Code” column type to JSON string:
We should be able to fix this so that numbers with leading 0s are output as JSON strings by default.
Thanks to Michael S. for bringing this to our attention.