Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

sp adaptive card extension base.baseadaptivecardextension.onafterdeserialize

John Nguyen edited this page Apr 22, 2021 · 2 revisions

Home > @microsoft/sp-adaptive-card-extension-base > BaseAdaptiveCardExtension > onAfterDeserialize

BaseAdaptiveCardExtension.onAfterDeserialize() method

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Lifecycle method called before the property bag is populated with the deserialized property object.

Signature:

/** @virtual */
protected onAfterDeserialize(deserializedProperties: any, dataVersion: Version): TProperties;

Parameters

Parameter Type Description
deserializedProperties any The object deserialized from the stored data. Note that the schema of this object is not necessarily consistent with the current property bag, because the serialization could have been done by an older version of the Adaptive Card Extension
dataVersion Version The data version of the stored data being deserialized. You can use this value to determine if the data was serialized by an older Adaptive Card Extension. Adaptive Card Extensions can define their data version by overriding the dataVersion property.

Returns:

TProperties

The property bag of the Adaptive Card Extension

Remarks

The default implementation is a no-op. An Adaptive Card Extension developer can override this API if the deserialized object does not fully reflect the initial state of the property bag. This gives the Adaptive Card Extension developer a chance to populate the property bag right after the data is deserialized to an object.

An important scenario to use deserialize is upgrading. An upgraded Adaptive Card Extension may load the data that was serialized by an older version of the Adaptive Card Extension that supported a different schema of the property bag, resulting the deserialized object to be incosistent with the current schema of the property bag. The developer can use onAfterDeserialize to check the dataVersion and fix the property bag.

Clone this wiki locally