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

feat: Add support for OperationContextParams #800

Merged
merged 7 commits into from
Aug 21, 2024

Conversation

sichanyoo
Copy link
Contributor

@sichanyoo sichanyoo commented Aug 15, 2024

Companion PR

Issue #

Description of changes

  • See comments in GitHub diff

Scope

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor Author

@sichanyoo sichanyoo left a 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

Comment on lines +23 to +26
public func add(name: String, value: [String]?) throws {
try crtContext.add(name: name, value: value)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add runtime method for adding string array endpoint param to endpoint request context using CRT's new binding.

Comment on lines +137 to +147
if (type.equals(ParameterType.STRING)) {
builder.defaultValue("\"$defaultValue\"")
} else if (type.equals(ParameterType.STRING_ARRAY)) {
val elementsWrappedWithEscapedQuotes = defaultValue.toString()
.removeSurrounding("[", "]")
.split(", ")
.joinToString(", ", "[", "]") { "\"$it\"" }
builder.defaultValue(elementsWrappedWithEscapedQuotes)
} else {
builder.defaultValue(defaultValue.toString())
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fix default value handling for endpoint params generator.

@@ -54,15 +54,13 @@ class JMESPathVisitor(
val writer: SwiftWriter,
Copy link
Contributor Author

@sichanyoo sichanyoo Aug 17, 2024

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 wildcard flattening expression ([*]) and the keys() function of JMESPath language.

@sichanyoo sichanyoo merged commit c237a28 into main Aug 21, 2024
27 checks passed
@sichanyoo sichanyoo deleted the feat/operation-context-params branch August 21, 2024 16:01
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.

2 participants