parseJson
Full name: taxi.stdlib.parseJson
Signature
declare extension function <T> parseJson(source: String, type: Type<T>):TDescription
Parses a JSON string into the specified type.
This is useful when a field contains a JSON payload encoded as a string (e.g., from a message queue or API response), and you need to deserialize it into a structured type.
Computed fields and functions on the target type are evaluated after parsing.
model Event {
name : String
payload : String
parsed : Payload = parseJson(this.payload, Payload)
}Examples
Parses a JSON string embedded in a model field into a structured type.
Try it out
Schema
Query Plan
Play with this snippet by editing it here, or edit it on Taxi Playground
Result
Query failed