Skip to content

Commit

Permalink
Add jams api (#399)
Browse files Browse the repository at this point in the history
* Add jams api

* Remove non-existant query parameter

* Remove non-existant query parameter example

* Move to jams grouping

* Create jams tag
  • Loading branch information
jellejurre authored Oct 7, 2024
1 parent e98bb6c commit 72a5da9
Show file tree
Hide file tree
Showing 11 changed files with 236 additions and 1 deletion.
15 changes: 15 additions & 0 deletions openapi/components/codeSamples/jams.yaml
Original file line number Diff line number Diff line change
@@ -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"
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.
9 changes: 9 additions & 0 deletions openapi/components/paths.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
69 changes: 69 additions & 0 deletions openapi/components/paths/jams.yaml
Original file line number Diff line number Diff line change
@@ -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.
7 changes: 7 additions & 0 deletions openapi/components/responses/jams/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/jams/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/jams/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
7 changes: 7 additions & 0 deletions openapi/components/responses/jams/SubmissionListResponse.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
3 changes: 3 additions & 0 deletions openapi/components/tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 72a5da9

Please sign in to comment.