-
Notifications
You must be signed in to change notification settings - Fork 247
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
feat(smithy): awsQuery
protocol
#2807
Conversation
awsQuery
protocol supportawsQuery
protocol
2b5d4c6
to
8d8a910
Compare
d642a00
to
422cee1
Compare
760babd
to
edf9ca6
Compare
Previously, structure members were generated in alphabetical order, but this causes issues for some protocols like `awsQuery` that require members to be serialized in a specific order. This commit changes the codegen to generate members in the order they are defined in the Smithy model.
Updates service client generation for `awsQuery` which does not explicitly set an `@httpTrait`.
Tests the `awsQuery` protocol via the STS service.
Blindly appending `Operation` to the end of an operation's name can create conflicts, like with CloudFormation where both `DescribeStacks` and `DescribeStacksOperation` are valid operations. This change makes it so that the operation name is only appended if doing so wouldn't create a conflict.
edf9ca6
to
17cc099
Compare
var isUnderspecified = | ||
specifiedType.isUnspecified || specifiedType.parameters.isEmpty; | ||
|
||
var keyType = specifiedType.parameters.isEmpty | ||
? FullType.unspecified | ||
: specifiedType.parameters[0]; | ||
var valueType = FullType(BuiltList, [ | ||
specifiedType.parameters.isEmpty | ||
? FullType.unspecified | ||
: specifiedType.parameters[1] | ||
]); | ||
|
||
var result = isUnderspecified |
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.
These can all be final, no?
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 we update this lib to use library.yaml instead of library_core.yaml?
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.
Yeah.. eventually. It's a bigger task. I was optimizing for speed and correctness, not cleanliness for this package.
@@ -0,0 +1,61 @@ | |||
$version: "2.0" |
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 isn't generated, is it? Should we update .gitattributes
?
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.
It's not technically generated, but it's pulled from https://github.com/awslabs/smithy. I'll see if there's a better qualifier for gitattributes.
@@ -20,6 +20,7 @@ const skipProtocols = [ | |||
const awsProtocols = [ | |||
'awsJson1_0', | |||
'awsJson1_1', | |||
'awsQuery', |
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.
Similar comment as above. This is not generated, correct? .gitattributes
has everything in goldens marked as generated.
.result; | ||
|
||
// Get credentials for the user | ||
final credentials = await client |
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.
nit: Would name this result
or response
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.
Probably. These tests were all mostly Copilot generated 😆
Adds support for the
awsQuery
protocol which includes services such asCloudFormation
,IAM
, andSTS
.