Open CosmicToast opened 5 years ago
If one looks at
.query
contents, it seems like the parser assumes a scenario like/endpoint?value&key2=value2
to mean this:
k v value key2 value2 And that is what it actually means.
So certainly, having something along the lines of...
@queryParam("field")
void getX(string field) {
logInfo(field);
}
be equivalent to
void getX(HTTPServerRequest req) {
string field;
if (req.query.length > 0) field = req.query.byKey.front;
// any (other?) static checks present in queryParam
logInfo(field);
}
Isn't much of a stretch then?
Consider the case of a single (optional) query parameter without any id, like so:
/endpoint?value
Currently, there's no way to actually catch/parse that without directly using
.queryString
, or doing some weird logic to.query
. If one looks at.query
contents, it seems like the parser assumes a scenario like/endpoint?value&key2=value2
to mean this:Since DictonaryList is guaranteed to preserve order, this should not be particularly complex.