-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
Add event_property_is and event_property_contains props to PushConditions #1673
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add missing properties for `event_property_is` and `event_property_contains` push conditions to `PushConditions` object. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,8 +23,8 @@ properties: | |
key: | ||
type: string | ||
description: |- | ||
Required for `event_match` conditions. The dot-separated field of the | ||
event to match. | ||
Required for `event_match`, `event_property_is` and `event_property_contains` | ||
conditions. The dot-separated field of the event to match. | ||
|
||
Required for `sender_notification_permission` conditions. The field in | ||
the power level event the user needs a minimum power level for. Fields | ||
|
@@ -43,5 +43,11 @@ properties: | |
optionally prefixed by one of, ==, <, >, >= or <=. A prefix of < matches | ||
rooms where the member count is strictly less than the given number and | ||
so forth. If no prefix is present, this parameter defaults to ==. | ||
value: | ||
type: ["string", "integer", "boolean", "null"] | ||
description: |- | ||
Required for `event_property_is` and `event_property_contains` conditions. | ||
A non-compound [canonical JSON](/appendices#canonical-json) value to match | ||
against. | ||
Comment on lines
+49
to
+51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the record: I don't find the wording "a non-compound canonical JSON value" particularly clear, but it does match the existing wording in the Conditions section, so let's go with it. |
||
required: | ||
- kind |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hrm. The spec displays this in a way that implies it should be an array. It looks like https://github.com/matrix-org/matrix-spec/blob/main/layouts/partials/openapi/render-object-table.html needs an update to handle this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait. According to https://swagger.io/docs/specification/data-models/data-types/, this is not valid. "
type
as a list is not valid in OpenAPI (even though it is valid in JSON Schema)".However, it is definitely a pattern we use elsewhere, such as here.
@KitsuneRal or @zecakeh, as people who know a lot more about OpenAPI than me: can you comment on this? Should we be updating the
render-object-table
to support multi-valuedtype
s? Or should we be usingoneOf
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was not valid in OpenAPI 3.0, it is valid in OpenAPI 3.1, which is fully compatible with JSON Schema.
From "Migrating from OpenAPI 3.0 to 3.1.0":
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha, thanks for the clarification; that's very helpful.
In that case I guess we should merge this and file a separate issue to fix the template.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#1675