Is there any standard in effect for what exactly a “query parameter” is? (I know ampersand separated name=value pairs is quasi-standard but I’m not sure if it is formalized anywhere). Is it correct to say that, e.g.,:
filter[foo]=1
Is a “filter query parameter”?
It seems reasonable to argue that this is actually a “filter[foo] query parameter” and thus not following the recommendation. I know some frameworks parse this kind of thing into a map like {filter: {foo: 1}}. Is that something the specification assumes?
Before I solidify what my filter syntax will be I’d like to be sure that some or all of the above examples are actually in line with the recommendation in the specification.
If string contains a “=” (U+003D) character, then let name be the substring of string from the start of string up to but excluding its first “=” (U+003D) character,
So, strictly speaking a “filter query parameter” must be filter=....
I think I’ll just assume that’s what the spec means to be safe.
The query parameter is defined in RFC3986, and you’ll see other mention to the & as the sub delimiter elsewhere in the spec.
The URL needs to be percent encoded, not urlencoded.
Your strategy for the filter may work, however as a framework designer and developer I caution you against backing yourself in a corner with such a constraining data structure choice as a flat map. It may be more beneficial to use an array (of one) simply to have the flexibility down the line, as multiple filters of the same name wouldn’t necessarily be an unheard of event. e.g. foo > 10 && foo < 60.