Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cesql optional #1228

Merged
merged 3 commits into from
Sep 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 26 additions & 15 deletions subscriptions/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -756,10 +756,12 @@ When encoded in JSON, a filter is encoded as follows:
{ "dialect URI-Reference" : { <dialect-specific-properties> } }
```

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
deissnerk marked this conversation as resolved.
Show resolved Hide resolved
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.
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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`
Expand 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.
Expand All @@ -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.
Expand All @@ -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:

Expand Down
Loading