From 275c0ed01fef95c50ae8a30869922f56b0f72963 Mon Sep 17 00:00:00 2001 From: jellejurre Date: Mon, 11 Nov 2024 23:29:31 +0100 Subject: [PATCH 1/3] Add image endpoints --- openapi/components/codeSamples/files.yaml | 22 ++++++ openapi/components/paths.yaml | 6 ++ openapi/components/paths/files.yaml | 81 +++++++++++++++++++++++ openapi/components/schemas/File.yaml | 6 ++ 4 files changed, 115 insertions(+) diff --git a/openapi/components/codeSamples/files.yaml b/openapi/components/codeSamples/files.yaml index 8ede989b..6b48f300 100644 --- a/openapi/components/codeSamples/files.yaml +++ b/openapi/components/codeSamples/files.yaml @@ -79,3 +79,25 @@ source: >- curl -X GET "https://api.vrchat.cloud/api/1/analysis/{fileId}/{versionId}/standard" \ -b "auth={authCookie}" +/icon: + post: + - lang: cURL + source: >- + curl -X POST "https://api.vrchat.cloud/api/1/icon" \ + -b "auth={authCookie}" \ + -F "file=@/path/to/image.png" +/gallery: + post: + - lang: cURL + source: >- + curl -X POST "https://api.vrchat.cloud/api/1/gallery" \ + -b "auth={authCookie}" \ + -F "file=@/path/to/image.png" +/file/image: + post: + - lang: cURL + source: >- + curl -X POST "https://api.vrchat.cloud/api/1/file/image" \ + -b "auth={authCookie}" \ + -F "file=@/path/to/image.png" \ + -F "tag=icon" diff --git a/openapi/components/paths.yaml b/openapi/components/paths.yaml index a8f39dba..4e55bffe 100644 --- a/openapi/components/paths.yaml +++ b/openapi/components/paths.yaml @@ -108,6 +108,12 @@ $ref: "./paths/files.yaml#/paths/~1analysis~1{fileId}~1{versionId}~1security" "/analysis/{fileId}/{versionId}/standard": $ref: "./paths/files.yaml#/paths/~1analysis~1{fileId}~1{versionId}~1standard" +"/file/image": + $ref: "./paths/files.yaml#/paths/~1file~1image" +"/icon": + $ref: "./paths/files.yaml#/paths/~1icon" +"/gallery": + $ref: "./paths/files.yaml#/paths/~1gallery" # friends diff --git a/openapi/components/paths/files.yaml b/openapi/components/paths/files.yaml index 3d5d46fd..e2479d67 100644 --- a/openapi/components/paths/files.yaml +++ b/openapi/components/paths/files.yaml @@ -294,6 +294,87 @@ paths: security: - authCookie: [] description: Get the standard performance analysis for the uploaded assets of an avatar + '/file/image': + post: + summary: Upload gallery image, icon, emoji or sticker + tags: + - files + x-codeSamples: + $ref: "../codeSamples/files.yaml#/~1file~1image/post" + responses: + '200': + $ref: ../responses/files/FileResponse.yaml + operationId: uploadImage + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + description: The binary blob of the png file. + tag: + type: string + description: Needs to be either icon, gallery, sticker or emoji + animationStyle: + type: string + example: bats + description: Animation style for sticker, required for sticker. + maskTag: + type: string + example: square + description: Mask of the sticker, optional for sticker. + required: + - file + - tag + '/icon': + post: + summary: Upload icon + tags: + - files + x-codeSamples: + $ref: "../codeSamples/files.yaml#/~1icon/post" + responses: + '200': + $ref: ../responses/files/FileResponse.yaml + operationId: uploadIcon + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + description: The binary blob of the png file. + required: + - file + '/gallery': + post: + summary: Upload gallery image + tags: + - files + x-codeSamples: + $ref: "../codeSamples/files.yaml#/~1gallery/post" + responses: + '200': + $ref: ../responses/files/FileResponse.yaml + operationId: uploadGalleryImage + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + description: The binary blob of the png file. + required: + - file tags: $ref: ../tags.yaml components: diff --git a/openapi/components/schemas/File.yaml b/openapi/components/schemas/File.yaml index 4701755f..fef2351e 100644 --- a/openapi/components/schemas/File.yaml +++ b/openapi/components/schemas/File.yaml @@ -1,5 +1,11 @@ description: '' properties: + animationStyle: + type: string + example: bats + maskTag: + type: string + example: square extension: example: .unitypackage minLength: 1 From 71bff98c6b06b74bebb19364eb8ce65a6f9f228f Mon Sep 17 00:00:00 2001 From: jellejurre Date: Mon, 11 Nov 2024 23:36:31 +0100 Subject: [PATCH 2/3] Add missing fields --- openapi/components/paths/files.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/openapi/components/paths/files.yaml b/openapi/components/paths/files.yaml index e2479d67..fb3e4156 100644 --- a/openapi/components/paths/files.yaml +++ b/openapi/components/paths/files.yaml @@ -329,6 +329,9 @@ paths: required: - file - tag + security: + - authCookie: [] + description: Upload an image, which can be an icon, gallery image, sticker or emoji '/icon': post: summary: Upload icon @@ -352,6 +355,9 @@ paths: description: The binary blob of the png file. required: - file + security: + - authCookie: [ ] + description: Upload an icon '/gallery': post: summary: Upload gallery image @@ -375,6 +381,9 @@ paths: description: The binary blob of the png file. required: - file + security: + - authCookie: [ ] + description: Upload a gallery image tags: $ref: ../tags.yaml components: From a430f448d38107a221c2662e20fecb82d182046b Mon Sep 17 00:00:00 2001 From: jellejurre Date: Tue, 12 Nov 2024 17:00:56 +0100 Subject: [PATCH 3/3] Fix typo --- openapi/components/paths/files.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openapi/components/paths/files.yaml b/openapi/components/paths/files.yaml index fb3e4156..b5c32c33 100644 --- a/openapi/components/paths/files.yaml +++ b/openapi/components/paths/files.yaml @@ -321,11 +321,11 @@ paths: animationStyle: type: string example: bats - description: Animation style for sticker, required for sticker. + description: Animation style for sticker, required for emoji. maskTag: type: string example: square - description: Mask of the sticker, optional for sticker. + description: Mask of the sticker, optional for emoji. required: - file - tag