• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / supabase-swift / 24999651953

27 Apr 2026 02:03PM UTC coverage: 81.408% (+0.3%) from 81.155%
24999651953

push

github

web-flow
feat(functions): support custom JSON encoder and decoder (#975)

* feat(functions): support custom JSON encoder and decoder

Previously, FunctionInvokeOptions always used a default JSONEncoder()
when encoding Encodable request bodies, with no way to customize
encoding strategies (e.g. snake_case keys, custom date formats).

This adds encoder/decoder parameters to:
- FunctionInvokeOptions body initializers
- FunctionsClient initializers
- SupabaseClientOptions.FunctionsOptions

The client-level decoder is also used as the default for the
invoke<T: Decodable> method, replacing the per-call JSONDecoder()
default.

Made-with: Cursor

* fix(functions): remove unused client-level encoder from FunctionsClient

The encoder stored on FunctionsClient was never used during request building
since body encoding happens inside FunctionInvokeOptions. Remove it and keep
only the decoder (which IS used in invoke<T: Decodable>). Per-call encoding
is still fully supported via FunctionInvokeOptions(body:encoder:).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore(functions): fix formatting in Types.swift

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Oleg Bezrukavnikov <obezrukavnikov@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

23 of 25 new or added lines in 4 files covered. (92.0%)

6 existing lines in 2 files now uncovered.

7216 of 8864 relevant lines covered (81.41%)

31.06 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

97.09
/Sources/Functions/FunctionsClient.swift


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc