-
Notifications
You must be signed in to change notification settings - Fork 219
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
Questions on codegen and HTTP behavior for optional streaming shapes #1179
Comments
Actually, the issue still applies with a non- In restJson1 it's impossible to make the distinction, because server implementations should always respond with a JSON object, even if the output parameters are empty. There's a test checking that that also puzzled me in #1068. |
This is only in the case of requests. Today I learnt that for responses, things get more complicated:
|
This was addressed in the case of streaming blob shapes in IDL v2 (https://smithy.io/2.0/guides/model-translations/migrating-idl-1-to-2.html#add-the-default-trait-to-streaming-blobs) by forcing the user to add |
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:
required
blob streaming shapes (e.g.Option<ByteStream>
).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:
required
.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
withstreaming
(which is already coupled withhttpPayload
) be considered.The text was updated successfully, but these errors were encountered: