Skip to content

Commit

Permalink
Merge pull request #365 from JordonPhillips/merge-streaming
Browse files Browse the repository at this point in the history
Collapse eventstream with the streaming trait
  • Loading branch information
JordonPhillips authored Apr 10, 2020
2 parents aec70e9 + 2605ffc commit 6c81c9b
Show file tree
Hide file tree
Showing 37 changed files with 546 additions and 863 deletions.
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

0 comments on commit 6c81c9b

Please sign in to comment.