Hi guys! In this example: the param baz is not included in the query-params map. I use the middleware wrap-params of ring 1.13.0 . It's normal?
What value for the key "baz" (or maybe it ends up as :baz) are you expecting to see?
I'm expected to see something like {"baz" ""}since query string like ?baz&foo=1 produce {"baz" "" "foo" "1"}
Have you checked out the source for wrap-params? Does that give you an idea of what might be going on?
Yes and maybe it's a bug
If you want {"baz" "", "foo" "1"} the query string would be: ?baz=&foo=1. Why do you expect ?baz&foo=1 to work?
Yes ?baz&foo=1 works well but ?baz produce {} . I'm expecting {"baz" ""}
But why do you expect that to work?
?baz= would produce {"baz" ""}
Oh, wait, you're saying ?baz&foo=1 works? Let me quickly check that.
So it does. That looks like a bug - ?baz&foo=1 should produce {"foo" "1"}
I think it's good that ?baz&foo=1 produce {"baz" "" "foo" 1} but only ?baz should be produce {"baz" ""} since ?baz is considered valid.
Why is it valid?
It might refer to boolean kind value
Is there any such thing in form-encoding? Is there an RFC or definition you're looking at?
Ah, found it. It's surprising difficult to find an authorative definition of form encoding online.
You're correct - according to https://url.spec.whatwg.org/#urlencoded-parsing the query string ?baz should be encoded as {"baz" ""}.
I check this RFC https://www.rfc-editor.org/rfc/rfc3986#section-3.4. This doesn't mandate a key=value even if this is the popular format
Yes, the URI RFC doesn't specify that. The WHATWG URL definition does though, and that's the only authorative source I could find.
Could you open an issue for this on Ring?
Yes sure
Many thanks.
Thanks!