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

CanDeSerialize

Last update:
May 18, 2026

Description

ColdFusion will invoke this function before invoking the Deserialize function. 

Returns

Boolean. If true, the deserialize() function of the custom serializer will be called. If false, ColdFusion's default deserializer will be used for serialization.

Function syntax

boolean function canDeSerialize(type)

History

ColdFusion 11: Added this function. For more information see REST Enhancements in ColdFusion 11.

Parameters

Parameter
Description
type
Required. String. The type to which the data has to be deserialized.

Example

<cffunction access="remote" name="canDeSerialize" returntype="boolean">

<cfargument name="type" type="string"/>

<!--- If you need to deserialize only XML using the custom serializer. ---> 
<cfif #type# eq "XML">

<cfreturn true>

<cfelse>

<cfreturn false>

</cfif>

</cffunction>

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