Incorrect/strange handling of query parameters without a value
Consider the following URI:
?foo=bar&foo&foo=baz
On http4s level, the query.pairs contains the whole truth: Vector((foo,Some(bar)), (foo,None), (foo,Some(baz))).
However, in the conversion to smithy4s.http.HttpUri, we're converting all Nones to true. In 0.18 (0.19 is so far the same):
https://github.com/disneystreaming/smithy4s/blob/b6c789785d6085161de9d1d42469783696360112/modules/http4s-kernel/src/smithy4s/http4s/kernel/package.scala#L187-L196
The outcome of this is that, if you have a @httpQuery @sparse list of strings, instead of Nones you'll see Some(true).
IMO this is an issue - we're discarding information about the None too soon.
I assume this is not changeable in 0.18 because we'd have to change the URI model:
https://github.com/disneystreaming/smithy4s/blob/b6c789785d6085161de9d1d42469783696360112/modules/core/src/smithy4s/http/HttpUri.scala#L27
unless... we use nulls. Which is probably worse than waiting for 0.19.
Yeah I'm happy to change the modelling of HttpUri in 0.19. As a matter of fact we already have, to make the host optional and better cater to JS
cool, this is up for grabs then 😄
@denisrosca is on it