add $key for all object and support private class name
As the readme file shows, add $key for all object, not only in array. The $key value support private ClassName start by _ .
i like that 👍
@mark-apn can we merge this?
Sorry for keeping you waiting. I'll take a look at this this week!
Question about this PR.
Why not just change the key in the json in the first place.
{
"movie": {
"id": 123
}
}
Will generate a Movie class and by changing the key movie you change the key in the output.
Why do we need this:
{
"movie": {
"$key": "film",
"id": 123,
}
}
When we can just do this.
{
"film": {
"id": 123
}
}
if I remember correctly it helps fixing this : https://github.com/fadhilx/json_to_model/issues/30 without having to use separate files;
(when we have two keys with same name, but with different properties, it avoid name clashes in generated files)