Skip to content

Questions on codegen and HTTP behavior for optional streaming shapes #1179

@david-perez

Description

@david-perez

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 or Transfer-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:

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

No one assigned

    Labels

    documentationThis is a problem with documentation.guidanceQuestion that needs advice or information.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions