Whatever message this page gives is out now! Go check it out!

DeserializeAVRO

Last update:
May 18, 2026

Description

Converts an Avro string data representation into CFML data, such as a CFML structure or array.

Returns

The data value in ColdFusion format: a structure, array, query, or simple value.

Syntax

deserializeAVRO(data, readerSchema, strictMapping, useCustomSerialization)

Parameters

ParameterRequiredDescription
dataYesA ColdFusion data value or variable that represents one.
readerSchemaYesSchema passed as a text string or absolute filepath.
strictMappingNo
A Boolean value that specifies whether to convert the AVRO strictly, as follows:
  • true: (Default) Convert the Avro binary to ColdFusion data type.
  • false: Determine if the binary data contains representation of a ColdFusion query, and if so,  deserialize the data into a query.
useCustomSerializationNoTrue/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.

Example

<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>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page