Skip to main content

value_to_json

Function value_to_json 

Source
pub fn value_to_json(v: Value) -> Result<Value>
Expand description

Convert a surrealdb::types::Value to a standard serde_json::Value.

surrealdb_types::Value implements Serialize but uses enum-variant JSON: {"Object": {"name": {"String": "Server"}, ...}}, {"Array": [...]}, "Null". This function recursively unwraps those variants into flat standard JSON. Convert a SurrealDB value into a JSON value. Public so the live-bus can reuse the same serialization path used by every other persistence method.