Open szainmehdi opened 1 year ago
My problem with dot notation is that this:
{
"data": {
"name": "bob"
},
"data.name": "alice"
}
is valid json
It's also inconsistently implemented even within laravel itself. Arr::get
vs. data_get
.
Oh that's a good point about data.name
being a valid JSON key.
Generally speaking I like the simplicity of dot-notation, and it saves a few keystrokes. But I understand why it may not make sense for this library 👍
Actually the real issue when using dot notation wouldn't be deserializing but serializing. IE: where do I put a value that has a path of data.name
? When de-serializing you could try both, when serializing you're .... kinda stuck.
Using the example definition in the README, it would be great (and familiar to Laravel users) to define nested JSON mappings using dot-notation.