-
Notifications
You must be signed in to change notification settings - Fork 234
Closed
Labels
documentationThis is a problem with documentation.This is a problem with documentation.guidanceQuestion that needs advice or information.Question that needs advice or information.
Description
I gather from this test that optional streaming blob shapes are valid in Smithy. How are these to be interpreted regarding codegen and in HTTP-based protocols?
In my opinion, a strict interpretation of the spec would be:
- At codegen time, generate optional types for non-
required
blob streaming shapes (e.g.Option<ByteStream>
). - The HTTP RFC differentiates between HTTP messages with no body (no
Content-Length
orTransfer-Encoding
header) and HTTP messages with an empty body (Content-Length: 0
). Therefore, if no value is provided (None
in Rust) for an operation output member, no HTTP body should be sent.
Is this interpretation correct?
In any case, I think allowing for this distinction between no HTTP body and empty HTTP body is not worth having.
Some data points:
- Currently, the Rust client SDK disregards optional blob streaming shapes, instead interpreting them as if they were always
required
. - In the Java SDK, prior to SDK version 2.17.117, empty responses from lambda's invoke operation were exposed as an empty byte array. In 2.17.117, a behavior change was released to fix an unrelated bug. The behavior change had the unintentional effect of changing the empty byte array of the operation to be returned as
null
.
I think that allowing for the distinction will only be a source of bugs. I'd like the possibility of the spec being amended to always pair required
with streaming
(which is already coupled with httpPayload
) be considered.
Metadata
Metadata
Assignees
Labels
documentationThis is a problem with documentation.This is a problem with documentation.guidanceQuestion that needs advice or information.Question that needs advice or information.