Polymorph generally evaluates constraints "on the client side", i.e. in the target language rather than the source language. That means unlike with a real microservice, the exact error messages can be different.
On the other hand, having the validation in each target language means the error text can be slightly more tuned to that language, which is better UX: "The full_name field must be set - call .set_full_name(...) on the builder" (using e.g. Rust terms and concrete symbols) as opposed to "The FullName member must be present" (generic validation on the server side, has to use generic Smithy terms)
Spin-off from https://github.com/smithy-lang/smithy-dafny/pull/582#discussion_r1773676073
Polymorph generally evaluates constraints "on the client side", i.e. in the target language rather than the source language. That means unlike with a real microservice, the exact error messages can be different.
On the one hand, we've seen any variation can be cause for alarm when trying to assert that a polymorphed library behaves identically to the original: https://github.com/smithy-lang/smithy-dafny/issues/362
On the other hand, having the validation in each target language means the error text can be slightly more tuned to that language, which is better UX: "The full_name field must be set - call .set_full_name(...) on the builder" (using e.g. Rust terms and concrete symbols) as opposed to "The FullName member must be present" (generic validation on the server side, has to use generic Smithy terms)