-
Notifications
You must be signed in to change notification settings - Fork 68
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
Serializing default values causes failure in EC2 DescribeRequest #1321
Comments
I'm hoping #1315 may resolve this, but I'm not 100% sure whether it's the same issue or not. |
It's a problem in the encoder derivation for UrlForm (which is the format that EC2 uses for request bodies) : smithy4s/modules/core/src/smithy4s/http/internals/UrlFormDataEncoderSchemaVisitor.scala Lines 139 to 141 in 4b7a8b1
the use of contramap is incorrect here. Instead, |
Something like this? new UrlFormDataEncoder[S] {
override def encode(value: S): List[UrlForm.FormData] =
field.getUnlessDefault(value) match {
case Some(a) => compile(field.schema).encode(a)
case None => List.empty
}
}
.prepend(getKey(field.hints, field.label)) |
Nearly : If you're intending of PR'ing the fix, you'll also have to add a unit test or two. |
Using the generated EC2 client's
describeInstance
method, set a list of Instance IDs and attempt to make a request. It will fail because the defaultMaxResults
value is set on the request as well, which is forbidden by the AWS API.Reproduction:
Running this results in
I worked around this by removing
MaxResults
from the model using a preprocessor:The text was updated successfully, but these errors were encountered: