Skip to content

Commit

Permalink
Organize operations into tags & Tweak ReDocly display settings
Browse files Browse the repository at this point in the history
# Motivations
In preparation for better documentation all of the operations could be sorted into relevant tags

# Modifications
- Add tags for better visual documentation organization
- Expand all JSON samples by default
- Expand all schemas by default
- Stop sorting operations alphabetically
  • Loading branch information
Twinki14 committed Oct 13, 2024
1 parent 9c37983 commit 3dd47dc
Show file tree
Hide file tree
Showing 26 changed files with 112 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ post:
operationId: ApplyAdvancedGameSettings
description: |
Applies new values to the provided Advanced Game Settings properties. Will automatically enable Advanced Game Settings for the currently loaded save if they are not enabled already.
tags:
- Game Settings
security:
- bearerAuth: ['Administrator']
requestBody:
Expand Down
2 changes: 2 additions & 0 deletions openapi/functions/applyServerOptions/applyServerOptions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ post:
operationId: ApplyServerOptions
description: |
Applies new Server Options to the Dedicated Server. Requires Admin privileges.
tags:
- Server Options
security:
- bearerAuth: ['Administrator']
requestBody:
Expand Down
2 changes: 2 additions & 0 deletions openapi/functions/claimServer/claimServer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ post:
operationId: ClaimServer
description: |
Claims this Dedicated Server if it is not claimed. Requires InitialAdmin privilege level, which can only be acquired by attempting passwordless login while the server does not have an Admin Password set, e.g. it is not claimed yet. Function does not return any data in case of success, and the server is claimed. The client should drop InitialAdmin privileges after that and use returned AuthenticationToken instead, and update it's cached server game state by calling QueryServerState.
tags:
- Setup
security:
- bearerAuth: ['InitialAdmin']
requestBody:
Expand Down
2 changes: 2 additions & 0 deletions openapi/functions/createNewGame/createNewGame.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ post:
operationId: CreateNewGame
description: |
Creates a new session on the Dedicated Server, and immediately loads it. HTTPS API becomes temporarily unavailable when map loading is in progress | Function does not return any data on success.
tags:
- Setup
security:
- bearerAuth: []
requestBody:
Expand Down
2 changes: 2 additions & 0 deletions openapi/functions/deleteSaveFile/deleteSaveFile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ post:
operationId: DeleteSaveFile
description: |
Deletes the existing save game file from the server. Requires Admin privileges. SaveName might be changed to satisfy file system restrictions on file names. Function does not return any data on success.
tags:
- Save Management
security:
- bearerAuth: ['Administrator']
requestBody:
Expand Down
2 changes: 2 additions & 0 deletions openapi/functions/deleteSaveSession/deleteSaveSession.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ post:
operationId: DeleteSaveSession
description: |
Deletes all save files belonging to the specific session name. Requires Admin privileges. SessionName must be a valid session name with at least one saved save game file belonging to it. Function does not return any data on success.
tags:
- Save Management
security:
- bearerAuth: ['Administrator']
requestBody:
Expand Down
2 changes: 2 additions & 0 deletions openapi/functions/downloadSaveGame/downloadSaveGame.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ post:
operationId: DownloadSaveGame
description: |
Downloads save game with the given name from the Dedicated Server. Requires Admin privileges. This function responds with the file attachment containing the save game file on success, and with normal error response in case of error.
tags:
- Save Management
security:
- bearerAuth: ['Administrator']
requestBody:
Expand Down
2 changes: 2 additions & 0 deletions openapi/functions/enumerateSessions/enumerateSessions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ post:
operationId: EnumerateSessions
description: |
Enumerates all save game files available on the Dedicated Server. Requires Admin privileges. Function does not require any additional parameters.
tags:
- Save Management
security:
- bearerAuth: ['Administrator']
requestBody:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ post:
operationId: GetAdvancedGameSettings
description: |
Retrieves currently applied advanced game settings. Does not require input parameters.
tags:
- Game Settings
security:
- bearerAuth: []
requestBody:
Expand Down
2 changes: 2 additions & 0 deletions openapi/functions/getServerOptions/getServerOptions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ post:
operationId: GetServerOptions
description: |
Retrieves currently applied server options and server options that are still pending application (because of needing session or server restart) Does not require input parameters.
tags:
- Server Options
security:
- bearerAuth: []
requestBody:
Expand Down
2 changes: 2 additions & 0 deletions openapi/functions/healthCheck/healthCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ post:
summary: Health Check
operationId: HealthCheck
description: Performs a health check on the Dedicated Server API. Allows passing additional data between Modded Dedicated Server and Modded Game Client. This function requires no Authentication.
tags:
- Server Status
security:
- {}
requestBody:
Expand Down
2 changes: 2 additions & 0 deletions openapi/functions/loadGame/loadGame.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ post:
operationId: LoadGame
description: |
Loads the save game file by name, optionally with Advanced Game Settings enabled. Requires Admin privileges. Dedicated Server HTTPS API will become temporarily unavailable when save game is being loaded. Function does not return any data on succcess.
tags:
- Save Management
security:
- bearerAuth: ['Administrator']
requestBody:
Expand Down
2 changes: 2 additions & 0 deletions openapi/functions/passwordLogin/passwordLogin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ post:
operationId: PasswordLogin
description: |
Attempts to log in to the Dedicated Server as a player using either Admin Password or Client Protection Password. This function requires no Authentication.
tags:
- Authorization
security:
- {}
requestBody:
Expand Down
2 changes: 2 additions & 0 deletions openapi/functions/passwordlessLogin/passwordlessLogin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ post:
operationId: PasswordlessLogin
description: |
Attempts to perform a passwordless login to the Dedicated Server as a player. Passwordless login is possible if the Dedicated Server is not claimed, or if Client Protection Password is not set for the Dedicated Server. This function requires no Authentication.
tags:
- Authorization
security:
- {}
requestBody:
Expand Down
2 changes: 2 additions & 0 deletions openapi/functions/queryServerState/queryServerState.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ post:
operationId: QueryServerState
description: |
Retrieves the current state of the Dedicated Server. Does not require any input parameters.
tags:
- Server Status
security:
- bearerAuth: []
requestBody:
Expand Down
2 changes: 2 additions & 0 deletions openapi/functions/renameServer/renameServer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ post:
operationId: RenameServer
description: |
Renames the Dedicated Server once it has been claimed. Requires Admin privileges. Function does not return any data on success.
tags:
- Server Options
security:
- bearerAuth: ['Administrator']
requestBody:
Expand Down
2 changes: 2 additions & 0 deletions openapi/functions/runCommand/runCommand.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ post:
operationId: RunCommand
description: |
Runs the given Console Command on the Dedicated Server, and returns it's output to the Console. Requires Admin privileges.
tags:
- Server Actions
security:
- bearerAuth: ['Administrator']
requestBody:
Expand Down
2 changes: 2 additions & 0 deletions openapi/functions/saveGame/saveGame.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ post:
operationId: SaveGame
description: |
Saves the currently loaded session into the new save game file named as the argument. Requires Admin privileges. SaveName might be changed to satisfy file system restrictions on file names. Function does not return any data on success.
tags:
- Save Management
security:
- bearerAuth: ['Administrator']
requestBody:
Expand Down
2 changes: 2 additions & 0 deletions openapi/functions/setAdminPassword/setAdminPassword.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ post:
operationId: SetAdminPassword
description: |
Updates the currently set Admin Password. This will invalidate all previously issued Client and Admin authentication tokens. Requires Admin privileges. Function does not return any data on success.
tags:
- Authorization
security:
- bearerAuth: ['Administrator']
requestBody:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ post:
operationId: SetAutoLoadSessionName
description: |
Updates the name of the session that the Dedicated Server will automatically load on startup. Does not change currently loaded session. Requires Admin privileges. Function does not return any data on success.
tags:
- Save Management
security:
- bearerAuth: ['Administrator']
requestBody:
Expand Down
2 changes: 2 additions & 0 deletions openapi/functions/setClientPassword/setClientPassword.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ post:
operationId: SetClientPassword
description: |
Updates the currently set Client Protection Password. This will invalidate all previously issued Client authentication tokens. Pass empty string to remove the password, and let anyone join the server as Client. Requres Admin privileges. Function does not return any data on success.
tags:
- Authorization
security:
- bearerAuth: ['Administrator']
requestBody:
Expand Down
2 changes: 2 additions & 0 deletions openapi/functions/shutdown/shutdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ post:
operationId: Shutdown
description: |
Shuts down the Dedicated Server. If automatic restart script is setup, this allows restarting the server to apply new settings or update. Requires Admin privileges. Shutdowns initiated by remote hosts are logged with their IP and their token. Function does not return any data on success, and does not take any parameters.
tags:
- Server Actions
security:
- bearerAuth: ['Administrator']
requestBody:
Expand Down
2 changes: 2 additions & 0 deletions openapi/functions/uploadSaveGame/uploadSaveGame.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ post:
operationId: UploadSaveGame
description: |
Shuts down the Dedicated Server. If automatic restart script is setup, this allows restarting the server to apply new settings or update. Requires Admin privileges. Shutdowns initiated by remote hosts are logged with their IP and their token. Function does not return any data on success, and does not take any parameters.
tags:
- Save Management
security:
- bearerAuth: ['Administrator']
requestBody:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ post:
summary: Verify Authentication Token
operationId: VerifyAuthenticationToken
description: Verifies the Authentication token provided to the Dedicated Server API. Returns No Content if the provided token is valid. This function does not require input parameters and does not return any data.
tags:
- Authorization
security:
- bearerAuth: []
requestBody:
Expand Down
92 changes: 61 additions & 31 deletions openapi/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,34 @@ components:
scheme: bearer
bearerFormat: JWT

tags:
- name: Setup
description: Authorization
- name: Authorization
description: Authorization
- name: Server Status
description: Server Status
- name: Server Actions
description: Save Management
- name: Server Options
description: Server Options
- name: Game Settings
description: Game Settings
- name: Save Management
description: Save Management
paths:
# HealthCheck
'/api/v1/?function=HealthCheck':
$ref: functions/healthCheck/healthCheck.yml

# VerifyAuthenticationToken
'/api/v1/?function=VerifyAuthenticationToken':
$ref: functions/verifyAuthenticationToken/verifyAuthenticationToken.yml
# --- Setup

# ClaimServer
'/api/v1/?function=ClaimServer':
$ref: functions/claimServer/claimServer.yml

# CreateNewGame
'/api/v1/?function=CreateNewGame':
$ref: functions/createNewGame/createNewGame.yml

# --- Authorization

# PasswordlessLogin
'/api/v1/?function=PasswordlessLogin':
Expand All @@ -34,13 +54,29 @@ paths:
'/api/v1/?function=PasswordLogin':
$ref: functions/passwordLogin/passwordLogin.yml

# SetClientPassword
'/api/v1/?function=SetClientPassword':
$ref: functions/setClientPassword/setClientPassword.yml

# SetAdminPassword
'/api/v1/?function=SetAdminPassword':
$ref: functions/setAdminPassword/setAdminPassword.yml

# VerifyAuthenticationToken
'/api/v1/?function=VerifyAuthenticationToken':
$ref: functions/verifyAuthenticationToken/verifyAuthenticationToken.yml

# --- Server Status

# HealthCheck
'/api/v1/?function=HealthCheck':
$ref: functions/healthCheck/healthCheck.yml

# QueryServerState
'/api/v1/?function=QueryServerState':
$ref: functions/queryServerState/queryServerState.yml

# GetServerOptions
'/api/v1/?function=GetServerOptions':
$ref: functions/getServerOptions/getServerOptions.yml
# --- Game Settings

# GetAdvancedGameSettings
'/api/v1/?function=GetAdvancedGameSettings':
Expand All @@ -50,25 +86,7 @@ paths:
'/api/v1/?function=ApplyAdvancedGameSettings':
$ref: functions/applyAdvancedGameSettings/applyAdvancedGameSettings.yml

# ClaimServer
'/api/v1/?function=ClaimServer':
$ref: functions/claimServer/claimServer.yml

# RenameServer
'/api/v1/?function=RenameServer':
$ref: functions/renameServer/renameServer.yml

# SetClientPassword
'/api/v1/?function=SetClientPassword':
$ref: functions/setClientPassword/setClientPassword.yml

# SetAdminPassword
'/api/v1/?function=SetAdminPassword':
$ref: functions/setAdminPassword/setAdminPassword.yml

# SetAutoLoadSessionName
'/api/v1/?function=SetAutoLoadSessionName':
$ref: functions/setAutoLoadSessionName/setAutoLoadSessionName.yml
# --- Server Actions

# RunCommand
'/api/v1/?function=RunCommand':
Expand All @@ -78,13 +96,25 @@ paths:
'/api/v1/?function=Shutdown':
$ref: functions/shutdown/shutdown.yml

# --- Server Options

# GetServerOptions
'/api/v1/?function=GetServerOptions':
$ref: functions/getServerOptions/getServerOptions.yml

# ApplyServerOptions
'/api/v1/?function=ApplyServerOptions':
$ref: functions/applyServerOptions/applyServerOptions.yml

# CreateNewGame
'/api/v1/?function=CreateNewGame':
$ref: functions/createNewGame/createNewGame.yml
# RenameServer
'/api/v1/?function=RenameServer':
$ref: functions/renameServer/renameServer.yml

# --- Save Management

# SetAutoLoadSessionName
'/api/v1/?function=SetAutoLoadSessionName':
$ref: functions/setAutoLoadSessionName/setAutoLoadSessionName.yml

# SaveGame
'/api/v1/?function=SaveGame':
Expand Down
3 changes: 3 additions & 0 deletions redocly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ rules:
theme:
openapi:
htmlTemplate: ./docs/index.html
jsonSampleExpandLevel: all
schemaExpansionLevel: all
sortOperationsAlphabetically: false

0 comments on commit 3dd47dc

Please sign in to comment.