Skip to content

Commit

Permalink
document it
Browse files Browse the repository at this point in the history
  • Loading branch information
qimiko committed Nov 23, 2024
1 parent 0aef315 commit 5d6c54e
Showing 1 changed file with 174 additions and 0 deletions.
174 changes: 174 additions & 0 deletions openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ tags:
- name: user
description: User management

- name: loader
description: Loader information

paths:
/:
get:
Expand Down Expand Up @@ -628,6 +631,160 @@ paths:
"500":
$ref: "#/components/responses/InternalServerError"

/v1/loader/versions:
get:
tags:
- loader
summary: Get all loader versions, paginated
description: Returns a paginated list of all loader versions. This list is currently sorted by when the mods were added, not by their versions.

parameters:
- name: gd
in: query
description: Geometry Dash version
required: false
schema:
$ref: "#/components/schemas/GDVersionString"
- name: platform
in: query
description: Platform to filter version by [win, android, mac]
required: false
schema:
$ref: "#/components/schemas/Platform"
- name: prerelease
in: query
description: If prerelease builds should be included in results
required: false
schema:
type: boolean
- $ref: "#/components/parameters/Page"
- $ref: "#/components/parameters/PerPage"

responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/LoaderVersion"
"400":
$ref: "#/components/responses/BadRequest"
"500":
$ref: "#/components/responses/InternalServerError"
post:
tags:
- loader
summary: Create a new loader version (admin only)
security:
- bearerAuth: []

requestBody:
content:
application/json:
schema:
type: object
properties:
tag:
required: true
type: string
description: "Git tag that references the release"
commit_hash:
required: true
type: string
prerelease:
required: false
type: boolean
win:
required: true
$ref: "#/components/schemas/GDVersionString"
mac:
required: true
$ref: "#/components/schemas/GDVersionString"
android:
required: true
$ref: "#/components/schemas/GDVersionString"

responses:
"204":
description: No Content (Version created)
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"500":
$ref: "#/components/responses/InternalServerError"

/v1/loader/versions/latest:
get:
tags:
- loader
summary: Gets the latest loader version
description: Returns the latest loader version, filtered based on the given parameters

parameters:
- name: gd
in: query
description: Geometry Dash version
required: false
schema:
$ref: "#/components/schemas/GDVersionString"
- name: platform
in: query
description: Platform to filter version by [win, android, mac]
required: false
schema:
$ref: "#/components/schemas/Platform"
- name: prerelease
in: query
description: If prerelease builds should be accepted
required: false
schema:
type: boolean

responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/LoaderVersion"
"404":
$ref: "#/components/responses/NotFoundError"
"400":
$ref: "#/components/responses/BadRequest"
"500":
$ref: "#/components/responses/InternalServerError"

/v1/loader/versions/{version}:
get:
tags:
- loader
summary: Gets a loader version

parameters:
- name: version
description: Geode Version
in: path
required: true
schema:
$ref: "#/components/schemas/ModVersionString"

responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/LoaderVersion"
"404":
$ref: "#/components/responses/NotFoundError"
"400":
$ref: "#/components/responses/BadRequest"
"500":
$ref: "#/components/responses/InternalServerError"

components:
securitySchemes:
bearerAuth:
Expand Down Expand Up @@ -965,6 +1122,23 @@ components:
nullable: true
description: Information given with the version's status (typically a reason)

LoaderVersion:
type: object
properties:
tag:
type: string
commit_hash:
type: string
version:
$ref: "#/components/schemas/ModVersionString"
prerelease:
type: boolean
gd:
$ref: "#/components/schemas/GDVersionObject"
created_at:
type: string
format: date-time

Platform:
type: string
enum:
Expand Down

0 comments on commit 5d6c54e

Please sign in to comment.