omit absent option headers, compose header_out on every body kind, bind multipart parts - #289
Merged
Merged
Conversation
…nd multipart parts
Three changes on one seam. An Option header_in bound to None now
omits the header on every generated client - the http dispatcher
already read absence as null, so the round trip agrees; the amqp
channel never shared the defect and a test pins that. header_out
composes onto bytes and streamed answers alike: the success tuple
carries the body pair or the streamed answer first, then one element
per declared header, and both directions of both clients read them
back. A multipart request body binds scalar fields by wire key and
claims file parts with part("name" = parameter), decoding before
validation, refusing a part naming no field, an unbound required
part, and multipart on a bodyless method.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three changes on the header/body emission seam.
Absent option headers. An
Optionheader_inbound toNoneomits the header on every generated client (Rust, TypeScript, Dart — the last two sentundefined-ish junk of their own); the dispatcher already read absence as JSONnull, so both directions agree. The AMQP channel never shared the defect (full JSON round trip) — pinned by a test.header_out on every body kind. The success tuple composes: body pair or
StreamedAnswerfirst, then one element per declared header in declaration order —(Vec<u8>, String, ...),(StreamedAnswer, ...)— written and read back on both directions of both clients. The old stream-refusal is gone; an arity mismatch refuses instead. TypeScript also gained its missingbody = "bytes"support outright, required for string-level coverage of the composed shape.Multipart.
http(body = "multipart"): scalar fields bind by wire key, file parts are claimed withpart("name" = parameter)and arrive as the streaming seam's body handles, decoded before validation. Refusals (spanned, compile_fail): multipart on a bodyless method, a part naming no field, an unbound required part.Gate:
just lint,just test-named-features, all-features clippy, andcargo test --all-featuresall green (62 binaries, 0 failed).