Skip to content

Abort server SDK generation when multiple protocols are specified #2980

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

Open
david-perez opened this issue Sep 12, 2023 · 0 comments
Open

Abort server SDK generation when multiple protocols are specified #2980

david-perez opened this issue Sep 12, 2023 · 0 comments
Labels
good first issue Good for newcomers high-priority High priority issue server Rust server SDK

Comments

@david-perez
Copy link
Contributor

Until server-side multi-protocol support lands (see #2979), we should abort code generation when we encounter a model where the service shape is annotated with multiple protocol traits.

$version: "2"

namespace smithy.example

use aws.protocols#restJson1
use aws.protocols#awsJson1_1

@restJson1
@awsJson1_1
service MyService {
    version: "2023-09-12"
}

We currently pick the first protocol and ignore the rest. This can lead to user confusion, as they might reasonably expect that if code generation succeeds, the server SDK can honor what they modeled.

One possibility to implement this could be to add a software.amazon.smithy.model.validation.Validator that only gets loaded when generating servers (see #2752 for an example), which I think is preferable, as the error will surface in Smithy's consistent report format. Another is to simply throw a CodegenException in ServerProtocolLoader.

@david-perez david-perez added the server Rust server SDK label Sep 12, 2023
@david-perez david-perez added the good first issue Good for newcomers label Oct 13, 2023
@drganjoo drganjoo added the high-priority High priority issue label Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers high-priority High priority issue server Rust server SDK
Projects
None yet
Development

No branches or pull requests

2 participants