Skip to content

fix(functions): only accept json values in a mapping or sequence invoke body - #2191

Merged
spydon merged 1 commit into
mainfrom
lukasklingsbo/sdk-3364-functions-only-accept-json-values-in
Dec 4, 2026
Merged

spydon merged 1 commit into
mainfrom
lukasklingsbo/sdk-3364-functions-only-accept-json-values-in

Conversation

@spydon

@spydon spydon commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #2182. SDK-3364.

  • invoke() and invoke_stream() type a mapping or sequence body as JSON values again, so a date or UUID in a dict is a type error instead of being serialized at run time.
  • Pydantic models, memoryview and Response.json() stay.
  • The taskboard example sends due_on.isoformat() again.

…ke body

A date, datetime or UUID in a dict body is a type error again instead of being serialized at run time. Pydantic models are still sent as model_dump_json() serializes them. SDK-3364.
@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes

    • Task due dates are now sent to Edge Functions in ISO-formatted strings, while missing due dates remain empty.
  • Documentation

    • Clarified that mappings and sequences are sent as JSON, while Pydantic models use their JSON serialization.

The invoke-body type now uses JSON for mapping values and sequence elements. Documentation distinguishes mapping and sequence JSON bodies from Pydantic models serialized with model_dump_json(). Async and sync tests cover model and JSON-compatible mapping and sequence bodies. The taskboard digest request converts non-null due dates to ISO strings and preserves missing dates as None.

Possibly related PRs

Change: Bug fix

Merge Risk: Minimal · up to 60fdc

This change restores stricter JSON typing for invoke bodies and updates the docs, tests, and taskboard example to match. It is a typing and documentation change with no runtime serialization change, and no merge-blocking risk was found.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8bd34bdd-9cd1-4cb2-91db-a768f949e66f
Commits

Reviewing files that changed from the base of the PR and between 5ec655e and 60fdc25.

Files selected for processing: 6

  • examples/taskboard/src/taskboard/board.py
  • src/functions/README.md
  • src/functions/src/supabase_functions/client.py
  • src/functions/src/supabase_functions/utils.py
  • src/functions/tests/_async/test_function_client.py
  • src/functions/tests/_sync/test_function_client.py

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@spydon
spydon merged commit 02193d9 into main Dec 4, 2026
29 checks passed
@spydon
spydon deleted the lukasklingsbo/sdk-3364-functions-only-accept-json-values-in branch December 4, 2026 13:16
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