Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add jams api #399

Merged
merged 5 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions openapi/components/codeSamples/system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@
- lang: cURL
source: >-
curl -X GET "https://vrchat.com/api/1/infoPush?require={string}&include={string}"
/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"
/css/app.css:
get:
- lang: cURL
Expand Down
10 changes: 9 additions & 1 deletion openapi/components/parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -363,4 +363,12 @@ fuzzy:
in: query
required: false
schema:
type: boolean
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.
6 changes: 6 additions & 0 deletions openapi/components/paths.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@
$ref: "./paths/system.yaml#/paths/~1config"
"/infoPush":
$ref: "./paths/system.yaml#/paths/~1infoPush"
"/jams":
$ref: "./paths/system.yaml#/paths/~1jams"
"/jams/{jamId}":
$ref: "./paths/system.yaml#/paths/~1jams~1{jamId}"
"/jams/{jamId}/submissions":
$ref: "./paths/system.yaml#/paths/~1jams~1{jamId}~1submissions"
"/css/app.css":
$ref: "./paths/system.yaml#/paths/~1css~1app.css"
"/js/app.js":
Expand Down
63 changes: 63 additions & 0 deletions openapi/components/paths/system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,69 @@ paths:
x-badges:
- color: gold
label: 'Status: Early Access (Still Under Development)'
/jams:
get:
summary: Show jams list
tags:
- system
jellejurre marked this conversation as resolved.
Show resolved Hide resolved
x-codeSamples:
$ref: "../codeSamples/system.yaml#/~1jams/get"
responses:
'200':
$ref: ../responses/system/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:
- system
x-codeSamples:
$ref: "../codeSamples/system.yaml#/~1jams~1{jamId}/get"
responses:
'200':
$ref: ../responses/system/JamResponse.yaml
'404':
$ref: ../responses/system/JamNotFoundError.yaml
security:
- authCookie: []
operationId: getJam
description: Returns a jam.
/jams/{jamId}/submissions:
parameters:
- $ref: ../parameters.yaml#/jamId
get:
summary: Show jam submissions
tags:
- system
x-codeSamples:
$ref: "../codeSamples/system.yaml#/~1jams~1{jamId}~1submissions/get"
responses:
'200':
$ref: ../responses/system/SubmissionListResponse.yaml
'404':
$ref: ../responses/system/JamNotFoundError.yaml
security:
- authCookie: []
operationId: getJamSubmissions
description: Returns all submissions of a jam.
/health:
get:
summary: Check API Health
Expand Down
7 changes: 7 additions & 0 deletions openapi/components/responses/system/JamListResponse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
description: Returns a list of Jam objects.
content:
application/json:
schema:
type: array
items:
$ref: ../../schemas/Jam.yaml
11 changes: 11 additions & 0 deletions openapi/components/responses/system/JamNotFoundError.yaml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions openapi/components/responses/system/JamResponse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
description: Returns a Jam object.
content:
application/json:
schema:
$ref: ../../schemas/Jam.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
description: Returns a list of Submission objects.
content:
application/json:
schema:
type: array
items:
$ref: ../../schemas/Submission.yaml
67 changes: 67 additions & 0 deletions openapi/components/schemas/Jam.yaml
Original file line number Diff line number Diff line change
@@ -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
34 changes: 34 additions & 0 deletions openapi/components/schemas/Submission.yaml
Original file line number Diff line number Diff line change
@@ -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