Returning malformed xpath key when key with null value is passed in the path.
Request : -p /A/B[x=1][y='']/C
error is given- building get request failed: invalid value: malformed xpath key
Error: one or more path failed
I am requesting a list B for which one of the keys, say y='', has null value. When I pass this key in the path, it returns the error.
Typically keys must have values if your gNMI server is backed by a YANG schema:
https://datatracker.ietf.org/doc/html/rfc7950#section-7.8.2
The combined values of all the leafs specified in the key are used to
uniquely identify a list entry. All key leafs MUST be given values
when a list entry is created. Thus, any default values in the key
leafs or their types are ignored. Any "mandatory" statements in the
key leafs are ignored.
But your issue is really shell quoting and escape rules, it gets rid of '' and passes it as en empty string.
If should work as expected if you change the path to /A/B[x=1][y=\'\']/C
Thanks for the RFC @karimra . About that last bit you added regarding escape rules!. When I requested the above-mentioned path with [y=''] it said "Unexpected data after path". I guess without \ is working for me. It's just I need to have values for all the keys. Please add if anything I need to know.