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

DeserializeProtoBuf

Last update:
May 18, 2026

Description

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

deserializeProtoBuf(data, schema, messageType, queryFormat, useCustomSerialization, protoPath)

Parameters

ParameterRequiredDescription
dataYesA ColdFusion data value or variable that represents one.
schemaYesA protobuf schema. It can be given as plain string or filepath directly.
messageTypeYesA message type from given schema as string. this is optional If schema contains one and only one messagetype.
strictMappingNoThis parameter is of type string with possible values "row", "column", or "struct". The default value is "struct".
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, serialization will be done using the default ColdFusion behavior.
protoPathNospecifes a directory in which the compiler looks for imported files defined in the schema. By default, it will be the current schema's parent path.

Example

<cfscript>
    // define the data
    data = {
        "order_id": 32,
        "order_date": "09-09-2022",
        "order_amount": 345,
        "customer":{
            "customer_id":344,
            "customer_name":"Jack"
        }
    }
    protoSerRes = serializeProtoBuf(data,'Order.proto','Order','struct',false); 
    writedump(protoSerRes) 
    protoDeSerRes=deserializeProtoBuf(protoSerRes,'/protofiles/Orderr.proto','Order',false,false); 
    writeDump(protoDeSerRes) 
</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