This change creates a big problem (at least for dart cloud functions): https://github.com/appwrite/appwrite/pull/6317
Change is here: https://github.com/open-runtimes/open-runtimes/blob/2a069cf9bec98e18a096633b5848cde12b4fe319/runtime
By assuming that the body HAS to be json parseable, all cloud functions will throw an error if the request is not json.
So everyone who has existing functions that accept string request bodies or anything not json parsable (or anyone who wants to in the future) can no longer do that.
All changes to make this work going forward require not only backend refactors, but frontend changes too.
It would be really nice if cloud functions stop assuming things like this. The recent big change helped reduce these assumptions by a lot, but this is still an issue.
Opened an issue: https://github.com/appwrite/appwrite/issues/6462
this only applies to functions triggered by event...which in those cases, the body should always be JSON
aahh -- make sense
I thought I was getting this error though not in that situation. I'll triple check and report back.
are you getting a parse error from a user event?
It's not through an error. Thanks for the help. context.req.body is giving me a string, so I'm not sure what to expect. Will body be parsed / not parsed depending on what triggered the execution?
Body will only be parsed as JSON if the content type header is application/json
ahh gotcha -- that makes more sense.
[SOLVED] v1.4.4 Functions Body Parsed / Not Parsed
Recommended threads
- [v1.8.1] Getting error "(role: applicati...
... but that scope doesn't exist. I am trying to get a function to run and modify tables in the database dynamically. I set everything up and eventually got: ...
- Scheduled function silently stopped firi...
Function is scheduled `* * * * *` and is `enabled: true`, but Appwrite Cloud has stopped queueing executions. Last execution: **2026-05-30 00:47 UTC** (~46h...
- Unable to create Sites or Functions with...
Heya, I was looking at the appwrite documentation for Sites API with the server api: https://appwrite.io/docs/references/cloud/server-nodejs/sites I can’t fin...