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

streaming must be paired with httpPayload in protocols that use HTTP binding traits #1075

Closed
david-perez opened this issue Feb 1, 2022 · 0 comments · Fixed by #1076
Closed

Comments

@david-perez
Copy link
Contributor

david-perez commented Feb 1, 2022

This model is accepted by Smithy:

$version: "1.0"

namespace com.amazonaws.simple

use aws.protocols#restJson1

@restJson1
@title("SimpleService")
service SimpleService {
    version: "2022-01-01",
    operations: [
        StreamingOperation,
    ],
}

@http(uri: "/streaming", method: "GET")
operation StreamingOperation {
    input: StreamingOperationInput,
    output: StreamingOperationOutput,
}

@input
structure StreamingOperationInput {}

@output
structure StreamingOperationOutput {
    @required
    streamId: String,
    output: StreamingBlob,
}

@streaming
blob StreamingBlob

Smithy should reject this model and enforce the rule "streaming must be paired with httpPayload in protocols that use HTTP binding traits".

This example is featured in the docs, which would need to be updated.

adamthom-amzn added a commit to adamthom-amzn/smithy that referenced this issue Feb 2, 2022
Protocols that support HTTP binding can only stream a blob if it is the payload
of the request or response. The streaming trait validator will now fail models
where a service ultimately references a streaming blob and the member is not
marked as @httpPayload.

Fixes smithy-lang#1075
adamthom-amzn added a commit that referenced this issue Feb 2, 2022
Protocols that support HTTP binding can only stream a blob if it is the payload
of the request or response. The streaming trait validator will now fail models
where a service ultimately references a streaming blob and the member is not
marked as @httpPayload.

Fixes #1075
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

Successfully merging a pull request may close this issue.

1 participant