Whatever message this page gives is out now! Go check it out!
deserializeAVRO(data, readerSchema, strictMapping, useCustomSerialization)| Parameter | Required | Description |
| data | Yes | A ColdFusion data value or variable that represents one. |
| readerSchema | Yes | Schema passed as a text string or absolute filepath. |
| strictMapping | No | A Boolean value that specifies whether to convert the AVRO strictly, as follows:
|
| useCustomSerialization | No | True/false. Whether to use the customSerializer or not. The default value is true. Note that the custom serialize will always be used for serialization. If false, the Avro serialization will be done using the default ColdFusion behavior. |
<cfscript>
// define the Avro schema
mySchema= '{
"namespace": "first.example",
"type": "record",
"name": "User",
"fields": [
{"name": "name", "type": "string"},
{"name": "favorite_number", "type": ["int"]},
{"name": "favorite_color", "type": ["string"]}
]
}'
// set the data that conforms the schema above
data= {
"name":"Jack Sparrow",
"favorite_number":{"int":9},
"favorite_color":{"string":"red"}
}
avroSerializeResponse = serializeAVRO(data, mySchema)
writedump(avroSerializeResponse)
avroDeSerializeResponse = deSerializeAVRO(avroSerializeResponse, mySchema, true, false)
writedump(avroDeSerializeResponse)
</cfscript>