Skip to content

Add parsers for common content types. - #1

Open
samuel-williams-shopify wants to merge 1 commit into
mainfrom
add-default-content-parsers
Open

Add parsers for common content types.#1
samuel-williams-shopify wants to merge 1 commit 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

  • add bounded JSON, URL-encoded form, and multipart form representation parsers
  • provide an explicitly required, frozen Protocol::Content::Parser.default registry
  • preserve custom result and incremental enumeration interfaces for form parsers
  • keep format libraries optional and load adapters only through their dedicated entry points
  • bound JSON documents to 2 MiB and 32 nesting levels by default using size_limit: and depth_limit:

The JSON limits can be disabled independently with nil. Multipart uploads remain explicitly streaming and require MultipartFormParser#each or a #parse block; the default does not impose tempfile semantics.

Depends on socketry/protocol-url#4 and socketry/protocol-multipart#6 being merged and released.

Verification

Tested locally against both sibling PR branches:

  • 34 tests, 51 assertions
  • 100% line coverage
  • RuboCop clean
  • Decode: 30/30 public definitions documented
  • gem package builds with only protocol-media as a runtime dependency

@samuel-williams-shopify
samuel-williams-shopify force-pushed the add-default-content-parsers branch 6 times, most recently from 4f09046 to 92cc44a Compare August 4, 2026 08:31
@samuel-williams-shopify
samuel-williams-shopify force-pushed the add-default-content-parsers branch from 92cc44a to a767a13 Compare August 4, 2026 08:36
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