Support multi-signer multipart send_document requests - #1
Merged
Conversation
BoldSign's /v1/document/send accepts a signer per repeated same-named multipart part (confirmed against their docs), not a JSON array in one field and not Faraday's default bracket-suffixed array encoding. The gem previously only unwrapped the single-signer case and raised past one element. Sets flat_encode: true on the multipart connection and generalizes encode_multipart_value to map every array element to its own part instead of special-casing size == 1. Multi-file uploads are unrelated and still unsupported.
kleinjm
approved these changes
Jul 27, 2026
Version bump for the multi-signer send_document support in this PR. Repo transferred from kleinjm/boldsign-ruby to the EscrowSafe org -- updates the gemspec homepage, README badges/links, and CHANGELOG compare links to match. Adds .github/CODEOWNERS mirroring web's.
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.
Summary
send_document's multipart path (used wheneverfiles:is passed, i.e. uploading a fresh PDF rather than referencing an existing template) only ever unwrapped the single-signer/single-file case — a second signer insigners:raisedNotImplementedError. This adds support for sending 2+ signers (e.g. a sequential-order envelope) alongside an uploaded file.Confirmed against BoldSign's own docs that the correct multipart encoding for a multi-valued field is one part per element, all sharing the same field name (e.g. two
Signers=parts) — not a single field whose value is a JSON array, and not the bracket-suffixedSigners[]=form Faraday's multipart middleware emits by default for Array values (which BoldSign rejects, same as the existingFiles[]gotcha this gem already works around).What changed
Client#connectionnow passesflat_encode: truetoFaraday::Multipart::Middleware, which is what makes an Array value emit as repeated same-named parts instead ofkey[]=.Resources::Document#encode_multipart_valuenow maps every element of an Array value to its own JSON-encoded part, instead of special-casing (and raising past) the single-element case. Functionally identical output for today's single-signer callers —flat_encode+ a one-element Array produces the exact same single part as the old unwrap-and-raise-if-more logic (covered by the existing "sends a multipart request when files: is provided" spec, unchanged and still passing).NotImplementedError— out of scope here.Testing
signerOrder+enableSigningOrder: truealongside a file upload, asserting exactly 2signersparts with no[]suffix and no wrapping JSON array.Context
We're building a sequential 2-signer BoldSign envelope (an uploaded PDF, not a template) at EscrowSafe and hit this exact
NotImplementedError. Happy to adjust the approach if you'd prefer a different API shape (e.g. an explicitsigners:array vs. relying onflat_encodeglobally for all multipart Array values — I don't see another multipart caller in the gem today where that would change behavior, but flagging in case future callers expect bracket-style array semantics for something else).