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

Collapse eventstream with the streaming trait #365

Merged
merged 4 commits into from
Apr 10, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 28 additions & 9 deletions docs/source/spec/core/http-traits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ Event streams

When using :ref:`event streams <event-streams>` and HTTP bindings, the
:ref:`httpPayload <httppayload-trait>` trait MUST be applied to any input or
output member targeted by the :ref:`eventStream-trait`.
output member that targets a shape marked with the :ref:`streaming-trait`.

The following example defines an operation that uses an input event stream
and HTTP bindings:
Expand All @@ -951,8 +951,12 @@ and HTTP bindings:

structure PublishMessagesInput {
@httpPayload
@eventStream
messages: Message,
messages: MessageStream,
}

@streaming
union MessageStream {
message: Message,
}

structure Message {
Expand Down Expand Up @@ -980,14 +984,21 @@ and HTTP bindings:
"type": "structure",
"members": {
"messages": {
"target": "smithy.example#Message",
"target": "smithy.example#MessageStream",
"traits": {
"smithy.api#httpPayload": true,
"smithy.api#eventStream": true
"smithy.api#httpPayload": true
}
}
}
},
"smithy.example#MessageStream": {
"type": "union",
"members": {
"message": {
"target": "smithy.example#Message"
}
}
},
"smithy.example#Message": {
"type": "structure",
"members": {
Expand All @@ -1000,7 +1011,7 @@ and HTTP bindings:
}

The following is **invalid** because the operation has the ``http`` trait
and an input member is marked with the ``eventStream`` trait but not
and an input member is marked with the ``streaming`` trait but not
marked with the ``httpPayload`` trait:

.. code-block:: smithy
Expand All @@ -1013,8 +1024,16 @@ marked with the ``httpPayload`` trait:
}

structure InvalidOperationInput {
@eventStream
invalid: Message, // <-- Missing the @httpPayload trait
invalid: MessageStream, // <-- Missing the @httpPayload trait
}

@streaming
union MessageStream {
message: Message,
}

structure Message {
message: String,
}


Expand Down
Loading