You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The treatAsArray should be fleshed out more to specify paths, since the current implementation is simple in that it will try and match any key to any specified in treatAsArray, regardless of depth, which may become an issue if/when more specific control is needed. As such, treatAsArray should accept strings that are in the format of what _.get would accept.
That said, "matching all and any" keys should still be possible, but this will need some custom implementation for doing so.
Specification proposal
* can be utilised as a wild card to indicate matching all/any, and the XML formatter will need to manually handle these. For initial implementation, there can be two primary uses for this: arrays and "all/any".
To indicate that emails of each object in users is what should be treated as an array, a path using the wildcard would look like users[*].emails. When the XML formatter analyses the path, seeing [*] should indicate all elements are applicable, so in this case emails from each element object is being referenced.
In the event the property doesn't exist, ignore it.
All/any
To indicate matching any and all matches of a key, something like *key could be used.
For example, in this object:
The
treatAsArray
should be fleshed out more to specify paths, since the current implementation is simple in that it will try and match any key to any specified intreatAsArray
, regardless of depth, which may become an issue if/when more specific control is needed. As such,treatAsArray
should accept strings that are in the format of what_.get
would accept.That said, "matching all and any" keys should still be possible, but this will need some custom implementation for doing so.
Specification proposal
*
can be utilised as a wild card to indicate matching all/any, and the XML formatter will need to manually handle these. For initial implementation, there can be two primary uses for this: arrays and "all/any".Arrays
Take for example the following object:
To indicate that
emails
of each object inusers
is what should be treated as an array, a path using the wildcard would look likeusers[*].emails
. When the XML formatter analyses the path, seeing[*]
should indicate all elements are applicable, so in this caseemails
from each element object is being referenced.In the event the property doesn't exist, ignore it.
All/any
To indicate matching any and all matches of a key, something like
*key
could be used.For example, in this object:
If all
test
s keys are to be treated as arrays, specifying*test
intreatAsArray
should match the following paths, casting them all to arrays:test
test_depth1.test
test_depth1.test_depth2.test
The text was updated successfully, but these errors were encountered: