Aracılığıyla paylaş


CloudEvent.Parse(BinaryData, Boolean) Method

Definition

Given a single JSON-encoded event, parses the event envelope and returns a CloudEvent. If the specified event is not valid JSON an exception is thrown. By default, if the event is missing required properties, an exception is thrown though this can be relaxed by setting the skipValidation parameter.

public static Azure.Messaging.CloudEvent? Parse (BinaryData json, bool skipValidation = false);
static member Parse : BinaryData * bool -> Azure.Messaging.CloudEvent
Public Shared Function Parse (json As BinaryData, Optional skipValidation As Boolean = false) As CloudEvent

Parameters

json
BinaryData

An instance of BinaryData containing the JSON for the CloudEvent.

skipValidation
Boolean

Set to true to allow missing or invalid properties to still parse into a CloudEvent. In particular, by setting strict to true, the source, id, specversion and type properties are no longer required to be present in the JSON. Additionally, the casing requirements of the extension attribute names are relaxed.

Returns

A CloudEvent.

Exceptions

json contained multiple events. ParseMany(BinaryData, Boolean) should be used instead.

Applies to