Add server codegen flag addValidationExceptionToConstrainedOperations (#3803)
The Server SDK requires the model to include `aws.smithy.framework#ValidationException` in each operation that can access a constrained member shape. This becomes problematic when generating the server SDK for a model not owned by the team creating the SDK, as they cannot easily modify the model. This PR introduces a codegen flag, `addValidationExceptionToConstrainedOperations`. When set in `smithy-build-template.json`, this flag will automatically add `ValidationException` to operations that require it but do not already list it among their errors. Closes Issue: [3802](https://github.com/smithy-lang/smithy-rs/issues/3802 ) Sample `smithy-build-template.json` ``` "plugins": { "rust-server-codegen": { "service": "ServiceToGenerateSDKFor", "module": "amzn-sample-server-sdk", "codegen": { "addValidationExceptionToConstrainedOperations": true, } } } ``` --------- Co-authored-by:Fahad Zubair <fahadzub@amazon.com>
Loading
Please register or sign in to comment