From 2121348953198760e02b58f6747995d7830dbffd Mon Sep 17 00:00:00 2001 From: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com> Date: Mon, 14 Sep 2026 13:47:07 +0200 Subject: [PATCH 1/3] Fix deserialization of Websocket received Notifications --- openapi/components/schemas/Notification.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/openapi/components/schemas/Notification.yaml b/openapi/components/schemas/Notification.yaml index 4637ed91..9847a5a8 100644 --- a/openapi/components/schemas/Notification.yaml +++ b/openapi/components/schemas/Notification.yaml @@ -6,7 +6,20 @@ properties: type: string format: date-time details: - type: string + x-if: + when: jsonschema + then: + oneOf: + - type: string + - $ref: ./NotificationDetailBoop.yaml + - $ref: ./NotificationDetailBoop.yaml + - $ref: ./NotificationDetailInvite.yaml + - $ref: ./NotificationDetailInviteResponse.yaml + - $ref: ./NotificationDetailRequestInvite.yaml + - $ref: ./NotificationDetailRequestInviteResponse.yaml + - $ref: ./NotificationDetailVoteToKick.yaml + else: + type: string description: "**NOTICE:** This is not a JSON object when received from the REST API, but it is when received from the Websocket API. When received from the REST API, this is a json **encoded** object, meaning you have to json-de-encode to get the NotificationDetail object depending on the NotificationType." default: "{}" example: "OneOf: {}, NotificationDetailBoop, NotificationDetailInvite, NotificationDetailInviteResponse, NotificationDetailRequestInvite, NotificationDetailRequestInviteResponse, NotificationDetailVoteToKick" From 65266821d190cbf9b7206f0b03b13ded8dd4ad97 Mon Sep 17 00:00:00 2001 From: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com> Date: Mon, 14 Sep 2026 13:52:48 +0200 Subject: [PATCH 2/3] Make linter happy? --- openapi/components/schemas/Notification.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/openapi/components/schemas/Notification.yaml b/openapi/components/schemas/Notification.yaml index 9847a5a8..c5232008 100644 --- a/openapi/components/schemas/Notification.yaml +++ b/openapi/components/schemas/Notification.yaml @@ -6,13 +6,15 @@ properties: type: string format: date-time details: + description: "**NOTICE:** This is not a JSON object when received from the REST API, but it is when received from the Websocket API. When received from the REST API, this is a json **encoded** object, meaning you have to json-de-encode to get the NotificationDetail object depending on the NotificationType." + default: "{}" + example: "OneOf: {}, NotificationDetailBoop, NotificationDetailInvite, NotificationDetailInviteResponse, NotificationDetailRequestInvite, NotificationDetailRequestInviteResponse, NotificationDetailVoteToKick" x-if: when: jsonschema then: oneOf: - type: string - $ref: ./NotificationDetailBoop.yaml - - $ref: ./NotificationDetailBoop.yaml - $ref: ./NotificationDetailInvite.yaml - $ref: ./NotificationDetailInviteResponse.yaml - $ref: ./NotificationDetailRequestInvite.yaml @@ -20,9 +22,6 @@ properties: - $ref: ./NotificationDetailVoteToKick.yaml else: type: string - description: "**NOTICE:** This is not a JSON object when received from the REST API, but it is when received from the Websocket API. When received from the REST API, this is a json **encoded** object, meaning you have to json-de-encode to get the NotificationDetail object depending on the NotificationType." - default: "{}" - example: "OneOf: {}, NotificationDetailBoop, NotificationDetailInvite, NotificationDetailInviteResponse, NotificationDetailRequestInvite, NotificationDetailRequestInviteResponse, NotificationDetailVoteToKick" id: type: string minLength: 1 From 141b8955faa7ff48f5859d8657a97854f0815180 Mon Sep 17 00:00:00 2001 From: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com> Date: Mon, 14 Sep 2026 14:10:38 +0200 Subject: [PATCH 3/3] Gate default and example behind the `x-if` --- openapi/components/schemas/Notification.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openapi/components/schemas/Notification.yaml b/openapi/components/schemas/Notification.yaml index c5232008..a07d0a59 100644 --- a/openapi/components/schemas/Notification.yaml +++ b/openapi/components/schemas/Notification.yaml @@ -7,8 +7,6 @@ properties: format: date-time details: description: "**NOTICE:** This is not a JSON object when received from the REST API, but it is when received from the Websocket API. When received from the REST API, this is a json **encoded** object, meaning you have to json-de-encode to get the NotificationDetail object depending on the NotificationType." - default: "{}" - example: "OneOf: {}, NotificationDetailBoop, NotificationDetailInvite, NotificationDetailInviteResponse, NotificationDetailRequestInvite, NotificationDetailRequestInviteResponse, NotificationDetailVoteToKick" x-if: when: jsonschema then: @@ -22,6 +20,8 @@ properties: - $ref: ./NotificationDetailVoteToKick.yaml else: type: string + default: "{}" + example: "OneOf: {}, NotificationDetailBoop, NotificationDetailInvite, NotificationDetailInviteResponse, NotificationDetailRequestInvite, NotificationDetailRequestInviteResponse, NotificationDetailVoteToKick" id: type: string minLength: 1