Skip to content
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

Converts endpoint param list of string to list of value #5169

Conversation

cenedhryn
Copy link
Contributor

Motivation and Context

The type of the endpoint param, List<String>, and the type required by the rules engine, List<Value>, are incompatible. Codegen Generated Classes Test cannot compile.

Modifications

  • Changed the parameter assignment in the rules engine to a list of Value by streaming the endpoint parameter contents and converting each String using Value.fromStr
  • Also added stringarray to ParameterType - required for Codegen Generated Classes Test tests to compile

@cenedhryn cenedhryn requested a review from a team as a code owner April 30, 2024 23:16
@@ -147,6 +147,10 @@ public CodeBlock valueCreationCode(String type, CodeBlock param) {
break;
case "stringarray":
methodName = "fromArray";
param = CodeBlock.of("$L.stream().map($T::fromStr).collect($T.toList())",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: use $N.stream() instead of $L, since $N is used for identifiers

@cenedhryn cenedhryn merged commit ffb1cfa into feature/StringArrayEndpointParams Apr 30, 2024
1 of 16 checks passed
@cenedhryn cenedhryn deleted the salande/convert-list-from-string-to-value branch April 30, 2024 23:32
Copy link

sonarcloud bot commented Apr 30, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
76.5% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

cenedhryn added a commit that referenced this pull request May 13, 2024
* feat(StringArrayEndpointParams) Codegen String Array Enpoint params and Auth schemes params based on end-point-rule-set.json. (#5122)

* Support Customization string array endpoint params for S3 access grants, until all SDKs add support for string array. (#5137)

* new(StringArrayEndpointParams) Codegeneration of OperationContextParams defined for a Operation. (#5146)

* Extracting existing JMESPath runtime to a separate class (#5155)

* new(StringArrayEndpointParams) Customization of Operation Context params and adding customizations for S3 (#5159)

* Converts endpoint param list of string to list of value (#5169)

* Generates JmesPath expressions for operation context parameters (#5172)

* Supporting wildcard and keys fn in JmesPathRuntime (#5198)

* Adds functional tests for list of string auth params (#5216)

* Changelog

---------

Co-authored-by: John Viegas <70235430+joviegas@users.noreply.github.com>
Co-authored-by: John Viegas <joviegas@amazon.com>
akidambisrinivasan pushed a commit to akidambisrinivasan/aws-sdk-java-v2 that referenced this pull request Jun 28, 2024
* feat(StringArrayEndpointParams) Codegen String Array Enpoint params and Auth schemes params based on end-point-rule-set.json. (aws#5122)

* Support Customization string array endpoint params for S3 access grants, until all SDKs add support for string array. (aws#5137)

* new(StringArrayEndpointParams) Codegeneration of OperationContextParams defined for a Operation. (aws#5146)

* Extracting existing JMESPath runtime to a separate class (aws#5155)

* new(StringArrayEndpointParams) Customization of Operation Context params and adding customizations for S3 (aws#5159)

* Converts endpoint param list of string to list of value (aws#5169)

* Generates JmesPath expressions for operation context parameters (aws#5172)

* Supporting wildcard and keys fn in JmesPathRuntime (aws#5198)

* Adds functional tests for list of string auth params (aws#5216)

* Changelog

---------

Co-authored-by: John Viegas <70235430+joviegas@users.noreply.github.com>
Co-authored-by: John Viegas <joviegas@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants