Details
-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
2.8.5
-
1
Description
Hi,
When querying a view with libcouchbase and supplying a real number key, for instance 1.23e+04, which is a valid JSON number, the key, as I understand, ends up in a uri, and as it should, the reserved character '+' is replaced by a space, leading to an issue with the real number syntax (1.23e 04 is not a valid JSON number). The query fails and reports a syntax error. So, as RFC 3986 requires it (https://en.wikipedia.org/wiki/Percent-encoding), the '+' sign needs to be percent-encoded, and replaced by %2B. After that, everything works fine.
However, if the key is a JSON array, say [1, 2], it does not seem to be the case. '[', ',' and ']' are all uri reserved characters, like '+', and should be encoded (respectively into %5B, %2C, %5D). But when this is done, there is an error ("Unknown Error") reported by the library. It's only when the three characters are unencoded that everything works.
Is there some documentation explaining the rules to follow, and what libcouchbase does? It does not seem to be intuitive. For instance, if I search the array key [1.23e+04], should I use [1.23e%2B04], or some other combination?
As usual, thanks!