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

Add OperationContextParams + validator #2264

Merged
merged 8 commits into from
May 2, 2024

Conversation

alextwoods
Copy link
Contributor

@alextwoods alextwoods commented Apr 29, 2024

Background

  • Adds new OperationContextParams trait to support binding of array parameters to nested operation inputs and an associated validator.

Testing

  • New validator tests (valid/invalid)

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

@alextwoods alextwoods marked this pull request as ready for review April 30, 2024 16:28
@alextwoods alextwoods requested a review from a team as a code owner April 30, 2024 16:28
@alextwoods alextwoods requested a review from sugmanue April 30, 2024 16:28
StructureShape input = OperationIndex.of(model).expectInputShape(operationShape);
LinterResult linterResult = path.lint(createCurrentNodeFromShape(input, model));

if (!linterResult.getProblems().isEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add some tests for the linter result?

E.g.,

  • Using an array as object, someArray.key
  • Using an object as array, someObject[*]
  • Field not present in the structure someObject.fieldThatDoesNotExist
  • Array/object operations on simpleTypes
  • A test for recursive shapes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added more linter tests

@gosar gosar merged commit 4db4374 into smithy-lang:main May 2, 2024
13 checks passed
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.

3 participants