JMESPath expressions in which the merge function is used may give the following error if the first argument of the merge function is of storage kind json_const_ref. This because the insert_or_assign method is not implemented for storage kind json_const_ref:
Attempting to access a member of a value that is not an object
Various JMESPath functions produce a json_const_ref, so if one of these is used as input to a merge function, the JMESPath expression doesn't work:
- map
- projections (object, list, flatten, slice, filter)
- multi select list and hash
Enumerate the steps to reproduce the bug
given:
expression with, for example, a multi select hash:
{ object: @ }.merge(object, { foo: 'bar' })
expected:
{ "foo": "bar", "foz": "baz" }
actual:
error Attempting to access a member of a value that is not an object: 'foo'
What jsoncons library version?
JMESPath expressions in which the merge function is used may give the following error if the first argument of the merge function is of storage kind json_const_ref. This because the insert_or_assign method is not implemented for storage kind json_const_ref:
Attempting to access a member of a value that is not an objectVarious JMESPath functions produce a json_const_ref, so if one of these is used as input to a merge function, the JMESPath expression doesn't work:
Enumerate the steps to reproduce the bug
given:
{ "foz": "baz" }expression with, for example, a multi select hash:
{ object: @ }.merge(object, { foo: 'bar' })expected:
{ "foo": "bar", "foz": "baz" }actual:
error
Attempting to access a member of a value that is not an object: 'foo'What jsoncons library version?