diff --git a/.spectral.yaml b/.spectral.yaml index 44f66cf4..9dc2a26f 100644 --- a/.spectral.yaml +++ b/.spectral.yaml @@ -10,4 +10,34 @@ 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" + + paths-no-inline-responses: + 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 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/authentication.yaml b/openapi/components/paths/authentication.yaml index 4fd9bc54..c027df29 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,34 +84,14 @@ 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: 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: @@ -180,34 +105,14 @@ 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: 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: @@ -222,11 +127,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 +144,5 @@ paths: tags: $ref: ../tags.yaml components: - parameters: - $ref: ../parameters.yaml securitySchemes: $ref: ../securitySchemes.yaml diff --git a/openapi/components/paths/avatars.yaml b/openapi/components/paths/avatars.yaml index 8b4acd1b..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 @@ -220,7 +155,7 @@ paths: - avatars responses: '200': - $ref: ../responses/CurrentUserResponse.yaml + $ref: ../responses/users/CurrentUserResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml '404': @@ -239,7 +174,7 @@ paths: - avatars responses: '200': - $ref: ../responses/CurrentUserResponse.yaml + $ref: ../responses/users/CurrentUserResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml '403': 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 9303ee31..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 @@ -179,7 +146,7 @@ paths: - files responses: '200': - $ref: ../responses/files/FileVersionUploadStatus.yaml + $ref: ../responses/files/FileVersionUploadStatusResponse.yaml operationId: getFileDataUploadStatus security: - apiKeyCookie: [] @@ -196,35 +163,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: @@ -258,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/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/permissions.yaml b/openapi/components/paths/permissions.yaml index d8344b12..2c49fb54 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,11 +27,11 @@ paths: - permissions responses: '200': - $ref: '#/components/responses/PermissionListResponse' + $ref: ../responses/permissions/PermissionListResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml '403': - $ref: ../responses/InvalidAdminCredentials.yaml + $ref: ../responses/InvalidAdminCredentialsError.yaml operationId: getPermissions security: - apiKeyCookie: [] @@ -46,11 +46,11 @@ paths: authCookie: [] responses: '200': - $ref: '#/components/responses/PermissionResponse' + $ref: ../responses/permissions/PermissionResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml '403': - $ref: ../responses/InvalidAdminCredentials.yaml + $ref: ../responses/InvalidAdminCredentialsError.yaml x-internal: true requestBody: content: @@ -77,14 +77,14 @@ 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: - permissions responses: '200': - $ref: '#/components/responses/PermissionResponse' + $ref: ../responses/permissions/PermissionResponse.yaml '401': $ref: ../responses/MissingCredentialsError.yaml operationId: getPermission @@ -100,11 +100,11 @@ paths: authCookie: [] responses: '200': - $ref: '#/components/responses/PermissionResponse' + $ref: ../responses/permissions/PermissionResponse.yaml '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: @@ -128,11 +128,11 @@ paths: authCookie: [] responses: '200': - $ref: '#/components/responses/PermissionResponse' + $ref: ../responses/permissions/PermissionResponse.yaml '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: @@ -142,67 +142,3 @@ 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 - in: path - required: true - schema: - type: string 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/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 80a590c1..d44295f9 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: [] @@ -105,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: @@ -151,7 +105,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/paths/worlds.yaml b/openapi/components/paths/worlds.yaml index 14da0924..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 @@ -328,22 +236,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 +253,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/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 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/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..349682d1 --- /dev/null +++ b/openapi/components/responses/authentication/Verify2FAResponse.yaml @@ -0,0 +1,11 @@ +description: OK +content: + application/json: + schema: + $ref: ../../schemas/Verify2FAResult.yaml +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..add431a3 --- /dev/null +++ b/openapi/components/responses/authentication/VerifyAuthTokenResponse.yaml @@ -0,0 +1,5 @@ +description: Returns wether a provided auth token is valid or not. +content: + application/json: + schema: + $ref: ../../schemas/VerifyAuthTokenResult.yaml \ No newline at end of file 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/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/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 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 f8eb0d99..7173cc77 100644 --- a/openapi/components/responses/system/APIHealthResponse.yaml +++ b/openapi/components/responses/system/APIHealthResponse.yaml @@ -1,21 +1,8 @@ -description: API's Health +description: Returns the 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/responses/CurrentUserResponse.yaml b/openapi/components/responses/users/CurrentUserResponse.yaml similarity index 68% rename from openapi/components/responses/CurrentUserResponse.yaml rename to openapi/components/responses/users/CurrentUserResponse.yaml index 6d31cfd7..40a86295 100644 --- a/openapi/components/responses/CurrentUserResponse.yaml +++ b/openapi/components/responses/users/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/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/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/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/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/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 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