diff --git a/subscriptions-api.md b/subscriptions-api.md index bcf15babd..cdd3d7f5a 100644 --- a/subscriptions-api.md +++ b/subscriptions-api.md @@ -277,9 +277,9 @@ Subscription: "[key]": [subscription manager specific value], * }, - "filter": { ? - "[dialect name]": [dialect specific object] ? - }, + "filters": [ ? + { "[dialect name]": [dialect specific object] } + + ], "sink": "[URI to where events are delivered]", "protocol": "[delivery protocol]", @@ -353,13 +353,12 @@ Each subscription is represented by an object that has the following properties: - Examples: - `{ "interval": 5 }` -##### filter -- Type: `Object` -- Description: A filter expression that evaluates to true or false and that - determines whether an instance of a CloudEvent will be delivered to the - subscription's sink. If a filter expression evaluates to false, the event - MUST NOT be sent to the sink. If the expression evaluates to ttue, the event - MUST be attempted to be delivered. Absence of a filter implies a value +##### filters +- Type: `Array of Objects` +- Description: An array of filter expressions that evaluates to true or false. + If any filter expression in the array evaluates to false, the event + MUST NOT be sent to the sink. If all the filter expressions in the array evaluates to true, the event + MUST be attempted to be delivered. Absence of a filter or empty array implies a value of true. Each filter dialect MUST have a name that is unique within the scope of the @@ -453,11 +452,9 @@ Below is an example JSON serialization of a subscription resource: "interval": 5 }, - "filter": { - "prefix": { - "type": "com.example." - } - }, + "filters": [ + { "prefix": { "type": "com.example." } } + ], "protocol": "HTTP", "protocolsettings": { @@ -610,11 +607,11 @@ settings. All other settings SHOULD be supported. Filters allow for subscriptions to specify that only a subset of events are to be delivered to the sink based on a set of criteria. The `filter` -property in a subscription is a filter expressions that evaluates to either +property in a subscription is a set of filter expressions, where each expression evaluates to either true or false for each event generated. -If any of the filter expressions evaluate to false, the event MUST NOT be -sent to the sink. If the filter expression evaluates to true, the event MUST be +If any of the filter expressions in the set evaluate to false, the event MUST NOT be +sent to the sink. If all the filter expressions in the set evaluate to true, the event MUST be attempted to be delivered. Each filter expression includes the specification of a `dialect` that