Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
@range implementation for integer shapes #2005
@range implementation for integer shapes #2005
Changes from 7 commits
42cddc8
bc62d0e
53f5c59
4e6db6b
1c19bc7
35148b1
cf72c16
2cbe2a5
0ac5e66
f50b7b0
0b80d2e
2e77b8f
58c156f
a959004
3cc5e35
1e9d6c7
22ff34f
395c965
a65f59d
250139d
581162b
d719328
6e54c5e
d34a525
5762d2f
ea9bdac
19297bc
35dfb82
54e44c4
a94304f
f36a617
c2773cd
f37a560
5cd6d35
72cda3a
5c5c026
6efc9b9
8359468
d36930d
dc0ef4b
87e4766
7328a9e
d259d86
e2c5952
582de6d
3f1bd70
64e3312
f927eaf
922d489
563c1cc
0ec9f13
f39669b
bdec811
b2c4c9b
69c7b80
040eef6
b1787bb
5141fa4
50aa3b6
c9a7556
3977b8c
2b31a14
9ccad94
6024264
1a884f6
48f8fb9
fc3cf47
28eae9c
5b71893
2211f3f
28357fe
1d74bec
374f839
2cf6141
04ffdb7
a51e18a
3160a92
7d4d59f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Can you add a test for this arm in
ConstrainedShapeSymbolProvider.kt
?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.
Done in 35dfb82
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.
Should probably make this DRYer with
LengthTraitValidationErrorMessage.kt
if the protocol tests specify the messages coincide.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.
The message are currently slightly different, what do you mean by
?
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.
There are protocol tests that assert that we reject malformed requests, and stipulate the format of the error message that we need to return in the response: https://github.com/awslabs/smithy-rs/blob/87e4766f9896663e4e00dc8d33b9cc7c49601ea0/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/protocol/ServerProtocolTestGenerator.kt#L987-L988
When we implement everything correctly, you should see those tests start passing and hence be forced to remove them from
ExpectFail
.The format of the error message is here. It doesn't begin with "The integer value", but rather with "Value x at...".
My comment above was saying that we could extract the definition of
ending
, since it seems to be the same in both error messages.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.
I've noticed that Smithy only provides tests for malformed bytes and floats. We should write our own for
short
s,integer
s,long
s anddouble
s and contribute them upstream. Since you're only generating constrained integers, you won't be able to test that the implementation is correct unless you write tests forinteger
s in this PR too.