Nested server structure member shapes targeting simple shapes with @default
don't work
#2343
Labels
bug
Something isn't working
constraint-traits
high-priority
High priority issue
server
Rust server SDK
Milestone
Minimal reproducer:
The issue is largely within these functions:
https://github.com/awslabs/smithy-rs/blob/bf678fd7d28762e7add375f8485bd7f307b8e317/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerBuilderConstraintViolations.kt#L86-L94
https://github.com/awslabs/smithy-rs/blob/bf678fd7d28762e7add375f8485bd7f307b8e317/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/Constraints.kt#L80-L95
Using the example above:
OperationInput
is correctly detected as constrained because of@required
and because its member's target,KeyModesOfUse
, reaches thePrimitiveBoolean
constrained shape, since it is not optional (note thatPrimitiveBoolean
has@default(false)
in the prelude).https://github.com/awslabs/smithy-rs/blob/bf678fd7d28762e7add375f8485bd7f307b8e317/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/Constraints.kt#L86-L86
KeyModesOfUse
structure, the member is not detected as constrained: there is no arm inisDirectlyConstrained
that matches the shape's type (theBooleanShape
Java class), so we go through theelse
branch.So this results in the constraint violation for
OperationInput
containing a member pointing to the constraint violation forKeyModesOfUse
, but the latter is never rendered!The text was updated successfully, but these errors were encountered: