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

Add server codegen flag addValidationExceptionToConstrainedOperations #3803

Merged
merged 8 commits into from
Aug 29, 2024

Conversation

drganjoo
Copy link
Contributor

@drganjoo drganjoo commented Aug 27, 2024

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

Sample smithy-build-template.json

"plugins": {
            "rust-server-codegen": {
                "service": "ServiceToGenerateSDKFor",
                "module": "amzn-sample-server-sdk",
                "codegen": {
                    "addValidationExceptionToConstrainedOperations": true,
                }
            }
        }

… to include ValidationException in constrained operations.
@drganjoo drganjoo added the server Rust server SDK label Aug 27, 2024
@drganjoo drganjoo requested review from a team as code owners August 27, 2024 12:16
@drganjoo drganjoo changed the title Add server codegen flag addValidationExceptionToConstrainedOperations… Add server codegen flag addValidationExceptionToConstrainedOperations Aug 27, 2024
Copy link

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python
  • No codegen difference in the Server Test Typescript

A new doc preview is ready to view.

Copy link

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python
  • No codegen difference in the Server Test Typescript

A new doc preview is ready to view.

@drganjoo drganjoo force-pushed the fahadzub/add-validation branch from bc58bd1 to 0ecfce8 Compare August 28, 2024 09:53
@drganjoo drganjoo force-pushed the fahadzub/add-validation branch from 0ecfce8 to d254283 Compare August 28, 2024 09:55
Copy link

Copy link

Copy link

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python
  • No codegen difference in the Server Test Typescript

A new doc preview is ready to view.

@drganjoo drganjoo added this pull request to the merge queue Aug 29, 2024
Merged via the queue into main with commit 35f53b4 Aug 29, 2024
44 checks passed
@drganjoo drganjoo deleted the fahadzub/add-validation branch August 29, 2024 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
server Rust server SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants