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

OpenAPI compliance: avoid $ref siblings #1457

Merged
merged 2 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Wrap $ref in allOf where other attributes are present, to improve OpenAPI compliance.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Wrap $ref in allOf where other attributes are present, to improve OpenAPI compliance.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Wrap $ref in allOf where other attributes are present, to improve OpenAPI compliance.
41 changes: 21 additions & 20 deletions data/api/client-server/definitions/errors/rate_limited.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,24 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
$ref: error.yaml
type: object
title: RateLimitError
description: The rate limit was reached for this request
properties:
errcode:
type: string
description: The M_LIMIT_EXCEEDED error code
example: M_LIMIT_EXCEEDED
error:
type: string
description: A human-readable error message.
example: Too many requests
retry_after_ms:
type: integer
description: |-
The amount of time in milliseconds the client should wait
before trying the request again.
example: 2000
required: ["errcode"]
allOf:
- $ref: error.yaml
- type: object
title: RateLimitError
description: The rate limit was reached for this request
properties:
errcode:
type: string
description: The M_LIMIT_EXCEEDED error code
example: M_LIMIT_EXCEEDED
error:
type: string
description: A human-readable error message.
example: Too many requests
retry_after_ms:
type: integer
description: |-
The amount of time in milliseconds the client should wait
before trying the request again.
example: 2000
required: ["errcode"]
4 changes: 1 addition & 3 deletions data/api/client-server/definitions/event_batch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ properties:
events:
description: List of events.
items:
allOf:
- $ref: ../../../event-schemas/schema/core-event-schema/event.yaml
type: object
$ref: ../../../event-schemas/schema/core-event-schema/event.yaml
type: array
type: object
title: EventBatch
3 changes: 1 addition & 2 deletions data/api/client-server/definitions/push_rule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ properties:
conditions:
type: array
items:
allOf:
- $ref: push_condition.yaml
$ref: push_condition.yaml
description: |-
The conditions that must hold true for an event in order for a rule to be
applied to an event. A rule with no conditions always matches. Only
Expand Down
4 changes: 2 additions & 2 deletions data/api/client-server/notifications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ paths:
- object
- string
event:
type: object
title: Event
description: The Event object for the event that triggered the notification.
"$ref": "definitions/client_event_without_room_id.yaml"
allOf:
- "$ref": "definitions/client_event_without_room_id.yaml"
profile_tag:
type: string
description: The profile tag of the rule that matched this event.
Expand Down
3 changes: 2 additions & 1 deletion data/api/client-server/old_sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ paths:
type: object
title: "InviteEvent"
description: "The invite event if `membership` is `invite`"
$ref: "definitions/client_event.yaml"
allOf:
- $ref: "definitions/client_event.yaml"
messages:
type: object
title: PaginationChunk
Expand Down
4 changes: 2 additions & 2 deletions data/api/client-server/search.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ paths:
type: object
title: Event
description: The event that matched.
"$ref": "definitions/client_event.yaml"
allOf:
- "$ref": "definitions/client_event.yaml"
context:
type: object
title: Event Context
Expand Down Expand Up @@ -270,7 +271,6 @@ paths:
type: array
title: Room State
items:
type: object
"$ref": "definitions/client_event.yaml"
groups:
type: object
Expand Down
3 changes: 2 additions & 1 deletion data/api/identity/v2_associations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ paths:
The signatures of the verifying identity servers which show that the
association should be trusted, if you trust the verifying identity
services.
$ref: "../../schemas/server-signatures.yaml"
allOf:
- $ref: "../../schemas/server-signatures.yaml"
required:
- address
- medium
Expand Down
3 changes: 2 additions & 1 deletion data/api/identity/v2_invitation_signing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ paths:
signatures:
type: object
description: The signature of the mxid, sender, and token.
$ref: "../../schemas/server-signatures.yaml"
allOf:
- $ref: "../../schemas/server-signatures.yaml"
token:
type: string
description: The token for the invitation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ allOf:
description: |-
The updated identity keys (if any) for this device. May be absent if the
device has no E2E keys defined.
$ref: ../../../client-server/definitions/device_keys.yaml
allOf:
- $ref: ../../../client-server/definitions/device_keys.yaml
required:
- user_id
- device_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ allOf:
description: The user ID whose cross-signing keys have changed.
example: "@alice:example.com"
master_key:
type: object
$ref: ../../../client-server/definitions/cross_signing_key.yaml
allOf:
- $ref: ../../../client-server/definitions/cross_signing_key.yaml
example: {
"user_id": "@alice:example.com",
"usage": ["master"],
Expand All @@ -47,8 +47,8 @@ allOf:
}
}
self_signing_key:
type: object
$ref: ../../../client-server/definitions/cross_signing_key.yaml
allOf:
- $ref: ../../../client-server/definitions/cross_signing_key.yaml
example: {
"user_id": "@alice:example.com",
"usage": ["self_signing"],
Expand Down
3 changes: 2 additions & 1 deletion data/api/server-server/user_devices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ paths:
keys:
type: object
description: Identity keys for the device.
$ref: "../client-server/definitions/device_keys.yaml"
allOf:
- $ref: "../client-server/definitions/device_keys.yaml"
device_display_name:
type: string
description: Optional display name for the device.
Expand Down