Esc

to_json

procedureextensionsince 0.36.1Source
  • macOS: to_json works on macOS
  • Linux: to_json works on Linux
  • Windows: to_json works on Windows
  • Wasm: to_json works on Wasm

The proto3 JSON of a generated message, allocated with context.allocator. Fails with .BAD_VALUE for a value JSON can't express (a Timestamp out of range, a NaN in a Value) and .UNKNOWN_TYPE for an Any whose type isn't in options.registry.

Signature

to_json :: (value: $T, options := Json_Options.{}) -> (string, Error)

See also