From 1dcb8c2f2917c45efb10ffb9ecda69f4f4dff481 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 30 Jan 2023 11:48:01 -0500 Subject: [PATCH] fix: final schema changes --- .../schemas/NotificationFilters.yaml | 23 ++++++++ .../components/schemas/UserObject.yaml | 50 +++++++++++++++++ public/openapi/read/notifications.yaml | 31 ++--------- public/openapi/read/user/userslug/info.yaml | 54 +------------------ 4 files changed, 79 insertions(+), 79 deletions(-) create mode 100644 public/openapi/components/schemas/NotificationFilters.yaml diff --git a/public/openapi/components/schemas/NotificationFilters.yaml b/public/openapi/components/schemas/NotificationFilters.yaml new file mode 100644 index 0000000000..03eae4325d --- /dev/null +++ b/public/openapi/components/schemas/NotificationFilters.yaml @@ -0,0 +1,23 @@ +FiltersObject: + type: object + properties: + name: + type: string + filter: + type: string + selected: + type: boolean + count: + type: number + required: + - name + - filter +FiltersArray: + type: array + items: + anyOf: + - $ref: '#/FiltersObject' + - type: object + properties: + separator: + type: boolean \ No newline at end of file diff --git a/public/openapi/components/schemas/UserObject.yaml b/public/openapi/components/schemas/UserObject.yaml index 828f704e6d..3b40834f73 100644 --- a/public/openapi/components/schemas/UserObject.yaml +++ b/public/openapi/components/schemas/UserObject.yaml @@ -700,3 +700,53 @@ UserObjectACP: nullable: true ips: type: array +BanMuteArray: + type: array + items: + type: object + properties: + uid: + type: number + timestamp: + type: number + expire: + type: number + fromUid: + type: number + user: + type: object + properties: + username: + type: string + description: A friendly name for a given user account + userslug: + type: string + description: An URL-safe variant of the username (i.e. lower-cased, spaces + removed, etc.) + picture: + type: string + uid: + type: number + description: A user identifier + icon:text: + type: string + description: A single-letter representation of a username. This is used in the + auto-generated icon given to users without + an avatar + icon:bgColor: + type: string + description: A six-character hexadecimal colour code assigned to the user. This + value is used in conjunction with + `icon:text` for the user's auto-generated + icon + example: "#f44336" + until: + type: number + untilReadable: + type: string + timestampReadable: + type: string + timestampISO: + type: string + reason: + type: string \ No newline at end of file diff --git a/public/openapi/read/notifications.yaml b/public/openapi/read/notifications.yaml index 0be356d1f7..14c0d054ce 100644 --- a/public/openapi/read/notifications.yaml +++ b/public/openapi/read/notifications.yaml @@ -1,26 +1,3 @@ -FilterArray: - oneOf: - - type: array - items: - type: object - properties: - name: - type: string - filter: - type: string - selected: - type: boolean - count: - type: number - required: - - name - - filter - - type: array - items: - type: object - properties: - separator: - type: boolean get: tags: - notifications @@ -92,13 +69,13 @@ get: readClass: type: string filters: - $ref: '#/FilterArray' + $ref: ../components/schemas/NotificationFilters.yaml#/FiltersArray regularFilters: - $ref: '#/FilterArray' + $ref: ../components/schemas/NotificationFilters.yaml#/FiltersArray moderatorFilters: - $ref: '#/FilterArray' + $ref: ../components/schemas/NotificationFilters.yaml#/FiltersArray selectedFilter: - $ref: '#/FilterArray' + $ref: ../components/schemas/NotificationFilters.yaml#/FiltersObject title: type: string - $ref: ../components/schemas/Pagination.yaml#/Pagination diff --git a/public/openapi/read/user/userslug/info.yaml b/public/openapi/read/user/userslug/info.yaml index af18b480f9..afec9bc2bd 100644 --- a/public/openapi/read/user/userslug/info.yaml +++ b/public/openapi/read/user/userslug/info.yaml @@ -1,53 +1,3 @@ -BanMuteArray: - type: array - items: - type: object - properties: - uid: - type: number - timestamp: - type: number - expire: - type: number - fromUid: - type: number - user: - type: object - properties: - username: - type: string - description: A friendly name for a given user account - userslug: - type: string - description: An URL-safe variant of the username (i.e. lower-cased, spaces - removed, etc.) - picture: - type: string - uid: - type: number - description: A user identifier - icon:text: - type: string - description: A single-letter representation of a username. This is used in the - auto-generated icon given to users without - an avatar - icon:bgColor: - type: string - description: A six-character hexadecimal colour code assigned to the user. This - value is used in conjunction with - `icon:text` for the user's auto-generated - icon - example: "#f44336" - until: - type: number - untilReadable: - type: string - timestampReadable: - type: string - timestampISO: - type: string - reason: - type: string get: tags: - users @@ -90,9 +40,9 @@ get: additionalProperties: description: Contextual data is added to this object (such as topic data, etc.) bans: - $ref: '#/BanMuteArray' + $ref: ../../../components/schemas/UserObject.yaml#/BanMuteArray mutes: - $ref: '#/BanMuteArray' + $ref: ../../../components/schemas/UserObject.yaml#/BanMuteArray sessions: type: array items: