json-view icon indicating copy to clipboard operation
json-view copied to clipboard

Implicitly Include All Fields on Nested Objects

Open stevenhurth opened this issue 9 years ago • 1 comments

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.

stevenhurth avatar Sep 28 '16 20:09 stevenhurth

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: ''}}

darlanmendonca avatar Aug 24 '17 19:08 darlanmendonca