diff --git a/openapi/components/codeSamples/jams.yaml b/openapi/components/codeSamples/jams.yaml new file mode 100644 index 0000000..fcdeabe --- /dev/null +++ b/openapi/components/codeSamples/jams.yaml @@ -0,0 +1,15 @@ +/jams: + get: + - lang: cURL + source: >- + curl -X GET "https://vrchat.com/api/1/jams?type={string}" +/jams/{jamId}: + get: + - lang: cURL + source: >- + curl -X GET "https://vrchat.com/api/1/jams/{jamId}" +/jams/{jamId}/submissions: + get: + - lang: cURL + source: >- + curl -X GET "https://vrchat.com/api/1/jams/{jamId}/submissions" \ No newline at end of file diff --git a/openapi/components/parameters.yaml b/openapi/components/parameters.yaml index f147770..3f7fdd7 100644 --- a/openapi/components/parameters.yaml +++ b/openapi/components/parameters.yaml @@ -363,4 +363,12 @@ fuzzy: in: query required: false schema: - type: boolean \ No newline at end of file + type: boolean +jamId: + name: jamId + in: path + required: true + schema: + type: string + example: jam_0b7e3f6d-4647-4648-b2a1-1431e76906d9 + description: Must be a valid query ID. \ No newline at end of file diff --git a/openapi/components/paths.yaml b/openapi/components/paths.yaml index cdd2711..0b83b19 100644 --- a/openapi/components/paths.yaml +++ b/openapi/components/paths.yaml @@ -219,6 +219,15 @@ "/time": $ref: "./paths/system.yaml#/paths/~1time" +# jams + +"/jams": + $ref: "./paths/jams.yaml#/paths/~1jams" +"/jams/{jamId}": + $ref: "./paths/jams.yaml#/paths/~1jams~1{jamId}" +"/jams/{jamId}/submissions": + $ref: "./paths/jams.yaml#/paths/~1jams~1{jamId}~1submissions" + # users "/users": diff --git a/openapi/components/paths/jams.yaml b/openapi/components/paths/jams.yaml new file mode 100644 index 0000000..1be7d23 --- /dev/null +++ b/openapi/components/paths/jams.yaml @@ -0,0 +1,69 @@ +openapi: 3.0.3 +info: + title: jams + version: '1.0' + description: Jams Docs Here +paths: + /jams: + get: + summary: Show jams list + tags: + - jams + x-codeSamples: + $ref: "../codeSamples/jams.yaml#/~1jams/get" + responses: + '200': + $ref: ../responses/jams/JamListResponse.yaml + security: + - authCookie: [] + operationId: getJams + description: |- + Lists World Jams or Avatar Jams, both currently running and ones that have ended. + + `isActive` is used to select only active or already ended jams. + + `type` is used to select only world or avatar jams, and can only take `world` or `avatar`. + `` + parameters: + - schema: + type: string + example: avatar + in: query + name: type + description: 'Only show jams of this type (`avatar` or `world`).' + /jams/{jamId}: + parameters: + - $ref: ../parameters.yaml#/jamId + get: + summary: Show jam information + tags: + - jams + x-codeSamples: + $ref: "../codeSamples/jams.yaml#/~1jams~1{jamId}/get" + responses: + '200': + $ref: ../responses/jams/JamResponse.yaml + '404': + $ref: ../responses/jams/JamNotFoundError.yaml + security: + - authCookie: [] + operationId: getJam + description: Returns a jam. + /jams/{jamId}/submissions: + parameters: + - $ref: ../parameters.yaml#/jamId + get: + summary: Show jam submissions + tags: + - jams + x-codeSamples: + $ref: "../codeSamples/jams.yaml#/~1jams~1{jamId}~1submissions/get" + responses: + '200': + $ref: ../responses/jams/SubmissionListResponse.yaml + '404': + $ref: ../responses/jams/JamNotFoundError.yaml + security: + - authCookie: [] + operationId: getJamSubmissions + description: Returns all submissions of a jam. \ No newline at end of file diff --git a/openapi/components/responses/jams/JamListResponse.yaml b/openapi/components/responses/jams/JamListResponse.yaml new file mode 100644 index 0000000..cb51fb1 --- /dev/null +++ b/openapi/components/responses/jams/JamListResponse.yaml @@ -0,0 +1,7 @@ +description: Returns a list of Jam objects. +content: + application/json: + schema: + type: array + items: + $ref: ../../schemas/Jam.yaml \ No newline at end of file diff --git a/openapi/components/responses/jams/JamNotFoundError.yaml b/openapi/components/responses/jams/JamNotFoundError.yaml new file mode 100644 index 0000000..be5b6ae --- /dev/null +++ b/openapi/components/responses/jams/JamNotFoundError.yaml @@ -0,0 +1,11 @@ +description: Error response when trying to show information about a non-existent jam. +content: + application/json: + schema: + $ref: ../../schemas/Error.yaml + examples: + 404 Jam not found: + value: + error: + message: "404 id must be an ID˸ 'invalid_id_here'" + status_code: 404 \ No newline at end of file diff --git a/openapi/components/responses/jams/JamResponse.yaml b/openapi/components/responses/jams/JamResponse.yaml new file mode 100644 index 0000000..e6790e9 --- /dev/null +++ b/openapi/components/responses/jams/JamResponse.yaml @@ -0,0 +1,5 @@ +description: Returns a Jam object. +content: + application/json: + schema: + $ref: ../../schemas/Jam.yaml \ No newline at end of file diff --git a/openapi/components/responses/jams/SubmissionListResponse.yaml b/openapi/components/responses/jams/SubmissionListResponse.yaml new file mode 100644 index 0000000..7e9e160 --- /dev/null +++ b/openapi/components/responses/jams/SubmissionListResponse.yaml @@ -0,0 +1,7 @@ +description: Returns a list of Submission objects. +content: + application/json: + schema: + type: array + items: + $ref: ../../schemas/Submission.yaml \ No newline at end of file diff --git a/openapi/components/schemas/Jam.yaml b/openapi/components/schemas/Jam.yaml new file mode 100644 index 0000000..ac52d8c --- /dev/null +++ b/openapi/components/schemas/Jam.yaml @@ -0,0 +1,67 @@ +description: '' +properties: + description: + minLength: 1 + type: string + id: + type: string + minLength: 1 + example: jam_0b7e3f6d-4647-4648-b2a1-1431e76906d9 + isVisible: + type: boolean + moreInfo: + type: string + minLength: 1 + state: + type: string + minLength: 1 + description: |- + One of: + - submissions_open + - closed + stateChangeDates: + type: object + properties: + closed: + type: string + format: date-time + nullable: true + submissionsClosed: + type: string + format: date-time + nullable: true + submissionsOpened: + type: string + format: date-time + nullable: true + winnersSelected: + type: string + format: date-time + nullable: true + example: null + submissionContentGateDate: + type: string + format: date-time + nullable: true + submissionContentGated: + type: boolean + title: + type: string + minLength: 1 + updated_at: + type: string + format: date-time +required: + - description + - id + - isVisible + - moreInfo + - state + - stateChangeDates + - submissionContentGateDate + - submissionContentGated + - title + - type + - updated_at +title: Jam +type: object \ No newline at end of file diff --git a/openapi/components/schemas/Submission.yaml b/openapi/components/schemas/Submission.yaml new file mode 100644 index 0000000..1b12f80 --- /dev/null +++ b/openapi/components/schemas/Submission.yaml @@ -0,0 +1,34 @@ +description: '' +properties: + contentId: + minLength: 1 + type: string + description: Either world ID or avatar ID + created_at: + type: string + format: date-time + description: + type: string + id: + type: string + minLength: 1 + example: jsub_f01f44fa-89fa-443c-ab4c-7fed9245970f + jamId: + type: string + minLength: 1 + example: jam_0b7e3f6d-4647-4648-b2a1-1431e76906d9 + ratingScore: + type: integer + minimum: 0 + submitterId: + $ref: ../schemas/UserID.yaml +required: + - contentId + - created_at + - description + - id + - jamId + - ratingsScore + - submitterId +title: Submission +type: object \ No newline at end of file diff --git a/openapi/components/tags.yaml b/openapi/components/tags.yaml index 8cb45e4..49c73d1 100644 --- a/openapi/components/tags.yaml +++ b/openapi/components/tags.yaml @@ -25,6 +25,9 @@ - name: instances description: $ref: ./paths/instances.yaml#/info/description +- name: jams + description: + $ref: ./paths/jams.yaml#/info/description - name: notifications description: $ref: ./paths/notifications.yaml#/info/description