OpenAPI compliance: avoid $ref siblings (#1457)

This strives to fix all remaining cases where additional attributes
(most often 'description' but not only) are provided next to $ref
by wrapping $ref in allOf; and also drops allOf in a couple of places
where $ref is the only element under it.
pull/1462/head
Alexey Rusakov 2 years ago committed by GitHub
parent 10844fef8c
commit 9ebcf5f257
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1 @@
Wrap $ref in allOf where other attributes are present, to improve OpenAPI compliance.

@ -0,0 +1 @@
Wrap $ref in allOf where other attributes are present, to improve OpenAPI compliance.

@ -0,0 +1 @@
Wrap $ref in allOf where other attributes are present, to improve OpenAPI compliance.

@ -11,11 +11,12 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
$ref: error.yaml allOf:
type: object - $ref: error.yaml
title: RateLimitError - type: object
description: The rate limit was reached for this request title: RateLimitError
properties: description: The rate limit was reached for this request
properties:
errcode: errcode:
type: string type: string
description: The M_LIMIT_EXCEEDED error code description: The M_LIMIT_EXCEEDED error code
@ -30,4 +31,4 @@ properties:
The amount of time in milliseconds the client should wait The amount of time in milliseconds the client should wait
before trying the request again. before trying the request again.
example: 2000 example: 2000
required: ["errcode"] required: ["errcode"]

@ -16,9 +16,7 @@ properties:
events: events:
description: List of events. description: List of events.
items: items:
allOf: $ref: ../../../event-schemas/schema/core-event-schema/event.yaml
- $ref: ../../../event-schemas/schema/core-event-schema/event.yaml
type: object
type: array type: array
type: object type: object
title: EventBatch title: EventBatch

@ -38,8 +38,7 @@ properties:
conditions: conditions:
type: array type: array
items: items:
allOf: $ref: push_condition.yaml
- $ref: push_condition.yaml
description: |- description: |-
The conditions that must hold true for an event in order for a rule to be 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 applied to an event. A rule with no conditions always matches. Only

@ -109,10 +109,10 @@ paths:
- object - object
- string - string
event: event:
type: object
title: Event title: Event
description: The Event object for the event that triggered the notification. 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: profile_tag:
type: string type: string
description: The profile tag of the rule that matched this event. description: The profile tag of the rule that matched this event.

@ -221,7 +221,8 @@ paths:
type: object type: object
title: "InviteEvent" title: "InviteEvent"
description: "The invite event if `membership` is `invite`" description: "The invite event if `membership` is `invite`"
$ref: "definitions/client_event.yaml" allOf:
- $ref: "definitions/client_event.yaml"
messages: messages:
type: object type: object
title: PaginationChunk title: PaginationChunk

@ -204,7 +204,8 @@ paths:
type: object type: object
title: Event title: Event
description: The event that matched. description: The event that matched.
"$ref": "definitions/client_event.yaml" allOf:
- "$ref": "definitions/client_event.yaml"
context: context:
type: object type: object
title: Event Context title: Event Context
@ -270,7 +271,6 @@ paths:
type: array type: array
title: Room State title: Room State
items: items:
type: object
"$ref": "definitions/client_event.yaml" "$ref": "definitions/client_event.yaml"
groups: groups:
type: object type: object

@ -191,7 +191,8 @@ paths:
The signatures of the verifying identity servers which show that the The signatures of the verifying identity servers which show that the
association should be trusted, if you trust the verifying identity association should be trusted, if you trust the verifying identity
services. services.
$ref: "../../schemas/server-signatures.yaml" allOf:
- $ref: "../../schemas/server-signatures.yaml"
required: required:
- address - address
- medium - medium

@ -74,7 +74,8 @@ paths:
signatures: signatures:
type: object type: object
description: The signature of the mxid, sender, and token. description: The signature of the mxid, sender, and token.
$ref: "../../schemas/server-signatures.yaml" allOf:
- $ref: "../../schemas/server-signatures.yaml"
token: token:
type: string type: string
description: The token for the invitation. description: The token for the invitation.

@ -85,7 +85,8 @@ allOf:
description: |- description: |-
The updated identity keys (if any) for this device. May be absent if the The updated identity keys (if any) for this device. May be absent if the
device has no E2E keys defined. device has no E2E keys defined.
$ref: ../../../client-server/definitions/device_keys.yaml allOf:
- $ref: ../../../client-server/definitions/device_keys.yaml
required: required:
- user_id - user_id
- device_id - device_id

@ -37,8 +37,8 @@ allOf:
description: The user ID whose cross-signing keys have changed. description: The user ID whose cross-signing keys have changed.
example: "@alice:example.com" example: "@alice:example.com"
master_key: master_key:
type: object allOf:
$ref: ../../../client-server/definitions/cross_signing_key.yaml - $ref: ../../../client-server/definitions/cross_signing_key.yaml
example: { example: {
"user_id": "@alice:example.com", "user_id": "@alice:example.com",
"usage": ["master"], "usage": ["master"],
@ -47,8 +47,8 @@ allOf:
} }
} }
self_signing_key: self_signing_key:
type: object allOf:
$ref: ../../../client-server/definitions/cross_signing_key.yaml - $ref: ../../../client-server/definitions/cross_signing_key.yaml
example: { example: {
"user_id": "@alice:example.com", "user_id": "@alice:example.com",
"usage": ["self_signing"], "usage": ["self_signing"],

@ -76,7 +76,8 @@ paths:
keys: keys:
type: object type: object
description: Identity keys for the device. description: Identity keys for the device.
$ref: "../client-server/definitions/device_keys.yaml" allOf:
- $ref: "../client-server/definitions/device_keys.yaml"
device_display_name: device_display_name:
type: string type: string
description: Optional display name for the device. description: Optional display name for the device.

Loading…
Cancel
Save