Now, we make a call to `serializeRecord` as follows:
```d
JSONValue serialized = serializeRecord(p1);
```
This returns the following JSON:
```json
{
"age": 23,
"extraJSON": {
"item": 1,
"items": [
1,
2,
3
]
},
"firstname": "Tristan",
"lastname": "Kildaire",
"list": "[\"1\", \"2\", \"3\"]"
}
```
### Deserialization
Deserialization works by having your predefined struct type and then looking up those field names in the provided JSON. Therefore for this we will be using the following struct type:
```d
struct Person
{
public string firstname, lastname;
public int age;
public bool isMale;
public JSONValue obj;
}
```
Now, let's say we were given the following JSON:
```json
{
"firstname" : "Tristan",
"lastname": "Kildaire",
"age": 23,
"obj" : {"bruh":1},
"isMale": true,
}
```
We can then deserialize the JSON to our type `Person`, with the `fromJSON` method: