Skip to content

Commit

Permalink
Clean up unecessary allOfs (matrix-org#1797)
Browse files Browse the repository at this point in the history
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
  • Loading branch information
zecakeh authored Apr 23, 2024
1 parent 1095179 commit 26ce392
Show file tree
Hide file tree
Showing 20 changed files with 32 additions and 77 deletions.
1 change: 1 addition & 0 deletions changelogs/internal/newsfragments/1797.clarification
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Clean up unnecessary `allOf`s in OpenAPI definitions.
25 changes: 5 additions & 20 deletions data/api/client-server/definitions/push_ruleset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,22 @@
properties:
content:
items:
allOf:
- $ref: push_rule.yaml
title: PushRule
type: object
$ref: push_rule.yaml
type: array
override:
items:
allOf:
- $ref: push_rule.yaml
title: PushRule
type: object
$ref: push_rule.yaml
type: array
room:
items:
allOf:
- $ref: push_rule.yaml
title: PushRule
type: object
$ref: push_rule.yaml
type: array
sender:
items:
allOf:
- $ref: push_rule.yaml
title: PushRule
type: object
$ref: push_rule.yaml
type: array
underride:
items:
allOf:
- $ref: push_rule.yaml
title: PushRule
type: object
$ref: push_rule.yaml
type: array
type: object
3 changes: 1 addition & 2 deletions data/api/client-server/definitions/room_key_backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ properties:
type: object
description: "A map of session IDs to key data."
additionalProperties:
allOf:
- $ref: "key_backup_data.yaml"
$ref: "key_backup_data.yaml"
example: {
"sessionid1": {
"first_message_index": 1,
Expand Down
8 changes: 2 additions & 6 deletions data/api/client-server/device_management.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ paths:
type: array
description: A list of all registered devices for this user.
items:
type: object
allOf:
- $ref: definitions/client_device.yaml
$ref: definitions/client_device.yaml
examples:
response:
value: {
Expand Down Expand Up @@ -75,9 +73,7 @@ paths:
content:
application/json:
schema:
type: object
allOf:
- $ref: definitions/client_device.yaml
$ref: definitions/client_device.yaml
examples:
response:
value: {
Expand Down
4 changes: 1 addition & 3 deletions data/api/client-server/filter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@ paths:
content:
application/json:
schema:
type: object
allOf:
- $ref: definitions/sync_filter.yaml
$ref: definitions/sync_filter.yaml
examples:
response:
value: {
Expand Down
6 changes: 2 additions & 4 deletions data/api/client-server/key_backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -841,8 +841,7 @@ paths:
type: object
description: A map of room IDs to room key backup data.
additionalProperties:
allOf:
- $ref: definitions/room_key_backup.yaml
$ref: definitions/room_key_backup.yaml
example:
"!room:example.org":
sessions:
Expand Down Expand Up @@ -946,8 +945,7 @@ paths:
type: object
description: A map of room IDs to room key backup data.
additionalProperties:
allOf:
- $ref: definitions/room_key_backup.yaml
$ref: definitions/room_key_backup.yaml
example:
"!room:example.org":
sessions:
Expand Down
9 changes: 3 additions & 6 deletions data/api/client-server/keys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ paths:
uploaded via `/keys/signatures/upload` that the requesting user
is allowed to see.
additionalProperties:
allOf:
- $ref: definitions/cross_signing_key.yaml
$ref: definitions/cross_signing_key.yaml
example:
"@alice:example.com":
user_id: "@alice:example.com"
Expand All @@ -244,8 +243,7 @@ paths:
information returned will be the same as uploaded via
`/keys/device_signing/upload`.
additionalProperties:
allOf:
- $ref: definitions/cross_signing_key.yaml
$ref: definitions/cross_signing_key.yaml
example:
"@alice:example.com":
user_id: "@alice:example.com"
Expand All @@ -265,8 +263,7 @@ paths:
information returned will be the same as uploaded via
`/keys/device_signing/upload`.
additionalProperties:
allOf:
- $ref: definitions/cross_signing_key.yaml
$ref: definitions/cross_signing_key.yaml
example:
"@alice:example.com":
user_id: "@alice:example.com"
Expand Down
4 changes: 1 addition & 3 deletions data/api/client-server/pushrules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,7 @@ paths:
rule to be applied to an event. A rule with no conditions
always matches. Only applicable to `underride` and `override` rules.
items:
type: object
allOf:
- $ref: definitions/push_condition.yaml
$ref: definitions/push_condition.yaml
pattern:
type: string
description: Only applicable to `content` rules. The glob-style pattern to match
Expand Down
12 changes: 4 additions & 8 deletions data/api/server-server/knocks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,7 @@ paths:
content:
application/json:
schema:
allOf:
- $ref: ../client-server/definitions/errors/error.yaml
$ref: ../client-server/definitions/errors/error.yaml
examples:
response:
value: {
Expand All @@ -186,8 +185,7 @@ paths:
content:
application/json:
schema:
allOf:
- $ref: ../client-server/definitions/errors/error.yaml
$ref: ../client-server/definitions/errors/error.yaml
examples:
response:
value: {
Expand Down Expand Up @@ -318,8 +316,7 @@ paths:
content:
application/json:
schema:
allOf:
- $ref: ../client-server/definitions/errors/error.yaml
$ref: ../client-server/definitions/errors/error.yaml
examples:
response:
value: {
Expand All @@ -333,8 +330,7 @@ paths:
content:
application/json:
schema:
allOf:
- $ref: ../client-server/definitions/errors/error.yaml
$ref: ../client-server/definitions/errors/error.yaml
examples:
response:
value: {
Expand Down
6 changes: 2 additions & 4 deletions data/api/server-server/user_keys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,7 @@ paths:
uploaded via `/keys/signatures/upload` that the user is
allowed to see.
additionalProperties:
allOf:
- $ref: ../client-server/definitions/cross_signing_key.yaml
$ref: ../client-server/definitions/cross_signing_key.yaml
example:
"@alice:example.com":
user_id: "@alice:example.com"
Expand All @@ -196,8 +195,7 @@ paths:
information returned will be the same as uploaded via
`/keys/device_signing/upload`.
additionalProperties:
allOf:
- $ref: ../client-server/definitions/cross_signing_key.yaml
$ref: ../client-server/definitions/cross_signing_key.yaml
example:
"@alice:example.com":
user_id: "@alice:example.com"
Expand Down
4 changes: 1 addition & 3 deletions data/event-schemas/schema/m.call.reject.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ allOf:
- "$ref": core-event-schema/room_event.yaml
properties:
content:
type: object
allOf:
- "$ref": core-event-schema/call_event.yaml
"$ref": core-event-schema/call_event.yaml
type:
type: string
enum:
Expand Down
3 changes: 1 addition & 2 deletions data/event-schemas/schema/m.key.verification.accept.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ properties:
ephemeral public key (encoded as unpadded base64) and the canonical JSON
representation of the `m.key.verification.start` message.
m.relates_to:
allOf:
- $ref: m.key.verification.m.relates_to.yaml
$ref: m.key.verification.m.relates_to.yaml
required:
- method
- key_agreement_protocol
Expand Down
3 changes: 1 addition & 2 deletions data/event-schemas/schema/m.key.verification.cancel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ properties:
respond again with `m.unexpected_message` to avoid the other device potentially
sending another error response.
m.relates_to:
allOf:
- $ref: m.key.verification.m.relates_to.yaml
$ref: m.key.verification.m.relates_to.yaml
required:
- code
- reason
Expand Down
3 changes: 1 addition & 2 deletions data/event-schemas/schema/m.key.verification.done.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ properties:
Required when sent as a to-device message. The opaque identifier for
the verification process/request.
m.relates_to:
allOf:
- $ref: m.key.verification.m.relates_to.yaml
$ref: m.key.verification.m.relates_to.yaml
type: object
type:
enum:
Expand Down
3 changes: 1 addition & 2 deletions data/event-schemas/schema/m.key.verification.key.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ properties:
description: |-
The device's ephemeral public key, encoded as unpadded base64.
m.relates_to:
allOf:
- $ref: m.key.verification.m.relates_to.yaml
$ref: m.key.verification.m.relates_to.yaml
required:
- key
type: object
Expand Down
3 changes: 1 addition & 2 deletions data/event-schemas/schema/m.key.verification.mac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ properties:
The MAC of the comma-separated, sorted, list of key IDs given in the `mac`
property, encoded as unpadded base64.
m.relates_to:
allOf:
- $ref: m.key.verification.m.relates_to.yaml
$ref: m.key.verification.m.relates_to.yaml
required:
- mac
- keys
Expand Down
3 changes: 1 addition & 2 deletions data/event-schemas/schema/m.key.verification.ready.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ properties:
items:
type: string
m.relates_to:
allOf:
- $ref: m.key.verification.m.relates_to.yaml
$ref: m.key.verification.m.relates_to.yaml
required:
- from_device
- methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ properties:
description: |-
The shared secret from the QR code, encoded using unpadded base64.
m.relates_to:
allOf:
- $ref: m.key.verification.m.relates_to.yaml
$ref: m.key.verification.m.relates_to.yaml
required:
- from_device
- method
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ properties:
type: string
enum: ["decimal", "emoji"]
m.relates_to:
allOf:
- $ref: m.key.verification.m.relates_to.yaml
$ref: m.key.verification.m.relates_to.yaml
required:
- from_device
- method
Expand Down
3 changes: 1 addition & 2 deletions data/event-schemas/schema/m.key.verification.start.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ properties:
when the `method` chosen only verifies one user's key. This field will
never be present if the `method` verifies keys both ways.
m.relates_to:
allOf:
- $ref: m.key.verification.m.relates_to.yaml
$ref: m.key.verification.m.relates_to.yaml
required:
- from_device
- method
Expand Down

0 comments on commit 26ce392

Please sign in to comment.