-
Notifications
You must be signed in to change notification settings - Fork 660
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
awsQueryError trait support #1283
Conversation
FYI the order of a handful of switch cases have changed in the regeneration, these are expected since this moved from a TreeSet on the ShapeId to a TreeMap where the stable sorting is on the key string now. |
36adef9
to
9a3a5e4
Compare
Map<String, ShapeId> errors = new TreeMap<>(); | ||
|
||
operation.getErrors().forEach(shapeId -> { | ||
Shape errorShape = context.getModel().expectShape(shapeId); | ||
String errorName = shapeId.getName(context.getService()); | ||
|
||
Optional<AwsQueryErrorTrait> errorShapeTrait = errorShape.getTrait(AwsQueryErrorTrait.class); | ||
if (errorShapeTrait.isPresent()) { | ||
errors.put(errorShapeTrait.get().getCode(), shapeId); | ||
} else { | ||
errors.put(errorName, shapeId); | ||
} | ||
}); | ||
|
||
return errors; |
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.
Should this map key, value pair be reversed?
I would have expected shapeId to be the key, while errorName or code is the value. Is errorName or errorCode guaranteed to be unique within all operation error shapes?
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.
Error name has to be unique cause it is the shapeId name by default. For query alias’s and whether those conflict that would be a question for smithy on whether they validate that constraint.
* Support awsQueryError trait * Regenerated Clients
Adds support for awsQueryError trait.
Requires aws/smithy-go#304