-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specification for deserialising @httpQueryParams #956
Comments
That's a great question, we actually ran into that recently and added a server test that incorporates it, but failed to boil that up to narrative documentation. The answer is that a key without a value (or a key with an empty value like |
This makes sense; thanks. A similar issue crops up for |
Ah, we really should have forced that to target a required member. For a client, you always just take whatever is on the request. For a server, you would just serialize the default code as you said |
Closing this as I think the associated pull request (thanks for the contribution!) covered what you were looking for. |
The specification states that
@httpQueryParams
can only be used on operation inputs, and gives rules about how such inputs should be serialised when making and sending requests. It doesn't (I believe), however, talk about how to deserialise/parse query parameters (e.g. in [generated] server-side code) when receiving requests. Specifically, it's not clear how to handle query string parameters that do not have values.For instance, given these Smithy definitions:
Serialising a request is specified and makes sense -- supposing we have a map with entries
("first", "1")
and("second", "true")
we must produce?first=1&second=true
. However, suppose we receive a request with the query string?first=1&second&third=false
. What should we do? Options I can think of:second
), yielding("first", "1"), ("third", "false")
MyMap
map shape as though it were@sparse
, permitting us to have optional values in it, and store all keys, yielding("first", "1"), ("second", null), ("third", "false")
400 Bad Request
) and require that all keys must have valuesThoughts welcome and apologies if I have missed something that clears this up in the spec.
The text was updated successfully, but these errors were encountered: