Skip to content

feat(codecs): add xml codec and opt-in toon codec factory#160

Merged
filipeforattini merged 1 commit into
mainfrom
feat/xml-toon-codecs
Jul 2, 2026
Merged

feat(codecs): add xml codec and opt-in toon codec factory#160
filipeforattini merged 1 commit into
mainfrom
feat/xml-toon-codecs

Conversation

@filipeforattini

Copy link
Copy Markdown
Member

Summary

  • Adds xmlCodec (zero dependencies) to defaultCodecs so Accept/Content-Type negotiation supports XML out of the box across every adapter that already uses this system (adapters/http.ts, rest-middleware.ts, graphql/adapter.ts, jsonrpc.ts).
  • Adds createToonCodec(toon), an opt-in factory for TOON (Token-Oriented Object Notation), following the same dependency-injection pattern used by the zod/yup/joi validation adapters — raffel never imports @toon-format/toon directly, the caller passes it in.
  • Adds @toon-format/toon as an optional peer dependency (and dev dependency for tests).
  • Adds MimeTypes.TOON for consistency with the existing MimeTypes.XML/MimeTypes.CSV.

Test plan

  • npx tsc / npx tsc -p tsconfig.ui.json clean
  • Unit suite: 1312 tests passing (vitest.config.unit.ts)
  • Integration suite: 2110 tests passing (vitest.config.int.ts)
  • Updated two integration tests that previously used application/xml as a stand-in for "unsupported content type" (now genuinely supported) to use application/pdf instead

Adds xmlCodec to defaultCodecs so Accept/Content-Type negotiation
supports XML out of the box across all adapters (http, rest, graphql,
jsonrpc). Adds createToonCodec(), an opt-in factory that wires up
@toon-format/toon without raffel depending on it directly, following
the same injection pattern as the zod/yup/joi validation adapters.
@filipeforattini
filipeforattini merged commit 490e61f into main Jul 2, 2026
10 checks passed
@filipeforattini
filipeforattini deleted the feat/xml-toon-codecs branch July 2, 2026 18:25
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