-
Notifications
You must be signed in to change notification settings - Fork 197
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
Remove invalid defaults for some services #3217
Remove invalid defaults for some services #3217
Conversation
914cea3
to
3d2bb04
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems more service specific? (in which case, we'd put in it in the service-specific decorator) but doesn't super matter. We should make sure we get examples updated in case this causes examples compilation issues.
Code is fine, just want to make sure we audit the generated code before landing.
"com.amazonaws.emrserverless#AwsToledoWebService".shapeId() to setOf( | ||
// Service expects this to have a min value > 0 | ||
"com.amazonaws.emrserverless#WorkerCounts".shapeId() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to do it based on the range check? Or is hard coding it the right thing to do here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about doing that. But my reasoning for not doing so was that since the range is wrong now, this will generate an Option<T>
. Down the road, if the range check became not wrong, it would be a breaking change. So I think its best to just remove the default and always do it to be consistent. Comment is there just for context.
@rcoh This started out with quite a few more services, but by the time the PR was ready only one was left. I can update if need be though. |
Adds a customization that removes default values, and uses it to remove the default values for some shapes in certain services that have a default value of 0, but the service expects a value > 0.
3d2bb04
to
4ae08f1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM—please just add TODO(<link to ticket in this repo): Remove this customizations after model updates
bd9d122
to
7405fb9
Compare
Motivation and Context
Some services have generated types with properties that have a default value of zero. This can cause invalid requests if the service expects a value > 0.
Description
Adds a customization that removes the default value for services with this issue.
Testing
Checklist
CHANGELOG.next.toml
if I made changes to the AWS SDK, generated SDK code, or SDK runtime cratesBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.