diff --git a/subscriptions/spec.md b/subscriptions/spec.md index 1b9b4e49f..41162d5a2 100644 --- a/subscriptions/spec.md +++ b/subscriptions/spec.md @@ -756,10 +756,12 @@ When encoded in JSON, a filter is encoded as follows: { "dialect URI-Reference" : { } } ``` -This specification defines the following 7 filter dialects that all -implementations MUST support: +###### 3.2.4.1.1 REQUIRED Filter Dialects -###### `exact` filter dialect +This specification defines the following 6 filter dialects that MUST be +supported by every implementation: + +**`exact`** The keys are the names of the CloudEvents attributes to be matched, and their values are the String values to use in the comparison. @@ -775,7 +777,7 @@ For example: { "exact": { "type": "com.github.push", "subject": "https://github.com/cloudevents/spec" } } ``` -###### `prefix` filter dialect +**`prefix`** The keys are the names of the CloudEvents attributes to be matched, and their values are the String values to use in the comparison. @@ -791,7 +793,7 @@ For example: { "prefix": { "type": "com.github.", "subject": "https://github.com/cloudevents" } } ``` -###### `suffix` filter dialect +**`suffix`** The keys are the names of the CloudEvents attributes to be matched, and their values are the String values to use in the comparison. @@ -807,7 +809,7 @@ For example: { "suffix": { "type": ".created", "subject": "/cloudevents/spec" } } ``` -###### `all` filter dialect +**`all`** Use of this MUST include a nested array of filter expressions, where all nested filter expressions MUST evaluate to true in order for the `all` @@ -826,10 +828,10 @@ For example: } ``` -###### `any` filter dialect +**`any`** -Use of this MUST include one nested array of filter expressions, where at least -one nested filter expressions MUST evaluate to true in order for the `any` +Use of this MUST include one nested array of filter expressions, where at +least one nested filter expressions MUST evaluate to true in order for the `any` filter expression to be true. Note: there MUST be at least one filter expression in the array. @@ -845,9 +847,10 @@ For example: } ``` -###### `not` filter dialect +**`not`** -Use of this MUST include one nested filter expression, where the result of this +Use of this MUST include one nested filter expression, where the result of +this filter expression is the inverse of the result of the nested expression. In other words, if the nested expression evaluated to true, then the `not` filter expression's result is false. @@ -860,14 +863,22 @@ For example: } ``` -###### `sql` filter dialect +###### 3.2.4.1.2 OPTIONAL Filter Dialects + +The support of the following dialects are OPTIONAL for implementations of +this specification: + +**`sql`** -Use of this MUST have a string value, representing a [CloudEvents SQL Expression](../cesql/spec.md). -The filter result MUST be true if the result value of the expression, coerced to boolean, equals to the `TRUE` boolean value, +Use of this MUST have a string value, representing a [CloudEvents SQL +Expression](../cesql/spec.md). +The filter result MUST be true if the result value of the expression, +coerced to boolean, equals to the `TRUE` boolean value, otherwise MUST be false if an error occurred while evaluating the expression or if the result value, coerced to boolean, equals to the `FALSE` boolean value. -Implementations SHOULD reject subscriptions with invalid CloudEvents SQL expressions. +Implementations SHOULD reject subscriptions with invalid CloudEvents SQL +expressions. For example: