-
Notifications
You must be signed in to change notification settings - Fork 196
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 constraint-related errors in Rpcv2CBOR server implementation #3794
Conversation
A new generated diff is ready to view.
A new doc preview is ready to view. |
Can we add a changelog entry with |
39d57f3
to
5bb92b1
Compare
…o fahadzub/cbor-constraint
A new generated diff is ready to view.
A new doc preview is ready to view. |
829cc8d
to
763d598
Compare
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
…e for event stream
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
ea69024
to
050d9c5
Compare
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
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.
lgtm; just a few nits
...-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/RpcV2Cbor.kt
Outdated
Show resolved
Hide resolved
...e/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/EventStreamTestModels.kt
Outdated
Show resolved
Hide resolved
...n/smithy/rust/codegen/server/smithy/transformers/ServerProtocolBasedTransformationFactory.kt
Outdated
Show resolved
Hide resolved
...n/smithy/rust/codegen/server/smithy/transformers/ServerProtocolBasedTransformationFactory.kt
Show resolved
Hide resolved
*/ | ||
fun loadSmithyConstraintsModel(): Pair<Model, ShapeId> { | ||
val filePath = "../codegen-core/common-test-models/constraints.smithy" | ||
val serviceShapeId = ShapeId.from("com.amazonaws.constraints#ConstraintsService") |
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.
nit: you could expect it from the parsed model below instead of hardcoding it.
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.
Have changed it to return the first service shape in the constraints file.
Co-authored-by: david-perez <[email protected]>
Co-authored-by: david-perez <[email protected]>
…en/core/smithy/protocols/RpcV2Cbor.kt Co-authored-by: david-perez <[email protected]>
…en/core/testutil/EventStreamTestModels.kt Co-authored-by: david-perez <[email protected]>
…tory class will be removed later on
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
This PR addresses issues with code generation related to constraints for the Rpcv2CBOR protocol.
Additionally, it introduces protocol-based model transformation on the server side. This transformation ensures that elements in the model not supported by Rpcv2CBOR, such as httpBinding related traits, are removed before code generation.