json-view
json-view copied to clipboard
Implicitly Include All Fields on Nested Objects
Currently, if we've excluded all fields from a response and are only specifying included fields, in order to include all fields of a nested object, we must qualify it with the .* notation. One minor improvement I'd like to request would be to implicitly derive that when just using the object name.
So, if I have objects:
class MyObject {
List<NestedObject> nested = new ArrayList<>();
...
}
class NestedObject {
String value = UUID.randomUUID().toString();
...
}
We have to use the include fields 'nested.*'. It would be great if we could just use 'nested' to accomplish the same thing.
probably will be better if by default, include nested keys, and accept too specify what keys, using dot syntax, e.g.
{foo: 'foo', bar: {key1: '', key2: ''}}
// instead use bar.*, only name of key include all keys
"foo, bar" // => {foo: 'foo', bar: {key1: '', key2: ''}}