-
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
Should clients reject responses with set
s with duplicate elements?
#1266
Comments
No. Clients rejecting responses is lossy (it prevents you from knowing about state changes that actually happened). |
Under what circumstances should clients reject responses? Only upon deserialization errors (like malformed JSON)? I'm thinking if having |
Yes, in general a client should do everything in its power to render a response from the server. Malformed JSON (or a non-JSON response) are the only cases I can think of where you should reject a response. |
We deprecated sets and treating them exactly like |
I think there's another category of warranted response rejections by the client: number conversions. Technically not malformed JSON. But it's best for the client to reject a number that doesn't fit in the Smithy modeled type than to attempt an e.g. double to single-precision float conversion, or a floating point into an integral type conversion, when the receiver type cannot fit the value. Not rejecting could lead to very hard to identify logic bugs. I think an I identified this category of errors when trying to pass |
If a client receives a response, that, upon deserialization, results in data for a
set
shape that contains duplicate values, should a client reject it?Servers do reject requests:
https://github.com/awslabs/smithy/blob/c8ce65a2bcc0264f3aeeb9db096564e0491a8786/smithy-aws-protocol-tests/model/restJson1/malformedRequests/malformed-set.smithy#L15-L36
The text was updated successfully, but these errors were encountered: