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

Fix @length-constrained collection shapes whose members are not constrained #2103

Conversation

david-perez
Copy link
Contributor

The generated code these should have emitted was fixed in #2085 (it's
bug number 2), but code generation is still crashing because the call to
calculate the inner constraint violation symbol is performed before
checking that the collection's member can reach a constrained shape.

The test that #2085 added in constraints.smithy:

@length(max: 69)
list LengthList {
    member: ConB
}

was not exercising what it should have, since ConB, is its name hints
at, is a constrained structure shape.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…strained

The generated code these should have emitted was fixed in #2085 (it's
bug number 2), but code generation is still crashing because the call to
calculate the inner constraint violation symbol is performed _before_
checking that the collection's member can reach a constrained shape.

The test that #2085 added in `constraints.smithy`:

```smithy
@Length(max: 69)
list LengthList {
    member: ConB
}
```

was not exercising what it should have, since `ConB`, is its name hints
at, is a constrained structure shape.
@david-perez david-perez added bug Something isn't working server Rust server SDK labels Dec 14, 2022
@david-perez david-perez requested review from a team as code owners December 14, 2022 16:14
@david-perez david-perez requested review from jdisanti and crisidev and removed request for jdisanti December 14, 2022 16:14
@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@jjant jjant enabled auto-merge (squash) December 15, 2022 14:12
@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@jjant jjant merged commit 0dd6c82 into main Dec 15, 2022
@jjant jjant deleted the davidpz/fix-length-constrained-shapes-whose-members-are-not-constrained branch December 15, 2022 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working server Rust server SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants