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

Standardize validation error text across target languages? #611

Open
robin-aws opened this issue Sep 25, 2024 · 1 comment
Open

Standardize validation error text across target languages? #611

robin-aws opened this issue Sep 25, 2024 · 1 comment

Comments

@robin-aws
Copy link
Contributor

Spin-off from #582 (comment)

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: #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)

@robin-aws
Copy link
Contributor Author

Relevant: Smithy now includes a built-in error shape for validation exceptions, smithy.framework#ValidationException. See https://smithy.io/2.0/tutorials/full-stack-tutorial.html#generating-the-server-sdk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant