# parseJson

Source: https://taxilang.org/docs/language/stdlib/parseJson

**Full name:** `taxi.stdlib.parseJson`

## Signature

```taxi
declare extension function <T> parseJson(source: String, type: Type<T>):T
```

## Description

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.

```taxi
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.

Schema:

```taxi
model Address {
   city: String
   country: String
}
model Customer {
   name: String
   addressJson: String
   address: Address = parseJson(this.addressJson, Address)
}
```

Query:

```taxi
given {
   customer: Customer = {
      name: 'Alice',
      addressJson: '{ "city": "London", "country": "UK" }'
   }
}
find {
   name: customer.name
   address: customer.address
}
```

Result:

```json
{
  "name": "Alice",
  "address": {
    "city": "London",
    "country": "UK"
  }
}
```
