If the map specifies an array and the underlying data is an object, it should be presented as an array
If there is an underlying data structure as follows:
var src = {foo: {bar: 'baz'}}
And the map is as follows:
var map = { 'foo[].bar': 'abc[].def' }
Note that the src does not have an array at foo, but the mapping definition does. I'd like the output to be:
var expect = { abc: [ {def: baz} ] }
Currently, object mapper will not return any data, which is technically correct. However, to deal with APIs that don't behave well it would be nice to be able to identify that the underlying data structure is an object rather than array and put it into an array.
Note that the current functionality is that if an object is specified and the underlying data is an array, we automatically take the first node. This is the opposite case - e.g. an array is specified and the underlying data is an object. This should work the same way - I think this is a bug and not a feature. Note that none of the tests break when this fix is implemented.