escapeJson
JSON Stringifies a Record, Array or simple field (e.g. String), using the UTF-8 character set. For example, given a schema such as:
{
"type": "record",
"name": "events",
"fields": [{
"name": "person",
"type": "record",
"fields": [
{ "name": "name", "type": "string" },
{ "name": "age", "type": "int" }
]
}]
}
and a record such as:
{
"person": {
"name" : "John",
"age" : 30
}
}
The following record path expression would convert the record into an escaped JSON String:
|
RecordPath |
Return value |
|
|
"{\"person\":{\"name\":\"John\",\"age\":30}}" |
|
|
"\"John\"" |
|
|
"30" |
