-
Notifications
You must be signed in to change notification settings - Fork 81
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: Add support for OperationContextParams #1680
Conversation
…, using existing protocol test structure, similar to how waiters used the existing protocol structure, except with endpoint the test gets generated as well.
…nitializer for string array values.
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.
Comments to help reviewers
@@ -154,6 +154,7 @@ func addProtocolTests() { | |||
.init(name: "EventStream", sourcePath: "\(baseDirLocal)/EventStream", buildOnly: true), | |||
.init(name: "RPCEventStream", sourcePath: "\(baseDirLocal)/RPCEventStream", buildOnly: true), | |||
.init(name: "Waiters", sourcePath: "\(baseDirLocal)/Waiters", testPath: "../codegen/protocol-test-codegen-local/Tests"), | |||
.init(name: "StringArrayEndpointParam", sourcePath: "\(baseDirLocal)/StringArrayEndpointParam") |
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.
Add new target for running runtime test that run against generated code
CodegenTest( | ||
"aws.endpointtests.stringarray#EndpointStringArray", | ||
"StringArrayEndpointParam" |
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.
Add the endpoint string array Smithy model to list of models used by this build script
@@ -0,0 +1,197 @@ | |||
$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 is the Smithy model file provided by SEP that has prescribed test cases. Only edits made were putting on @service
trait and @restJson1
trait to the service shape, and adding @http
traits to each of the operation shape with dummy values. This was done to "plug" this into existing protocol test codegen flow. Building the local protocol test gradle project generates Swift service code for this model, along with the endpoint tests.
@@ -66,7 +66,7 @@ class EndpointTestGenerator( | |||
val value = Value.fromNode(pair.second) |
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.
Changes in this file fixes a bug in endpoint test generator where it was incorrectly & unnecessarily casting array endpoint params to [AnyHashable]
. This was never caught before bc we never had test for it & no service has string array endpoint params yet.
@@ -6,26 +6,35 @@ | |||
package software.amazon.smithy.aws.swift.codegen.middleware |
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.
Changes in this file add support for handling the @operationContextParams
trait
@@ -30,33 +30,45 @@ public struct EndpointParams { | |||
public let boolBaz: Swift.String? |
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.
From here on it's just codegen test updates
Companion PR
Issue #
SWIFT-1125
Description of changes
@operationContextParams
traitNew/existing dependencies impact assessment, if applicable
Conventional Commits
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.