Skip to content

Add parsers for common content types. - #1

Merged
samuel-williams-shopify merged 5 commits into
mainfrom
add-default-content-parsers
Aug 5, 2026
Merged

Add parsers for common content types.#1
samuel-williams-shopify merged 5 commits into
mainfrom
add-default-content-parsers

Conversation

@samuel-williams-shopify

@samuel-williams-shopify samuel-williams-shopify commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace the representation object with explicit Parser#parse(content_type, input) dispatch
  • add bounded JSON, URL-encoded form, and multipart form parsers
  • provide an explicitly required, frozen Protocol::Content::Parser.default registry
  • forward caller blocks for incremental parsing and streaming multipart uploads
  • translate format-specific parser limits into ContentTooLargeError while retaining the original cause
  • document parser usage in a dedicated Getting Started guide

Callers retain ownership of message metadata, body adaptation, consumption, and memoization. Parsers receive a readable IO-like input directly; multipart boundary extraction is handled by content-type dispatch. Multipart uploads remain explicitly streaming and do not impose tempfile semantics.

Verification

  • 22 tests, 31 assertions
  • 100% line coverage
  • RuboCop clean
  • Decode: 17/17 public definitions documented
  • tested with protocol-url 0.9.0 and protocol-multipart 0.5.0

@samuel-williams-shopify
samuel-williams-shopify force-pushed the add-default-content-parsers branch 21 times, most recently from 9affafc to 1532681 Compare August 5, 2026 05:24
Assisted-By: devx/e76b566a-41cd-407d-a2fd-c5b79c88879d
@samuel-williams-shopify
samuel-williams-shopify force-pushed the add-default-content-parsers branch from 1532681 to 0be4712 Compare August 5, 2026 05:37
Comment thread lib/protocol/content/json_parser.rb Outdated
@samuel-williams-shopify
samuel-williams-shopify merged commit 75c5cfd into main Aug 5, 2026
28 checks passed
@samuel-williams-shopify
samuel-williams-shopify deleted the add-default-content-parsers branch August 5, 2026 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant