From 9ce98c865be953cbd8ff885b9e75dba21fae8c1d Mon Sep 17 00:00:00 2001 From: Foorack Date: Mon, 18 Oct 2021 21:12:50 +0200 Subject: [PATCH 1/8] chore!: split out PermissionResponse and PermissionListResponse --- openapi/components/paths/permissions.yaml | 69 ++----------------- .../permissions/PermissionListResponse.yaml | 49 +++++++++++++ .../permissions/PermissionResponse.yaml | 5 ++ 3 files changed, 60 insertions(+), 63 deletions(-) create mode 100644 openapi/components/responses/permissions/PermissionListResponse.yaml create mode 100644 openapi/components/responses/permissions/PermissionResponse.yaml diff --git a/openapi/components/paths/permissions.yaml b/openapi/components/paths/permissions.yaml index d8344b12..06f2a2fc 100644 --- a/openapi/components/paths/permissions.yaml +++ b/openapi/components/paths/permissions.yaml @@ -13,7 +13,7 @@ paths: authCookie: [] responses: '200': - $ref: '#/components/responses/PermissionListResponse' + $ref: ../responses/permissions/PermissionListResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml tags: @@ -27,7 +27,7 @@ paths: - permissions responses: '200': - $ref: '#/components/responses/PermissionListResponse' + $ref: ../responses/permissions/PermissionListResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml '403': @@ -46,7 +46,7 @@ paths: authCookie: [] responses: '200': - $ref: '#/components/responses/PermissionResponse' + $ref: ../responses/permissions/PermissionResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml '403': @@ -84,7 +84,7 @@ paths: - permissions responses: '200': - $ref: '#/components/responses/PermissionResponse' + $ref: ../responses/permissions/PermissionResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml operationId: getPermission @@ -100,7 +100,7 @@ paths: authCookie: [] responses: '200': - $ref: '#/components/responses/PermissionResponse' + $ref: ../responses/permissions/PermissionResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml '403': @@ -128,7 +128,7 @@ paths: authCookie: [] responses: '200': - $ref: '#/components/responses/PermissionResponse' + $ref: ../responses/permissions/PermissionResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml '403': @@ -142,63 +142,6 @@ tags: components: securitySchemes: $ref: ../securitySchemes.yaml - responses: - PermissionListResponse: - description: Returns a list of Permission objects. - content: - application/json: - schema: - type: array - items: - $ref: ../schemas/Permission.yaml - examples: - Standard Permissions Inherited By VRC+: - value: - - id: prms_fe07c8a7-a4ca-4eda-97e5-e241040ef6f8 - ownerId: usr_17f19d1e-fd48-493b-a8ad-807a3d8bdd1b - name: permission-trust-boost - - id: prms_804ba021-9f47-4e25-9847-1f42fdb2e6ff - ownerId: usr_17f19d1e-fd48-493b-a8ad-807a3d8bdd1b - name: permission-extra-favorites-avatar-groups - data: - maxFavoritesPerGroup: - avatar: 25 - maxFavoriteGroups: - avatar: 4 - - id: prms_ac88a3e0-c236-47c7-9b47-d795551b7520 - ownerId: usr_17f19d1e-fd48-493b-a8ad-807a3d8bdd1b - name: permission-early-adopter-tags - data: - tags: - - system_early_adopter - - id: prms_76f33deb-dd5d-46b7-b79d-e1f8f0a9a1e0 - ownerId: usr_17f19d1e-fd48-493b-a8ad-807a3d8bdd1b - name: permission-supporter-tags - data: - tags: - - system_supporter - - id: prms_0d9549db-d30a-48f3-a6b8-6741ce5a4283 - ownerId: usr_bc012e97-a292-4abc-b4e6-f9edcc8c0d2b - name: permission-invite-photos - data: {} - - id: prms_153ac0b7-c2dd-43f9-96e3-c61fd2e85509 - ownerId: usr_bc012e97-a292-4abc-b4e6-f9edcc8c0d2b - name: permission-profile-pic-override - data: {} - - id: prms_1d9549db-d30a-48f3-a6b8-6741ce5a4283 - ownerId: usr_bc012e97-a292-4abc-b4e6-f9edcc8c0d2b - name: permission-user-icons - data: {} - - id: prms_dc02c512-4c03-479c-8c6a-d9329c023baf - ownerId: usr_bc012e97-a292-4abc-b4e6-f9edcc8c0d2b - name: permission-user-gallery - data: {} - PermissionResponse: - description: Returns a single Permission object. - content: - application/json: - schema: - $ref: ../schemas/Permission.yaml parameters: permissionId: name: permissionId diff --git a/openapi/components/responses/permissions/PermissionListResponse.yaml b/openapi/components/responses/permissions/PermissionListResponse.yaml new file mode 100644 index 00000000..fcac85de --- /dev/null +++ b/openapi/components/responses/permissions/PermissionListResponse.yaml @@ -0,0 +1,49 @@ +description: Returns a list of Permission objects. +content: + application/json: + schema: + type: array + items: + $ref: ../../schemas/Permission.yaml + examples: + Standard Permissions Inherited By VRC+: + value: + - id: prms_fe07c8a7-a4ca-4eda-97e5-e241040ef6f8 + ownerId: usr_17f19d1e-fd48-493b-a8ad-807a3d8bdd1b + name: permission-trust-boost + - id: prms_804ba021-9f47-4e25-9847-1f42fdb2e6ff + ownerId: usr_17f19d1e-fd48-493b-a8ad-807a3d8bdd1b + name: permission-extra-favorites-avatar-groups + data: + maxFavoritesPerGroup: + avatar: 25 + maxFavoriteGroups: + avatar: 4 + - id: prms_ac88a3e0-c236-47c7-9b47-d795551b7520 + ownerId: usr_17f19d1e-fd48-493b-a8ad-807a3d8bdd1b + name: permission-early-adopter-tags + data: + tags: + - system_early_adopter + - id: prms_76f33deb-dd5d-46b7-b79d-e1f8f0a9a1e0 + ownerId: usr_17f19d1e-fd48-493b-a8ad-807a3d8bdd1b + name: permission-supporter-tags + data: + tags: + - system_supporter + - id: prms_0d9549db-d30a-48f3-a6b8-6741ce5a4283 + ownerId: usr_bc012e97-a292-4abc-b4e6-f9edcc8c0d2b + name: permission-invite-photos + data: {} + - id: prms_153ac0b7-c2dd-43f9-96e3-c61fd2e85509 + ownerId: usr_bc012e97-a292-4abc-b4e6-f9edcc8c0d2b + name: permission-profile-pic-override + data: {} + - id: prms_1d9549db-d30a-48f3-a6b8-6741ce5a4283 + ownerId: usr_bc012e97-a292-4abc-b4e6-f9edcc8c0d2b + name: permission-user-icons + data: {} + - id: prms_dc02c512-4c03-479c-8c6a-d9329c023baf + ownerId: usr_bc012e97-a292-4abc-b4e6-f9edcc8c0d2b + name: permission-user-gallery + data: {} \ No newline at end of file diff --git a/openapi/components/responses/permissions/PermissionResponse.yaml b/openapi/components/responses/permissions/PermissionResponse.yaml new file mode 100644 index 00000000..8bbe16f2 --- /dev/null +++ b/openapi/components/responses/permissions/PermissionResponse.yaml @@ -0,0 +1,5 @@ +description: Returns a single Permission object. +content: + application/json: + schema: + $ref: ../../schemas/Permission.yaml \ No newline at end of file From 826c225d75c39f7824a219df94813f4467bdfea9 Mon Sep 17 00:00:00 2001 From: Foorack Date: Mon, 18 Oct 2021 23:12:35 +0200 Subject: [PATCH 2/8] chore: split out permissionId param --- openapi/components/parameters.yaml | 6 ++++++ openapi/components/paths/permissions.yaml | 9 +-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/openapi/components/parameters.yaml b/openapi/components/parameters.yaml index 8b9385a7..d9b37e11 100644 --- a/openapi/components/parameters.yaml +++ b/openapi/components/parameters.yaml @@ -259,6 +259,12 @@ notificationId: required: true schema: type: string +permissionId: + name: permissionId + in: path + required: true + schema: + type: string variant: name: variant in: query diff --git a/openapi/components/paths/permissions.yaml b/openapi/components/paths/permissions.yaml index 06f2a2fc..a4d112d3 100644 --- a/openapi/components/paths/permissions.yaml +++ b/openapi/components/paths/permissions.yaml @@ -77,7 +77,7 @@ paths: description: 'Owner of the Permission, MUST be valid UserID.' '/permissions/{permissionId}': parameters: - - $ref: '#/components/parameters/permissionId' + - $ref: ../parameters.yaml#/permissionId get: summary: Get Permission tags: @@ -142,10 +142,3 @@ tags: components: securitySchemes: $ref: ../securitySchemes.yaml - parameters: - permissionId: - name: permissionId - in: path - required: true - schema: - type: string From a6241584615bdabdd011f86976f262041f6d97d3 Mon Sep 17 00:00:00 2001 From: Foorack Date: Mon, 18 Oct 2021 23:37:15 +0200 Subject: [PATCH 3/8] chore: split out auth schemas --- openapi/components/paths/authentication.yaml | 103 +----------------- .../CurrentUserLoginResponse.yaml | 16 +++ .../authentication/DeleteUserResponse.yaml | 5 + .../authentication/LogoutSuccess.yaml | 27 +++++ .../authentication/Verify2FAResponse.yaml | 16 +++ .../VerifyAuthTokenResponse.yaml | 14 +++ openapi/components/schemas/UserExists.yaml | 4 +- 7 files changed, 86 insertions(+), 99 deletions(-) create mode 100644 openapi/components/responses/authentication/CurrentUserLoginResponse.yaml create mode 100644 openapi/components/responses/authentication/DeleteUserResponse.yaml create mode 100644 openapi/components/responses/authentication/LogoutSuccess.yaml create mode 100644 openapi/components/responses/authentication/Verify2FAResponse.yaml create mode 100644 openapi/components/responses/authentication/VerifyAuthTokenResponse.yaml diff --git a/openapi/components/paths/authentication.yaml b/openapi/components/paths/authentication.yaml index 4fd9bc54..f733c374 100644 --- a/openapi/components/paths/authentication.yaml +++ b/openapi/components/paths/authentication.yaml @@ -11,21 +11,7 @@ paths: - authentication responses: '200': - description: OK - content: - application/json: - schema: - type: object - properties: - ok: - type: boolean - token: - type: string - minLength: 1 - required: - - ok - - token - headers: {} + $ref: ../responses/authentication/VerifyAuthTokenResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml operationId: verifyAuthToken @@ -39,33 +25,7 @@ paths: operationId: logout responses: '200': - description: OK - content: - application/json: - schema: - $ref: ../schemas/Success.yaml - examples: - Logout Success: - value: - success: - message: Ok! - status_code: 200 - headers: - Set-Cookie: - schema: - type: string - default: 'auth=; Expires=Tue, 01 Jan 2030 00:00:00 GMT; Path=/' - description: Clears the `auth` cookie. - \0Set-Cookie: - schema: - type: string - default: 'age=; Expires=Tue, 01 Jan 2030 00:00:00 GMT; Path=/' - description: Clears the `age` cookie. - \0\0Set-Cookie: - schema: - type: string - default: 'tos=; Expires=Tue, 01 Jan 2030 00:00:00 GMT; Path=/' - description: Clears the `tos` cookie. + $ref: ../responses/authentication/LogoutSuccess.yaml '401': $ref: ../responses/MissingCredentialsError.yaml description: Invalidates the login session. @@ -80,22 +40,7 @@ paths: - authentication responses: '200': - description: OK - content: - application/json: - schema: - $ref: ../schemas/CurrentUser.yaml - headers: - Set-Cookie: - schema: - type: string - example: 'auth=authcookie_00000000-0000-0000-0000-000000000000; Expires=Tue, 01 Jan 2030 00:00:00 GMT; Path=/; HttpOnly' - description: Successful authentication returns an `auth` cookie. - \0Set-Cookie: - schema: - type: string - default: apiKey=JlE5Jldo5Jibnk5O5hTx6XVqsJu4WJ26; Path=/ - description: This endpoint **always** sets the `apiKey` irrespective if it is already set. + $ref: ../responses/authentication/CurrentUserLoginResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml operationId: getCurrentUser @@ -139,22 +84,7 @@ paths: operationId: verify2FA responses: '200': - description: OK - content: - application/json: - schema: - type: object - properties: - verified: - type: boolean - required: - - verified - headers: - Set-Cookie: - schema: - type: string - example: 'twoFactorAuth=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx; Expires=Tue, 01 Jan 2030 00:00:00 GMT; Path=/; HttpOnly' - description: 'Provides a `twoFactorAuth` cookie, which can be used to bypasses the 2FA requirement for future logins on the same device.' + $ref: ../responses/authentication/Verify2FAResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml requestBody: @@ -180,22 +110,7 @@ paths: operationId: verifyRecoveryCode responses: '200': - description: OK - content: - application/json: - schema: - type: object - properties: - verified: - type: boolean - required: - - verified - headers: - Set-Cookie: - schema: - type: string - example: 'twoFactorAuth=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx; Expires=Tue, 01 Jan 2030 00:00:00 GMT; Path=/; HttpOnly' - description: 'Provides a `twoFactorAuth` cookie, which can be used to bypasses the 2FA requirement for future logins on the same device.' + $ref: ../responses/authentication/Verify2FAResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml requestBody: @@ -222,11 +137,7 @@ paths: operationId: deleteUser responses: '200': - description: OK - content: - application/json: - schema: - $ref: ../schemas/CurrentUser.yaml + $ref: ../responses/authentication/DeleteUserResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml tags: @@ -243,7 +154,5 @@ paths: tags: $ref: ../tags.yaml components: - parameters: - $ref: ../parameters.yaml securitySchemes: $ref: ../securitySchemes.yaml diff --git a/openapi/components/responses/authentication/CurrentUserLoginResponse.yaml b/openapi/components/responses/authentication/CurrentUserLoginResponse.yaml new file mode 100644 index 00000000..cc47d830 --- /dev/null +++ b/openapi/components/responses/authentication/CurrentUserLoginResponse.yaml @@ -0,0 +1,16 @@ +description: OK +content: + application/json: + schema: + $ref: ../../schemas/CurrentUser.yaml +headers: + Set-Cookie: + schema: + type: string + example: 'auth=authcookie_00000000-0000-0000-0000-000000000000; Expires=Tue, 01 Jan 2030 00:00:00 GMT; Path=/; HttpOnly' + description: Successful authentication returns an `auth` cookie. + \0Set-Cookie: + schema: + type: string + default: apiKey=JlE5Jldo5Jibnk5O5hTx6XVqsJu4WJ26; Path=/ + description: This endpoint **always** sets the `apiKey` irrespective if it is already set. \ No newline at end of file diff --git a/openapi/components/responses/authentication/DeleteUserResponse.yaml b/openapi/components/responses/authentication/DeleteUserResponse.yaml new file mode 100644 index 00000000..8fff2962 --- /dev/null +++ b/openapi/components/responses/authentication/DeleteUserResponse.yaml @@ -0,0 +1,5 @@ +description: OK +content: + application/json: + schema: + $ref: ../../schemas/CurrentUser.yaml \ No newline at end of file diff --git a/openapi/components/responses/authentication/LogoutSuccess.yaml b/openapi/components/responses/authentication/LogoutSuccess.yaml new file mode 100644 index 00000000..d9044e0f --- /dev/null +++ b/openapi/components/responses/authentication/LogoutSuccess.yaml @@ -0,0 +1,27 @@ +description: OK +content: + application/json: + schema: + $ref: ../../schemas/Success.yaml + examples: + Logout Success: + value: + success: + message: Ok! + status_code: 200 +headers: + Set-Cookie: + schema: + type: string + default: 'auth=; Expires=Tue, 01 Jan 2030 00:00:00 GMT; Path=/' + description: Clears the `auth` cookie. + \0Set-Cookie: + schema: + type: string + default: 'age=; Expires=Tue, 01 Jan 2030 00:00:00 GMT; Path=/' + description: Clears the `age` cookie. + \0\0Set-Cookie: + schema: + type: string + default: 'tos=; Expires=Tue, 01 Jan 2030 00:00:00 GMT; Path=/' + description: Clears the `tos` cookie. \ No newline at end of file diff --git a/openapi/components/responses/authentication/Verify2FAResponse.yaml b/openapi/components/responses/authentication/Verify2FAResponse.yaml new file mode 100644 index 00000000..b5ecec7f --- /dev/null +++ b/openapi/components/responses/authentication/Verify2FAResponse.yaml @@ -0,0 +1,16 @@ +description: OK +content: + application/json: + schema: + type: object + properties: + verified: + type: boolean + required: + - verified +headers: + Set-Cookie: + schema: + type: string + example: 'twoFactorAuth=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx; Expires=Tue, 01 Jan 2030 00:00:00 GMT; Path=/; HttpOnly' + description: 'Provides a `twoFactorAuth` cookie, which can be used to bypasses the 2FA requirement for future logins on the same device.' \ No newline at end of file diff --git a/openapi/components/responses/authentication/VerifyAuthTokenResponse.yaml b/openapi/components/responses/authentication/VerifyAuthTokenResponse.yaml new file mode 100644 index 00000000..37107f9b --- /dev/null +++ b/openapi/components/responses/authentication/VerifyAuthTokenResponse.yaml @@ -0,0 +1,14 @@ +description: Returns wether a provided auth token is valid or not. +content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + token: + type: string + minLength: 1 + required: + - ok + - token \ No newline at end of file diff --git a/openapi/components/schemas/UserExists.yaml b/openapi/components/schemas/UserExists.yaml index 562f2f40..a1770a10 100644 --- a/openapi/components/schemas/UserExists.yaml +++ b/openapi/components/schemas/UserExists.yaml @@ -1,3 +1,5 @@ +title: UserExists +type: object description: 'Status object representing if a queried user by username or userId exists or not. This model is primarily used by the `/auth/exists` endpoint, which in turn is used during registration. Please see the documentation on that endpoint for more information on usage.' properties: userExists: @@ -6,5 +8,3 @@ properties: type: boolean required: - userExists -title: UserExists -type: object From 0ac3888986b34660eadd08601c09834884a8bf9b Mon Sep 17 00:00:00 2001 From: Foorack Date: Tue, 19 Oct 2021 00:05:56 +0200 Subject: [PATCH 4/8] chore!: split out schemas and ensure titles --- openapi/components/paths/avatars.yaml | 4 +- openapi/components/paths/files.yaml | 2 +- openapi/components/paths/permissions.yaml | 8 +-- openapi/components/paths/users.yaml | 2 +- ...yaml => InvalidAdminCredentialsError.yaml} | 7 +-- .../responses/NotAuthorizedActionError.yaml | 7 +-- .../authentication/Verify2FAResponse.yaml | 7 +-- .../VerifyAuthTokenResponse.yaml | 11 +--- .../{ => avatars}/CurrentUserResponse.yaml | 2 +- .../files/FileVersionUploadStatus.yaml | 59 ------------------- .../FileVersionUploadStatusResponse.yaml | 14 +++++ .../InviteMessageInvalidSlotNumberError.yaml | 7 +-- .../InviteMessageUpdateRateLimitError.yaml | 7 +-- .../invite/InviteMustBeFriendsError.yaml | 7 +-- .../invite/InviteResponse400Error.yaml | 7 +-- .../responses/system/APIHealthResponse.yaml | 15 +---- .../system/DownloadSourceCodeAccessError.yaml | 7 +-- openapi/components/schemas/APIHealth.yaml | 15 +++++ .../schemas/FileVersionUploadStatus.yaml | 38 ++++++++++++ openapi/components/schemas/LimitedWorld.yaml | 1 + openapi/components/schemas/UserExists.yaml | 4 +- .../components/schemas/Verify2FAResult.yaml | 7 +++ .../schemas/VerifyAuthTokenResult.yaml | 11 ++++ 23 files changed, 107 insertions(+), 142 deletions(-) rename openapi/components/responses/{InvalidAdminCredentials.yaml => InvalidAdminCredentialsError.yaml} (69%) rename openapi/components/responses/{ => avatars}/CurrentUserResponse.yaml (68%) delete mode 100644 openapi/components/responses/files/FileVersionUploadStatus.yaml create mode 100644 openapi/components/responses/files/FileVersionUploadStatusResponse.yaml create mode 100644 openapi/components/schemas/APIHealth.yaml create mode 100644 openapi/components/schemas/FileVersionUploadStatus.yaml create mode 100644 openapi/components/schemas/Verify2FAResult.yaml create mode 100644 openapi/components/schemas/VerifyAuthTokenResult.yaml diff --git a/openapi/components/paths/avatars.yaml b/openapi/components/paths/avatars.yaml index 8b4acd1b..0338cb92 100644 --- a/openapi/components/paths/avatars.yaml +++ b/openapi/components/paths/avatars.yaml @@ -220,7 +220,7 @@ paths: - avatars responses: '200': - $ref: ../responses/CurrentUserResponse.yaml + $ref: ../responses/avatars/CurrentUserResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml '404': @@ -239,7 +239,7 @@ paths: - avatars responses: '200': - $ref: ../responses/CurrentUserResponse.yaml + $ref: ../responses/avatars/CurrentUserResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml '403': diff --git a/openapi/components/paths/files.yaml b/openapi/components/paths/files.yaml index 9303ee31..312280d2 100644 --- a/openapi/components/paths/files.yaml +++ b/openapi/components/paths/files.yaml @@ -179,7 +179,7 @@ paths: - files responses: '200': - $ref: ../responses/files/FileVersionUploadStatus.yaml + $ref: ../responses/files/FileVersionUploadStatusResponse.yaml operationId: getFileDataUploadStatus security: - apiKeyCookie: [] diff --git a/openapi/components/paths/permissions.yaml b/openapi/components/paths/permissions.yaml index a4d112d3..2c49fb54 100644 --- a/openapi/components/paths/permissions.yaml +++ b/openapi/components/paths/permissions.yaml @@ -31,7 +31,7 @@ paths: '401': $ref: ../responses/MissingCredentialsError.yaml '403': - $ref: ../responses/InvalidAdminCredentials.yaml + $ref: ../responses/InvalidAdminCredentialsError.yaml operationId: getPermissions security: - apiKeyCookie: [] @@ -50,7 +50,7 @@ paths: '401': $ref: ../responses/MissingCredentialsError.yaml '403': - $ref: ../responses/InvalidAdminCredentials.yaml + $ref: ../responses/InvalidAdminCredentialsError.yaml x-internal: true requestBody: content: @@ -104,7 +104,7 @@ paths: '401': $ref: ../responses/MissingCredentialsError.yaml '403': - $ref: ../responses/InvalidAdminCredentials.yaml + $ref: ../responses/InvalidAdminCredentialsError.yaml x-internal: true description: '**REQUIRES ADMIN CREDENTIALS**. Updates the info on a permission.' requestBody: @@ -132,7 +132,7 @@ paths: '401': $ref: ../responses/MissingCredentialsError.yaml '403': - $ref: ../responses/InvalidAdminCredentials.yaml + $ref: ../responses/InvalidAdminCredentialsError.yaml description: '**REQUIRES ADMIN CREDENTIALS**. Deletes a permission.' x-internal: true tags: diff --git a/openapi/components/paths/users.yaml b/openapi/components/paths/users.yaml index 80a590c1..ca7fb1da 100644 --- a/openapi/components/paths/users.yaml +++ b/openapi/components/paths/users.yaml @@ -151,7 +151,7 @@ paths: items: $ref: ../schemas/LimitedUser.yaml '403': - $ref: ../responses/InvalidAdminCredentials.yaml + $ref: ../responses/InvalidAdminCredentialsError.yaml operationId: searchActiveUsers security: - apiKeyCookie: [] diff --git a/openapi/components/responses/InvalidAdminCredentials.yaml b/openapi/components/responses/InvalidAdminCredentialsError.yaml similarity index 69% rename from openapi/components/responses/InvalidAdminCredentials.yaml rename to openapi/components/responses/InvalidAdminCredentialsError.yaml index 1e1f20b7..02eaddaa 100644 --- a/openapi/components/responses/InvalidAdminCredentials.yaml +++ b/openapi/components/responses/InvalidAdminCredentialsError.yaml @@ -2,12 +2,7 @@ description: Error response due to missing Administrator credentials. content: application/json: schema: - type: object - properties: - error: - $ref: ../schemas/Error.yaml - required: - - error + $ref: ../schemas/Error.yaml examples: Invalid Admin Credentials Example: value: diff --git a/openapi/components/responses/NotAuthorizedActionError.yaml b/openapi/components/responses/NotAuthorizedActionError.yaml index f4cc8e5f..6de81167 100644 --- a/openapi/components/responses/NotAuthorizedActionError.yaml +++ b/openapi/components/responses/NotAuthorizedActionError.yaml @@ -2,12 +2,7 @@ description: Error response due to missing authorization to perform that action. content: application/json: schema: - type: object - properties: - error: - $ref: ../schemas/Error.yaml - required: - - error + $ref: ../schemas/Error.yaml examples: Not Authorized Example: value: diff --git a/openapi/components/responses/authentication/Verify2FAResponse.yaml b/openapi/components/responses/authentication/Verify2FAResponse.yaml index b5ecec7f..349682d1 100644 --- a/openapi/components/responses/authentication/Verify2FAResponse.yaml +++ b/openapi/components/responses/authentication/Verify2FAResponse.yaml @@ -2,12 +2,7 @@ description: OK content: application/json: schema: - type: object - properties: - verified: - type: boolean - required: - - verified + $ref: ../../schemas/Verify2FAResult.yaml headers: Set-Cookie: schema: diff --git a/openapi/components/responses/authentication/VerifyAuthTokenResponse.yaml b/openapi/components/responses/authentication/VerifyAuthTokenResponse.yaml index 37107f9b..add431a3 100644 --- a/openapi/components/responses/authentication/VerifyAuthTokenResponse.yaml +++ b/openapi/components/responses/authentication/VerifyAuthTokenResponse.yaml @@ -2,13 +2,4 @@ description: Returns wether a provided auth token is valid or not. content: application/json: schema: - type: object - properties: - ok: - type: boolean - token: - type: string - minLength: 1 - required: - - ok - - token \ No newline at end of file + $ref: ../../schemas/VerifyAuthTokenResult.yaml \ No newline at end of file diff --git a/openapi/components/responses/CurrentUserResponse.yaml b/openapi/components/responses/avatars/CurrentUserResponse.yaml similarity index 68% rename from openapi/components/responses/CurrentUserResponse.yaml rename to openapi/components/responses/avatars/CurrentUserResponse.yaml index 6d31cfd7..40a86295 100644 --- a/openapi/components/responses/CurrentUserResponse.yaml +++ b/openapi/components/responses/avatars/CurrentUserResponse.yaml @@ -2,4 +2,4 @@ description: Returns a single CurrentUser object. content: application/json: schema: - $ref: ../schemas/CurrentUser.yaml \ No newline at end of file + $ref: ../../schemas/CurrentUser.yaml \ No newline at end of file diff --git a/openapi/components/responses/files/FileVersionUploadStatus.yaml b/openapi/components/responses/files/FileVersionUploadStatus.yaml deleted file mode 100644 index ac4b73ef..00000000 --- a/openapi/components/responses/files/FileVersionUploadStatus.yaml +++ /dev/null @@ -1,59 +0,0 @@ -description: 'Current FileVersion upload status. Contains the uploadId needed for uploading, as well as the already uploaded parts.' -content: - application/json: - schema: - type: object - description: '' - properties: - uploadId: - type: string - minLength: 1 - example: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxx - readOnly: true - fileName: - type: string - minLength: 1 - example: Avatar-MyAvatar-Un.file_00000000-0000-0000-0000-000000000000.1.unitypackage - readOnly: true - nextPartNumber: - type: number - minimum: 0 - example: 0 - readOnly: true - maxParts: - type: number - minimum: 1 - example: 1000 - readOnly: true - parts: - type: array - minItems: 0 - items: - type: object - readOnly: true - readOnly: true - etags: - type: array - description: Unknown - minItems: 0 - items: - type: object - readOnly: true - readOnly: true - required: - - uploadId - - fileName - - nextPartNumber - - maxParts - - parts - - etags - readOnly: true - examples: - Example Access Key: - value: - uploadId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxx - fileName: Avatar-MyAvatar-Un.file_00000000-0000-0000-0000-000000000000.1.unitypackage - nextPartNumber: 0 - maxParts: 1000 - parts: [] - etags: [] \ No newline at end of file diff --git a/openapi/components/responses/files/FileVersionUploadStatusResponse.yaml b/openapi/components/responses/files/FileVersionUploadStatusResponse.yaml new file mode 100644 index 00000000..b0991ae8 --- /dev/null +++ b/openapi/components/responses/files/FileVersionUploadStatusResponse.yaml @@ -0,0 +1,14 @@ +description: 'Current FileVersion upload status. Contains the uploadId needed for uploading, as well as the already uploaded parts.' +content: + application/json: + schema: + $ref: ../../schemas/FileVersionUploadStatus.yaml + examples: + Example Access Key: + value: + uploadId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxx + fileName: Avatar-MyAvatar-Un.file_00000000-0000-0000-0000-000000000000.1.unitypackage + nextPartNumber: 0 + maxParts: 1000 + parts: [] + etags: [] \ No newline at end of file diff --git a/openapi/components/responses/invite/InviteMessageInvalidSlotNumberError.yaml b/openapi/components/responses/invite/InviteMessageInvalidSlotNumberError.yaml index 68dcf36f..8abfec4a 100644 --- a/openapi/components/responses/invite/InviteMessageInvalidSlotNumberError.yaml +++ b/openapi/components/responses/invite/InviteMessageInvalidSlotNumberError.yaml @@ -2,12 +2,7 @@ description: Error response when trying to update an Invite Message with invalid content: application/json: schema: - type: object - properties: - error: - $ref: ../../schemas/Error.yaml - required: - - error + $ref: ../../schemas/Error.yaml examples: Negative Slot Number Error: value: diff --git a/openapi/components/responses/invite/InviteMessageUpdateRateLimitError.yaml b/openapi/components/responses/invite/InviteMessageUpdateRateLimitError.yaml index eabccf6e..13eb463a 100644 --- a/openapi/components/responses/invite/InviteMessageUpdateRateLimitError.yaml +++ b/openapi/components/responses/invite/InviteMessageUpdateRateLimitError.yaml @@ -2,12 +2,7 @@ description: Error response when trying to update an Invite Message before the c content: application/json: schema: - type: object - properties: - error: - $ref: ../../schemas/Error.yaml - required: - - error + $ref: ../../schemas/Error.yaml examples: Update Invite Message Please Wait Error: value: diff --git a/openapi/components/responses/invite/InviteMustBeFriendsError.yaml b/openapi/components/responses/invite/InviteMustBeFriendsError.yaml index ab53e162..a250d33a 100644 --- a/openapi/components/responses/invite/InviteMustBeFriendsError.yaml +++ b/openapi/components/responses/invite/InviteMustBeFriendsError.yaml @@ -2,12 +2,7 @@ description: Error response when trying to invite someome whom you are not frien content: application/json: schema: - type: object - properties: - error: - $ref: ../../schemas/Error.yaml - required: - - error + $ref: ../../schemas/Error.yaml examples: Must Be Friends Error: value: diff --git a/openapi/components/responses/invite/InviteResponse400Error.yaml b/openapi/components/responses/invite/InviteResponse400Error.yaml index e30b6b51..66979db2 100644 --- a/openapi/components/responses/invite/InviteResponse400Error.yaml +++ b/openapi/components/responses/invite/InviteResponse400Error.yaml @@ -2,12 +2,7 @@ description: Error response when trying to respond to an invite and something we content: application/json: schema: - type: object - properties: - error: - $ref: ../../schemas/Error.yaml - required: - - error + $ref: ../../schemas/Error.yaml examples: Response Slot Out Of Bounds Error: value: diff --git a/openapi/components/responses/system/APIHealthResponse.yaml b/openapi/components/responses/system/APIHealthResponse.yaml index f8eb0d99..0e44a119 100644 --- a/openapi/components/responses/system/APIHealthResponse.yaml +++ b/openapi/components/responses/system/APIHealthResponse.yaml @@ -2,20 +2,7 @@ description: API's Health content: application/json: schema: - type: object - properties: - ok: - type: boolean - serverName: - type: string - minLength: 1 - buildVersionTag: - type: string - minLength: 1 - required: - - ok - - serverName - - buildVersionTag + $ref: ../../schemas/APIHealth.yaml examples: Example Response: value: diff --git a/openapi/components/responses/system/DownloadSourceCodeAccessError.yaml b/openapi/components/responses/system/DownloadSourceCodeAccessError.yaml index 41097414..651232aa 100644 --- a/openapi/components/responses/system/DownloadSourceCodeAccessError.yaml +++ b/openapi/components/responses/system/DownloadSourceCodeAccessError.yaml @@ -2,12 +2,7 @@ description: Error response when trying to download non-public and non-main Java content: application/json: schema: - type: object - properties: - error: - $ref: ../../schemas/Error.yaml - required: - - error + $ref: ../../schemas/Error.yaml examples: Only Admins Can Get Non-Public Variants: value: diff --git a/openapi/components/schemas/APIHealth.yaml b/openapi/components/schemas/APIHealth.yaml new file mode 100644 index 00000000..9282171d --- /dev/null +++ b/openapi/components/schemas/APIHealth.yaml @@ -0,0 +1,15 @@ +title: APIHealth +type: object +properties: + ok: + type: boolean + serverName: + type: string + minLength: 1 + buildVersionTag: + type: string + minLength: 1 +required: + - ok + - serverName + - buildVersionTag diff --git a/openapi/components/schemas/FileVersionUploadStatus.yaml b/openapi/components/schemas/FileVersionUploadStatus.yaml new file mode 100644 index 00000000..883daed6 --- /dev/null +++ b/openapi/components/schemas/FileVersionUploadStatus.yaml @@ -0,0 +1,38 @@ +title: FileVersionUploadStatus +type: object +description: '' +properties: + uploadId: + type: string + minLength: 1 + example: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxx + fileName: + type: string + minLength: 1 + example: Avatar-MyAvatar-Un.file_00000000-0000-0000-0000-000000000000.1.unitypackage + nextPartNumber: + type: number + minimum: 0 + example: 0 + maxParts: + type: number + minimum: 1 + example: 1000 + parts: + type: array + minItems: 0 + items: + type: object + etags: + type: array + description: Unknown + minItems: 0 + items: + type: object +required: + - uploadId + - fileName + - nextPartNumber + - maxParts + - parts + - etags \ No newline at end of file diff --git a/openapi/components/schemas/LimitedWorld.yaml b/openapi/components/schemas/LimitedWorld.yaml index 8d37b508..9b918786 100644 --- a/openapi/components/schemas/LimitedWorld.yaml +++ b/openapi/components/schemas/LimitedWorld.yaml @@ -91,4 +91,5 @@ required: - popularity - heat - occupants +title: LimitedWorld type: object diff --git a/openapi/components/schemas/UserExists.yaml b/openapi/components/schemas/UserExists.yaml index a1770a10..562f2f40 100644 --- a/openapi/components/schemas/UserExists.yaml +++ b/openapi/components/schemas/UserExists.yaml @@ -1,5 +1,3 @@ -title: UserExists -type: object description: 'Status object representing if a queried user by username or userId exists or not. This model is primarily used by the `/auth/exists` endpoint, which in turn is used during registration. Please see the documentation on that endpoint for more information on usage.' properties: userExists: @@ -8,3 +6,5 @@ properties: type: boolean required: - userExists +title: UserExists +type: object diff --git a/openapi/components/schemas/Verify2FAResult.yaml b/openapi/components/schemas/Verify2FAResult.yaml new file mode 100644 index 00000000..622fee3a --- /dev/null +++ b/openapi/components/schemas/Verify2FAResult.yaml @@ -0,0 +1,7 @@ +title: Verify2FAResult +type: object +properties: + verified: + type: boolean +required: + - verified \ No newline at end of file diff --git a/openapi/components/schemas/VerifyAuthTokenResult.yaml b/openapi/components/schemas/VerifyAuthTokenResult.yaml new file mode 100644 index 00000000..8126b731 --- /dev/null +++ b/openapi/components/schemas/VerifyAuthTokenResult.yaml @@ -0,0 +1,11 @@ +title: VerifyAuthToken +type: object +properties: + ok: + type: boolean + token: + type: string + minLength: 1 +required: + - ok + - token \ No newline at end of file From 0f84e24213e3408275f712fbe87706b9ceda1c37 Mon Sep 17 00:00:00 2001 From: Foorack Date: Tue, 19 Oct 2021 00:06:21 +0200 Subject: [PATCH 5/8] ci: ensure no inline schemas in response, and schema titles --- .spectral.yaml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.spectral.yaml b/.spectral.yaml index 44f66cf4..ed466aae 100644 --- a/.spectral.yaml +++ b/.spectral.yaml @@ -10,4 +10,20 @@ rules: info-license: hint license-url: hint oas3-api-servers: hint - info-contact: hint \ No newline at end of file + info-contact: hint + + schema-title: + given: "$.components.schemas[*]" + severity: error + then: + field: title + function: truthy + + response-no-inline-schemas: + given: "$.components.responses[*].content.application/json.schema.type" + severity: error + resolved: false + then: + function: pattern + functionOptions: + notMatch: "object" \ No newline at end of file From 43949e27e049706922d2dd57025534840677c190 Mon Sep 17 00:00:00 2001 From: Foorack Date: Tue, 19 Oct 2021 00:28:44 +0200 Subject: [PATCH 6/8] refactor!: split out inline responses from paths --- .spectral.yaml | 9 +++++- openapi/components/paths/avatars.yaml | 4 +-- openapi/components/paths/files.yaml | 30 ++--------------- openapi/components/paths/friends.yaml | 8 +---- openapi/components/paths/system.yaml | 11 +------ openapi/components/paths/users.yaml | 26 +++------------ openapi/components/paths/worlds.yaml | 32 ++----------------- .../files/FileUploadAlreadyFinishedError.yaml | 11 +++++++ .../files/FileUploadURLResponse.yaml | 9 ++++++ .../responses/system/APIConfigResponse.yaml | 10 ++++++ .../responses/system/APIHealthResponse.yaml | 2 +- .../CurrentUserResponse.yaml | 0 .../users/LimitedUserListResponse.yaml | 7 ++++ .../responses/users/UserResponse.yaml | 5 +++ .../worlds/WorldMetadataResponse.yaml | 5 +++ .../worlds/WorldPublishStatusResponse.yaml | 5 +++ openapi/components/schemas/FileUploadURL.yaml | 10 ++++++ openapi/components/schemas/WorldMetadata.yaml | 11 +++++++ .../schemas/WorldPublishStatus.yaml | 9 ++++++ 19 files changed, 103 insertions(+), 101 deletions(-) create mode 100644 openapi/components/responses/files/FileUploadAlreadyFinishedError.yaml create mode 100644 openapi/components/responses/files/FileUploadURLResponse.yaml create mode 100644 openapi/components/responses/system/APIConfigResponse.yaml rename openapi/components/responses/{avatars => users}/CurrentUserResponse.yaml (100%) create mode 100644 openapi/components/responses/users/LimitedUserListResponse.yaml create mode 100644 openapi/components/responses/users/UserResponse.yaml create mode 100644 openapi/components/responses/worlds/WorldMetadataResponse.yaml create mode 100644 openapi/components/responses/worlds/WorldPublishStatusResponse.yaml create mode 100644 openapi/components/schemas/FileUploadURL.yaml create mode 100644 openapi/components/schemas/WorldMetadata.yaml create mode 100644 openapi/components/schemas/WorldPublishStatus.yaml diff --git a/.spectral.yaml b/.spectral.yaml index ed466aae..625d34ce 100644 --- a/.spectral.yaml +++ b/.spectral.yaml @@ -26,4 +26,11 @@ rules: then: function: pattern functionOptions: - notMatch: "object" \ No newline at end of file + notMatch: "object" + + paths-no-inline-responses: + given: "$.paths[*][get,post,put,delete].responses[*].content.application/json.schema" + severity: error + resolved: false + then: + function: undefined \ No newline at end of file diff --git a/openapi/components/paths/avatars.yaml b/openapi/components/paths/avatars.yaml index 0338cb92..945fde5a 100644 --- a/openapi/components/paths/avatars.yaml +++ b/openapi/components/paths/avatars.yaml @@ -220,7 +220,7 @@ paths: - avatars responses: '200': - $ref: ../responses/avatars/CurrentUserResponse.yaml + $ref: ../responses/users/CurrentUserResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml '404': @@ -239,7 +239,7 @@ paths: - avatars responses: '200': - $ref: ../responses/avatars/CurrentUserResponse.yaml + $ref: ../responses/users/CurrentUserResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml '403': diff --git a/openapi/components/paths/files.yaml b/openapi/components/paths/files.yaml index 312280d2..c811a1b5 100644 --- a/openapi/components/paths/files.yaml +++ b/openapi/components/paths/files.yaml @@ -196,35 +196,9 @@ paths: - files responses: '200': - description: 'See [https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html](AWS REST docs - PUT Object)' - content: - application/json: - schema: - description: '' - type: object - properties: - url: - type: string - minLength: 1 - description: '' - required: - - url - examples: - Example Response: - value: - url: 'https://s3.amazonaws.com/files.vrchat.cloud/Avatar-MyAvatar-Un.file_00000000-0000-0000-0000-000000000000.1.unitypackage?AWSAccessKeyId=XXXXXXXXXXXXXXXXXXXX&Expires=1626028518&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&partNumber=1&uploadId=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxx' + $ref: ../responses/files/FileUploadURLResponse.yaml '400': - description: Error response when trying to start an upload against a FileVersion that is already marked as `complete`. - content: - application/json: - schema: - $ref: ../schemas/Error.yaml - examples: - Tried To Upload Against Already Finished Version: - value: - error: - message: Cannot upload against a complete version entry․ Create a new version of this file before uploading․ - status_code: 400 + $ref: ../responses/files/FileUploadAlreadyFinishedError.yaml operationId: startFileDataUpload parameters: - schema: diff --git a/openapi/components/paths/friends.yaml b/openapi/components/paths/friends.yaml index bef3c27f..45f6b88b 100644 --- a/openapi/components/paths/friends.yaml +++ b/openapi/components/paths/friends.yaml @@ -11,13 +11,7 @@ paths: - friends responses: '200': - description: OK - content: - application/json: - schema: - type: array - items: - $ref: ../schemas/LimitedUser.yaml + $ref: ../responses/users/LimitedUserListResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml operationId: getFriends diff --git a/openapi/components/paths/system.yaml b/openapi/components/paths/system.yaml index 09648c7a..c9032a46 100644 --- a/openapi/components/paths/system.yaml +++ b/openapi/components/paths/system.yaml @@ -26,16 +26,7 @@ paths: - system responses: '200': - description: OK - content: - application/json: - schema: - $ref: ../schemas/APIConfig.yaml - headers: - Set-Cookie: - schema: - type: string - example: apiKey=JlE5Jldo5Jibnk5O5hTx6XVqsJu4WJ26; Path=/ + $ref: ../responses/system/APIConfigResponse.yaml operationId: getConfig description: |- API config contains configuration that the clients needs to work properly. diff --git a/openapi/components/paths/users.yaml b/openapi/components/paths/users.yaml index ca7fb1da..4c5cc417 100644 --- a/openapi/components/paths/users.yaml +++ b/openapi/components/paths/users.yaml @@ -11,13 +11,7 @@ paths: - users responses: '200': - description: OK - content: - application/json: - schema: - type: array - items: - $ref: ../schemas/LimitedUser.yaml + $ref: ../responses/users/LimitedUserListResponse.yaml '400': $ref: ../responses/users/UsersInvalidSearchError.yaml '401': @@ -54,11 +48,7 @@ paths: - users responses: '200': - description: OK - content: - application/json: - schema: - $ref: ../schemas/User.yaml + $ref: ../responses/users/UserResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml operationId: getUserByName @@ -75,11 +65,7 @@ paths: - users responses: '200': - description: OK - content: - application/json: - schema: - $ref: ../schemas/User.yaml + $ref: ../responses/users/UserResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml operationId: getUser @@ -92,11 +78,7 @@ paths: operationId: updateUser responses: '200': - description: OK - content: - application/json: - schema: - $ref: ../schemas/CurrentUser.yaml + $ref: ../responses/users/CurrentUserResponse.yaml description: Update a users information such as the email and birthday. security: - apiKeyCookie: [] diff --git a/openapi/components/paths/worlds.yaml b/openapi/components/paths/worlds.yaml index 14da0924..f8c74c09 100644 --- a/openapi/components/paths/worlds.yaml +++ b/openapi/components/paths/worlds.yaml @@ -328,22 +328,7 @@ paths: description: Return a worlds custom metadata. This is currently believed to be unused. Metadata can be set with `updateWorld` and can be any arbitrary object. responses: '200': - description: OK - content: - application/json: - schema: - type: object - additionalProperties: false - properties: - id: - $ref: ../schemas/WorldID.yaml - metadata: - type: object - readOnly: true - required: - - id - - metadata - readOnly: true + $ref: ../responses/worlds/WorldMetadataResponse.yaml '404': $ref: ../responses/worlds/WorldNotFoundError.yaml '/worlds/{worldId}/publish': @@ -360,20 +345,7 @@ paths: description: Returns a worlds publish status. responses: '200': - description: OK - content: - application/json: - schema: - type: object - additionalProperties: false - properties: - canPubilsh: - type: boolean - default: true - readOnly: true - required: - - canPubilsh - readOnly: true + $ref: ../responses/worlds/WorldPublishStatusResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml '404': diff --git a/openapi/components/responses/files/FileUploadAlreadyFinishedError.yaml b/openapi/components/responses/files/FileUploadAlreadyFinishedError.yaml new file mode 100644 index 00000000..257d5cdb --- /dev/null +++ b/openapi/components/responses/files/FileUploadAlreadyFinishedError.yaml @@ -0,0 +1,11 @@ +description: Error response when trying to start an upload against a FileVersion that is already marked as `complete`. +content: + application/json: + schema: + $ref: ../../schemas/Error.yaml + examples: + Tried To Upload Against Already Finished Version: + value: + error: + message: Cannot upload against a complete version entry․ Create a new version of this file before uploading․ + status_code: 400 \ No newline at end of file diff --git a/openapi/components/responses/files/FileUploadURLResponse.yaml b/openapi/components/responses/files/FileUploadURLResponse.yaml new file mode 100644 index 00000000..d5e89003 --- /dev/null +++ b/openapi/components/responses/files/FileUploadURLResponse.yaml @@ -0,0 +1,9 @@ +description: 'See [https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html](AWS REST docs - PUT Object)' +content: + application/json: + schema: + $ref: ../../schemas/FileUploadURL.yaml + examples: + Example Response: + value: + url: 'https://s3.amazonaws.com/files.vrchat.cloud/Avatar-MyAvatar-Un.file_00000000-0000-0000-0000-000000000000.1.unitypackage?AWSAccessKeyId=XXXXXXXXXXXXXXXXXXXX&Expires=1626028518&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&partNumber=1&uploadId=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxx' \ No newline at end of file diff --git a/openapi/components/responses/system/APIConfigResponse.yaml b/openapi/components/responses/system/APIConfigResponse.yaml new file mode 100644 index 00000000..3c7a9258 --- /dev/null +++ b/openapi/components/responses/system/APIConfigResponse.yaml @@ -0,0 +1,10 @@ +description: Returns the API's config. +content: + application/json: + schema: + $ref: ../../schemas/APIConfig.yaml +headers: + Set-Cookie: + schema: + type: string + example: apiKey=JlE5Jldo5Jibnk5O5hTx6XVqsJu4WJ26; Path=/ \ No newline at end of file diff --git a/openapi/components/responses/system/APIHealthResponse.yaml b/openapi/components/responses/system/APIHealthResponse.yaml index 0e44a119..7173cc77 100644 --- a/openapi/components/responses/system/APIHealthResponse.yaml +++ b/openapi/components/responses/system/APIHealthResponse.yaml @@ -1,4 +1,4 @@ -description: API's Health +description: Returns the API's health. content: application/json: schema: diff --git a/openapi/components/responses/avatars/CurrentUserResponse.yaml b/openapi/components/responses/users/CurrentUserResponse.yaml similarity index 100% rename from openapi/components/responses/avatars/CurrentUserResponse.yaml rename to openapi/components/responses/users/CurrentUserResponse.yaml diff --git a/openapi/components/responses/users/LimitedUserListResponse.yaml b/openapi/components/responses/users/LimitedUserListResponse.yaml new file mode 100644 index 00000000..14c2e3f1 --- /dev/null +++ b/openapi/components/responses/users/LimitedUserListResponse.yaml @@ -0,0 +1,7 @@ +description: Returns a list of LimitedUser objects. +content: + application/json: + schema: + type: array + items: + $ref: ../../schemas/LimitedUser.yaml \ No newline at end of file diff --git a/openapi/components/responses/users/UserResponse.yaml b/openapi/components/responses/users/UserResponse.yaml new file mode 100644 index 00000000..a0fd1302 --- /dev/null +++ b/openapi/components/responses/users/UserResponse.yaml @@ -0,0 +1,5 @@ +description: Returns a single User object. +content: + application/json: + schema: + $ref: ../../schemas/User.yaml \ No newline at end of file diff --git a/openapi/components/responses/worlds/WorldMetadataResponse.yaml b/openapi/components/responses/worlds/WorldMetadataResponse.yaml new file mode 100644 index 00000000..def29140 --- /dev/null +++ b/openapi/components/responses/worlds/WorldMetadataResponse.yaml @@ -0,0 +1,5 @@ +description: OK +content: + application/json: + schema: + $ref: ../../schemas/WorldMetadata.yaml \ No newline at end of file diff --git a/openapi/components/responses/worlds/WorldPublishStatusResponse.yaml b/openapi/components/responses/worlds/WorldPublishStatusResponse.yaml new file mode 100644 index 00000000..5767b4f7 --- /dev/null +++ b/openapi/components/responses/worlds/WorldPublishStatusResponse.yaml @@ -0,0 +1,5 @@ +description: Returns a single WorldPublishStatus object. +content: + application/json: + schema: + $ref: ../../schemas/WorldPublishStatus.yaml \ No newline at end of file diff --git a/openapi/components/schemas/FileUploadURL.yaml b/openapi/components/schemas/FileUploadURL.yaml new file mode 100644 index 00000000..5d130553 --- /dev/null +++ b/openapi/components/schemas/FileUploadURL.yaml @@ -0,0 +1,10 @@ +title: FileUploadURL +description: '' +type: object +properties: + url: + type: string + minLength: 1 + description: '' +required: + - url \ No newline at end of file diff --git a/openapi/components/schemas/WorldMetadata.yaml b/openapi/components/schemas/WorldMetadata.yaml new file mode 100644 index 00000000..19d1874a --- /dev/null +++ b/openapi/components/schemas/WorldMetadata.yaml @@ -0,0 +1,11 @@ +title: WorldMetadata +type: object +additionalProperties: false +properties: + id: + $ref: ./WorldID.yaml + metadata: + type: object +required: + - id + - metadata \ No newline at end of file diff --git a/openapi/components/schemas/WorldPublishStatus.yaml b/openapi/components/schemas/WorldPublishStatus.yaml new file mode 100644 index 00000000..e7afca15 --- /dev/null +++ b/openapi/components/schemas/WorldPublishStatus.yaml @@ -0,0 +1,9 @@ +title: WorldPublishStatus +type: object +additionalProperties: false +properties: + canPubilsh: + type: boolean + default: true +required: + - canPubilsh \ No newline at end of file From c7768789136ba3a85a685e514dca6c9c4e8d4128 Mon Sep 17 00:00:00 2001 From: Foorack Date: Sat, 23 Oct 2021 15:20:48 +0200 Subject: [PATCH 7/8] lint: add path-no-inline-requests --- .spectral.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.spectral.yaml b/.spectral.yaml index 625d34ce..9dc2a26f 100644 --- a/.spectral.yaml +++ b/.spectral.yaml @@ -32,5 +32,12 @@ rules: given: "$.paths[*][get,post,put,delete].responses[*].content.application/json.schema" severity: error resolved: false + then: + function: undefined + + paths-no-inline-requests: + given: "$.paths[*][get,post,put,delete].requestBody.content.application/json.schema.properties" + severity: error + resolved: false then: function: undefined \ No newline at end of file From 7074813abb32bd9f8cf645edfa7f270f3f9be63e Mon Sep 17 00:00:00 2001 From: Foorack Date: Sat, 23 Oct 2021 15:21:10 +0200 Subject: [PATCH 8/8] refactor!: Extract out unnamed inline requests --- openapi/components/paths/authentication.yaml | 14 +-- openapi/components/paths/avatars.yaml | 69 +------------ openapi/components/paths/favorites.yaml | 29 +----- openapi/components/paths/files.yaml | 69 +------------ .../components/paths/playermoderation.yaml | 22 +---- openapi/components/paths/users.yaml | 30 +----- openapi/components/paths/worlds.yaml | 96 +------------------ .../requests/AddFavoriteRequest.yaml | 17 ++++ .../requests/CreateAvatarRequest.yaml | 35 +++++++ .../requests/CreateFileRequest.yaml | 19 ++++ .../requests/CreateFileVersionRequest.yaml | 16 ++++ .../requests/CreateWorldRequest.yaml | 50 ++++++++++ .../requests/FinishFileDataUploadRequest.yaml | 32 +++++++ .../components/requests/InviteResponse.yaml | 2 +- .../requests/ModerateUserRequest.yaml | 11 +++ .../requests/TwoFactorAuthCode.yaml | 7 ++ .../requests/UpdateAvatarRequest.yaml | 32 +++++++ .../requests/UpdateFavoriteGroupRequest.yaml | 12 +++ .../requests/UpdateUserRequest.yaml | 30 ++++++ .../requests/UpdateWorldRequest.yaml | 44 +++++++++ 20 files changed, 321 insertions(+), 315 deletions(-) create mode 100644 openapi/components/requests/AddFavoriteRequest.yaml create mode 100644 openapi/components/requests/CreateAvatarRequest.yaml create mode 100644 openapi/components/requests/CreateFileRequest.yaml create mode 100644 openapi/components/requests/CreateFileVersionRequest.yaml create mode 100644 openapi/components/requests/CreateWorldRequest.yaml create mode 100644 openapi/components/requests/FinishFileDataUploadRequest.yaml create mode 100644 openapi/components/requests/ModerateUserRequest.yaml create mode 100644 openapi/components/requests/TwoFactorAuthCode.yaml create mode 100644 openapi/components/requests/UpdateAvatarRequest.yaml create mode 100644 openapi/components/requests/UpdateFavoriteGroupRequest.yaml create mode 100644 openapi/components/requests/UpdateUserRequest.yaml create mode 100644 openapi/components/requests/UpdateWorldRequest.yaml diff --git a/openapi/components/paths/authentication.yaml b/openapi/components/paths/authentication.yaml index f733c374..c027df29 100644 --- a/openapi/components/paths/authentication.yaml +++ b/openapi/components/paths/authentication.yaml @@ -91,12 +91,7 @@ paths: content: application/json: schema: - type: object - properties: - code: - type: string - required: - - code + $ref: ../requests/TwoFactorAuthCode.yaml examples: {} description: Finishes the login sequence with a normal 2FA-generated code for accounts with 2FA-protection enabled. tags: @@ -117,12 +112,7 @@ paths: content: application/json: schema: - type: object - properties: - code: - type: string - required: - - code + $ref: ../requests/TwoFactorAuthCode.yaml examples: {} description: Finishes the login sequence with an OTP (One Time Password) recovery code for accounts with 2FA-protection enabled. tags: diff --git a/openapi/components/paths/avatars.yaml b/openapi/components/paths/avatars.yaml index 945fde5a..f48dbd26 100644 --- a/openapi/components/paths/avatars.yaml +++ b/openapi/components/paths/avatars.yaml @@ -88,41 +88,7 @@ paths: content: application/json: schema: - description: '' - type: object - properties: - assetUrl: - type: string - id: - $ref: ../schemas/AvatarID.yaml - name: - type: string - minLength: 1 - description: - type: string - minLength: 1 - tags: - type: array - items: - $ref: ../schemas/Tag.yaml - imageUrl: - type: string - minLength: 1 - releaseStatus: - $ref: ../schemas/ReleaseStatus.yaml - version: - type: number - minimum: 0 - default: 1 - featured: - type: boolean - x-internal: true - description: You cannot set featured tag if you are not an admin. - unityPackageUrl: - type: string - required: - - name - - imageUrl + $ref: ../requests/CreateAvatarRequest.yaml description: Create an avatar. It's possible to optionally specify a ID if you want a custom one. Attempting to create an Avatar with an already claimed ID will result in a DB error. '/avatars/{avatarId}': parameters: @@ -163,38 +129,7 @@ paths: content: application/json: schema: - description: '' - type: object - properties: - assetUrl: - type: string - id: - $ref: ../schemas/AvatarID.yaml - name: - type: string - minLength: 1 - description: - type: string - minLength: 1 - tags: - type: array - items: - $ref: ../schemas/Tag.yaml - imageUrl: - type: string - minLength: 1 - releaseStatus: - $ref: ../schemas/ReleaseStatus.yaml - version: - type: number - minimum: 0 - default: 1 - featured: - type: boolean - x-internal: true - description: You cannot set featured tag if you are not an admin. - unityPackageUrl: - type: string + $ref: ../requests/UpdateAvatarRequest.yaml delete: summary: Delete Avatar operationId: deleteAvatar diff --git a/openapi/components/paths/favorites.yaml b/openapi/components/paths/favorites.yaml index ab850266..5185d595 100644 --- a/openapi/components/paths/favorites.yaml +++ b/openapi/components/paths/favorites.yaml @@ -51,22 +51,7 @@ paths: content: application/json: schema: - type: object - properties: - type: - $ref: ../schemas/FavoriteType.yaml - favoriteId: - type: string - description: 'Must be either AvatarID, WorldID or UserID.' - tags: - type: array - description: Tags indicate which group this favorite belongs to. Adding multiple groups makes it show up in all. Removing it from one in that case removes it from all. - items: - $ref: ../schemas/Tag.yaml - required: - - type - - favoriteId - - tags + $ref: ../requests/AddFavoriteRequest.yaml examples: Example Favorite Friend: value: @@ -172,17 +157,7 @@ paths: content: application/json: schema: - type: object - properties: - displayName: - type: string - visibility: - $ref: ../schemas/FavoriteGroupVisibility.yaml - tags: - type: array - description: Tags on FavoriteGroups are believed to do nothing. - items: - $ref: ../schemas/Tag.yaml + $ref: ../requests/UpdateFavoriteGroupRequest.yaml tags: - favorites description: Update information about a specific favorite group. diff --git a/openapi/components/paths/files.yaml b/openapi/components/paths/files.yaml index c811a1b5..8eee6d2d 100644 --- a/openapi/components/paths/files.yaml +++ b/openapi/components/paths/files.yaml @@ -45,25 +45,7 @@ paths: content: application/json: schema: - description: '' - type: object - properties: - name: - type: string - minLength: 0 - mimeType: - $ref: ../schemas/MIMEType.yaml - extension: - type: string - minLength: 1 - tags: - type: array - items: - $ref: ../schemas/Tag.yaml - required: - - name - - mimeType - - extension + $ref: ../requests/CreateFileRequest.yaml security: - apiKeyCookie: [] authCookie: [] @@ -115,22 +97,7 @@ paths: content: application/json: schema: - description: '' - type: object - properties: - signatureMd5: - type: string - minLength: 1 - signatureSizeInBytes: - type: number - fileMd5: - type: string - minLength: 1 - fileSizeInBytes: - type: number - required: - - signatureMd5 - - signatureSizeInBytes + $ref: ../requests/CreateFileVersionRequest.yaml '/file/{fileId}/{versionId}': parameters: - $ref: ../parameters.yaml#/fileId @@ -232,37 +199,7 @@ paths: content: application/json: schema: - type: object - description: '' - properties: - etags: - type: array - description: Array of ETags uploaded. - minItems: 1 - uniqueItems: true - items: - type: string - nextPartNumber: - type: string - minLength: 1 - default: '0' - example: '0' - deprecated: true - description: 'Always a zero in string form, despite how many parts uploaded.' - maxLength: 1 - pattern: '0' - maxParts: - type: string - minLength: 1 - description: 'Always a zero in string form, despite how many parts uploaded.' - deprecated: true - default: '0' - example: '0' - maxLength: 1 - pattern: '0' - required: - - nextPartNumber - - maxParts + $ref: ../requests/FinishFileDataUploadRequest.yaml examples: Example Request: value: diff --git a/openapi/components/paths/playermoderation.yaml b/openapi/components/paths/playermoderation.yaml index 84b39112..d5bc4e08 100644 --- a/openapi/components/paths/playermoderation.yaml +++ b/openapi/components/paths/playermoderation.yaml @@ -54,16 +54,7 @@ paths: content: application/json: schema: - type: object - additionalProperties: false - properties: - moderated: - $ref: ../schemas/UserID.yaml - type: - $ref: ../schemas/PlayerModerationType.yaml - required: - - moderated - - type + $ref: ../requests/ModerateUserRequest.yaml description: '' description: 'Moderate a user, e.g. unmute them or show their avatar.' tags: @@ -93,15 +84,8 @@ paths: content: application/json: schema: - type: object - properties: - moderated: - $ref: ../schemas/UserID.yaml - type: - $ref: ../schemas/PlayerModerationType.yaml - required: - - type - description: 'Removes a player moderation previously added through `moderateUser`. E.g if you previuosly have shown their avatar, but now want to reset it to default.' + $ref: ../requests/ModerateUserRequest.yaml + description: 'Removes a player moderation previously added through `moderateUser`. E.g if you previously have shown their avatar, but now want to reset it to default.' responses: '200': $ref: ../responses/playermoderation/PlayerModerationUnmoderatedSuccess.yaml diff --git a/openapi/components/paths/users.yaml b/openapi/components/paths/users.yaml index 4c5cc417..d44295f9 100644 --- a/openapi/components/paths/users.yaml +++ b/openapi/components/paths/users.yaml @@ -87,35 +87,7 @@ paths: content: application/json: schema: - type: object - properties: - email: - type: string - birthday: - type: string - format: date - acceptedTOSVersion: - type: number - tags: - type: array - items: - $ref: ../schemas/Tag.yaml - status: - $ref: ../schemas/UserStatus.yaml - statusDescription: - type: string - bio: - type: string - minLength: 0 - bioLinks: - type: array - items: - type: string - userIcon: - type: string - description: MUST be a valid VRChat /file/ url. - example: 'https://api.vrchat.cloud/api/1/file/file_76dc2964-0ce8-41df-b2e7-8edf994fee31/1' - minLength: 0 + $ref: ../requests/UpdateUserRequest.yaml tags: - users /users/active: diff --git a/openapi/components/paths/worlds.yaml b/openapi/components/paths/worlds.yaml index f8c74c09..cda9d95e 100644 --- a/openapi/components/paths/worlds.yaml +++ b/openapi/components/paths/worlds.yaml @@ -55,55 +55,7 @@ paths: content: application/json: schema: - type: object - properties: - assetUrl: - type: string - minLength: 1 - assetVersion: - type: string - minLength: 1 - authorId: - $ref: ../schemas/UserID.yaml - authorName: - type: string - minLength: 1 - capacity: - type: integer - minimum: 1 - maximum: 40 - default: 16 - example: 16 - description: - type: string - id: - $ref: ../schemas/WorldID.yaml - imageUrl: - type: string - minLength: 1 - name: - type: string - minLength: 1 - platform: - $ref: ../schemas/Platform.yaml - releaseStatus: - $ref: ../schemas/ReleaseStatus.yaml - tags: - type: array - items: - $ref: ../schemas/Tag.yaml - unityPackageUrl: - type: string - minLength: 1 - unityVersion: - type: string - minLength: 1 - default: 5.3.4p1 - example: 2018.4.20f1 - required: - - assetUrl - - imageUrl - - name + $ref: ../requests/CreateWorldRequest.yaml description: '' description: 'Create a new world. This endpoint requires `assetUrl` to be a valid File object with `.vrcw` file extension, and `imageUrl` to be a valid File object with an image file extension.' tags: @@ -231,51 +183,7 @@ paths: content: application/json: schema: - type: object - properties: - assetUrl: - type: string - minLength: 1 - assetVersion: - type: string - minLength: 1 - authorId: - $ref: ../schemas/UserID.yaml - authorName: - type: string - minLength: 1 - capacity: - type: integer - minimum: 1 - maximum: 40 - default: 16 - example: 16 - description: - type: string - id: - $ref: ../schemas/WorldID.yaml - imageUrl: - type: string - minLength: 1 - name: - type: string - minLength: 1 - platform: - $ref: ../schemas/Platform.yaml - releaseStatus: - $ref: ../schemas/ReleaseStatus.yaml - tags: - type: array - items: - $ref: ../schemas/Tag.yaml - unityPackageUrl: - type: string - minLength: 1 - unityVersion: - type: string - minLength: 1 - default: 5.3.4p1 - example: 2018.4.20f1 + $ref: ../requests/UpdateWorldRequest.yaml description: Update information about a specific World. tags: - worlds diff --git a/openapi/components/requests/AddFavoriteRequest.yaml b/openapi/components/requests/AddFavoriteRequest.yaml new file mode 100644 index 00000000..f8c5caf8 --- /dev/null +++ b/openapi/components/requests/AddFavoriteRequest.yaml @@ -0,0 +1,17 @@ +title: AddFavoriteRequest +type: object +properties: + type: + $ref: ../schemas/FavoriteType.yaml + favoriteId: + type: string + description: 'Must be either AvatarID, WorldID or UserID.' + tags: + type: array + description: Tags indicate which group this favorite belongs to. Adding multiple groups makes it show up in all. Removing it from one in that case removes it from all. + items: + $ref: ../schemas/Tag.yaml +required: + - type + - favoriteId + - tags \ No newline at end of file diff --git a/openapi/components/requests/CreateAvatarRequest.yaml b/openapi/components/requests/CreateAvatarRequest.yaml new file mode 100644 index 00000000..4bd0a01c --- /dev/null +++ b/openapi/components/requests/CreateAvatarRequest.yaml @@ -0,0 +1,35 @@ +title: CreateAvatarRequest +type: object +properties: + assetUrl: + type: string + id: + $ref: ../schemas/AvatarID.yaml + name: + type: string + minLength: 1 + description: + type: string + minLength: 1 + tags: + type: array + items: + $ref: ../schemas/Tag.yaml + imageUrl: + type: string + minLength: 1 + releaseStatus: + $ref: ../schemas/ReleaseStatus.yaml + version: + type: number + minimum: 0 + default: 1 + featured: + type: boolean + x-internal: true + description: Enabling featured tag requires Admin Credentials. + unityPackageUrl: + type: string +required: + - name + - imageUrl \ No newline at end of file diff --git a/openapi/components/requests/CreateFileRequest.yaml b/openapi/components/requests/CreateFileRequest.yaml new file mode 100644 index 00000000..4e79730d --- /dev/null +++ b/openapi/components/requests/CreateFileRequest.yaml @@ -0,0 +1,19 @@ +title: CreateFileRequest +type: object +properties: + name: + type: string + minLength: 0 + mimeType: + $ref: ../schemas/MIMEType.yaml + extension: + type: string + minLength: 1 + tags: + type: array + items: + $ref: ../schemas/Tag.yaml +required: + - name + - mimeType + - extension \ No newline at end of file diff --git a/openapi/components/requests/CreateFileVersionRequest.yaml b/openapi/components/requests/CreateFileVersionRequest.yaml new file mode 100644 index 00000000..4c51bdda --- /dev/null +++ b/openapi/components/requests/CreateFileVersionRequest.yaml @@ -0,0 +1,16 @@ +title: CreateFileVersionRequest +type: object +properties: + signatureMd5: + type: string + minLength: 1 + signatureSizeInBytes: + type: number + fileMd5: + type: string + minLength: 1 + fileSizeInBytes: + type: number +required: + - signatureMd5 + - signatureSizeInBytes \ No newline at end of file diff --git a/openapi/components/requests/CreateWorldRequest.yaml b/openapi/components/requests/CreateWorldRequest.yaml new file mode 100644 index 00000000..6aa0c096 --- /dev/null +++ b/openapi/components/requests/CreateWorldRequest.yaml @@ -0,0 +1,50 @@ +title: CreateWorldRequest +type: object +properties: + assetUrl: + type: string + minLength: 1 + assetVersion: + type: integer + minimum: 0 + authorId: + $ref: ../schemas/UserID.yaml + authorName: + type: string + minLength: 1 + capacity: + type: integer + minimum: 1 + maximum: 40 + default: 16 + example: 16 + description: + type: string + id: + $ref: ../schemas/WorldID.yaml + imageUrl: + type: string + minLength: 1 + name: + type: string + minLength: 1 + platform: + $ref: ../schemas/Platform.yaml + releaseStatus: + $ref: ../schemas/ReleaseStatus.yaml + tags: + type: array + items: + $ref: ../schemas/Tag.yaml + unityPackageUrl: + type: string + minLength: 1 + unityVersion: + type: string + minLength: 1 + default: 5.3.4p1 + example: 2018.4.20f1 +required: + - assetUrl + - imageUrl + - name \ No newline at end of file diff --git a/openapi/components/requests/FinishFileDataUploadRequest.yaml b/openapi/components/requests/FinishFileDataUploadRequest.yaml new file mode 100644 index 00000000..2aa8ddf5 --- /dev/null +++ b/openapi/components/requests/FinishFileDataUploadRequest.yaml @@ -0,0 +1,32 @@ +title: FinishFileDataUploadRequest +type: object +description: '' +properties: + etags: + type: array + description: Array of ETags uploaded. + minItems: 1 + uniqueItems: true + items: + type: string + nextPartNumber: + type: string + minLength: 1 + default: '0' + example: '0' + deprecated: true + description: 'Always a zero in string form, despite how many parts uploaded.' + maxLength: 1 + pattern: '0' + maxParts: + type: string + minLength: 1 + description: 'Always a zero in string form, despite how many parts uploaded.' + deprecated: true + default: '0' + example: '0' + maxLength: 1 + pattern: '0' +required: + - nextPartNumber + - maxParts \ No newline at end of file diff --git a/openapi/components/requests/InviteResponse.yaml b/openapi/components/requests/InviteResponse.yaml index cc8247a8..010078a3 100644 --- a/openapi/components/requests/InviteResponse.yaml +++ b/openapi/components/requests/InviteResponse.yaml @@ -1,3 +1,4 @@ +title: InviteResponse type: object properties: responseSlot: @@ -6,4 +7,3 @@ properties: maximum: 11 required: - responseSlot -title: InviteResponse diff --git a/openapi/components/requests/ModerateUserRequest.yaml b/openapi/components/requests/ModerateUserRequest.yaml new file mode 100644 index 00000000..2a3d16ae --- /dev/null +++ b/openapi/components/requests/ModerateUserRequest.yaml @@ -0,0 +1,11 @@ +title: ModerateUserRequest +type: object +additionalProperties: false +properties: + moderated: + $ref: ../schemas/UserID.yaml + type: + $ref: ../schemas/PlayerModerationType.yaml +required: + - moderated + - type \ No newline at end of file diff --git a/openapi/components/requests/TwoFactorAuthCode.yaml b/openapi/components/requests/TwoFactorAuthCode.yaml new file mode 100644 index 00000000..8db51891 --- /dev/null +++ b/openapi/components/requests/TwoFactorAuthCode.yaml @@ -0,0 +1,7 @@ +title: TwoFactorAuthCode +type: object +properties: + code: + type: string +required: + - code \ No newline at end of file diff --git a/openapi/components/requests/UpdateAvatarRequest.yaml b/openapi/components/requests/UpdateAvatarRequest.yaml new file mode 100644 index 00000000..449c6099 --- /dev/null +++ b/openapi/components/requests/UpdateAvatarRequest.yaml @@ -0,0 +1,32 @@ +title: UpdateAvatarRequest +type: object +properties: + assetUrl: + type: string + id: + $ref: ../schemas/AvatarID.yaml + name: + type: string + minLength: 1 + description: + type: string + minLength: 1 + tags: + type: array + items: + $ref: ../schemas/Tag.yaml + imageUrl: + type: string + minLength: 1 + releaseStatus: + $ref: ../schemas/ReleaseStatus.yaml + version: + type: number + minimum: 0 + default: 1 + featured: + type: boolean + x-internal: true + description: Enabling featured tag requires Admin Credentials. + unityPackageUrl: + type: string \ No newline at end of file diff --git a/openapi/components/requests/UpdateFavoriteGroupRequest.yaml b/openapi/components/requests/UpdateFavoriteGroupRequest.yaml new file mode 100644 index 00000000..5835e909 --- /dev/null +++ b/openapi/components/requests/UpdateFavoriteGroupRequest.yaml @@ -0,0 +1,12 @@ +title: UpdateFavoriteGroupRequest +type: object +properties: + displayName: + type: string + visibility: + $ref: ../schemas/FavoriteGroupVisibility.yaml + tags: + type: array + description: Tags on FavoriteGroups are believed to do nothing. + items: + $ref: ../schemas/Tag.yaml \ No newline at end of file diff --git a/openapi/components/requests/UpdateUserRequest.yaml b/openapi/components/requests/UpdateUserRequest.yaml new file mode 100644 index 00000000..6bf4ea85 --- /dev/null +++ b/openapi/components/requests/UpdateUserRequest.yaml @@ -0,0 +1,30 @@ +title: UpdateUserRequest +type: object +properties: + email: + type: string + birthday: + type: string + format: date + acceptedTOSVersion: + type: number + tags: + type: array + items: + $ref: ../schemas/Tag.yaml + status: + $ref: ../schemas/UserStatus.yaml + statusDescription: + type: string + bio: + type: string + minLength: 0 + bioLinks: + type: array + items: + type: string + userIcon: + type: string + description: MUST be a valid VRChat /file/ url. + example: 'https://api.vrchat.cloud/api/1/file/file_76dc2964-0ce8-41df-b2e7-8edf994fee31/1' + minLength: 0 \ No newline at end of file diff --git a/openapi/components/requests/UpdateWorldRequest.yaml b/openapi/components/requests/UpdateWorldRequest.yaml new file mode 100644 index 00000000..b54a1c44 --- /dev/null +++ b/openapi/components/requests/UpdateWorldRequest.yaml @@ -0,0 +1,44 @@ +title: UpdateWorldRequest +type: object +properties: + assetUrl: + type: string + minLength: 1 + assetVersion: + type: string + minLength: 1 + authorId: + $ref: ../schemas/UserID.yaml + authorName: + type: string + minLength: 1 + capacity: + type: integer + minimum: 1 + maximum: 40 + default: 16 + example: 16 + description: + type: string + imageUrl: + type: string + minLength: 1 + name: + type: string + minLength: 1 + platform: + $ref: ../schemas/Platform.yaml + releaseStatus: + $ref: ../schemas/ReleaseStatus.yaml + tags: + type: array + items: + $ref: ../schemas/Tag.yaml + unityPackageUrl: + type: string + minLength: 1 + unityVersion: + type: string + minLength: 1 + default: 5.3.4p1 + example: 2018.4.20f1 \ No newline at end of file