Skip to content

Make ValidationException not need to be explicitly declared in model #4494

@jasgin

Description

@jasgin

Context

CI in #4399 is currently blocked due to certain protocol tests that don't have ValidationException in the error closure when the server expects it.

smithy-lang/smithy#2861 was closed due to it being a difference in the spec implementation with the Rust SDK.

Discussed with the Smithy team to address some ambiguity in the specification: https://smithy.io/2.0/spec/constraint-traits.html#constraint-trait-enforcement.

It was clarified that ValidationException is, informally, a synthetic error and should be used without having to declare any API as throwing it.

Action Items

Remove the need to explicitly declare ValidationException in the error closure of services / operations when containing constrained input by transparently adding it to the operation errors before proceeding with code generation. We currently do this behind the addValidationExceptionToConstrainedOperations codegen flag that users can opt into.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions