Skip to main content
jsonencode(val) serializes val to a JSON string. Maps become objects, lists become arrays, strings, numbers, and booleans are encoded as their JSON equivalents.

Signature

Example

Build a deployment metadata payload and pass it to an API endpoint:

Notes

  • The output is compact JSON (no extra spaces or newlines).
  • Map keys are sorted alphabetically in the output.
  • To parse a JSON string back to a value, use jsondecode.