Don't use JSONPath. Use DataType instead, but even then with caution around null fields

If you use JSONPath, null will become "null". If you use DataType, null will become "".

This is because FlutterFlow casts null.toString(), even if expected value is nullable.
As for DataType, there's no nullable type, so "" is the default they have used.

Example mock api: https://0eqg4.wiremockapi.cloud/json/1

{
  "id": 1,
  "value": "things",
  "alwaysNull": null
}

Project to test this:
https://app.flutterflow.io/project/null-field-in-a-p-i-response-not-nullable-annooc

Test results:
https://nullvalues.flutterflow.app/

2
6 replies