-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat: Update swagger docs #7710
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10624,6 +10624,88 @@ const docTemplate = `{ | |
} | ||
} | ||
}, | ||
"/settings/backup/record/size": { | ||
"post": { | ||
"security": [ | ||
{ | ||
"ApiKeyAuth": [] | ||
}, | ||
{ | ||
"Timestamp": [] | ||
} | ||
], | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"tags": [ | ||
"Backup Account" | ||
], | ||
"summary": "Load backup records size", | ||
"parameters": [ | ||
{ | ||
"description": "request", | ||
"name": "request", | ||
"in": "body", | ||
"required": true, | ||
"schema": { | ||
"$ref": "#/definitions/dto.RecordSearch" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/dto.BackupFile" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/settings/backup/record/size/bycronjob": { | ||
"post": { | ||
"security": [ | ||
{ | ||
"ApiKeyAuth": [] | ||
}, | ||
{ | ||
"Timestamp": [] | ||
} | ||
], | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"tags": [ | ||
"Backup Account" | ||
], | ||
"summary": "Load backup records size for cronjob", | ||
"parameters": [ | ||
{ | ||
"description": "request", | ||
"name": "request", | ||
"in": "body", | ||
"required": true, | ||
"schema": { | ||
"$ref": "#/definitions/dto.RecordSearchByCronjob" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/dto.BackupFile" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/settings/backup/recover": { | ||
"post": { | ||
"security": [ | ||
|
@@ -16684,6 +16766,20 @@ const docTemplate = `{ | |
} | ||
} | ||
}, | ||
"dto.BackupFile": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "integer" | ||
}, | ||
"name": { | ||
"type": "string" | ||
}, | ||
"size": { | ||
"type": "integer" | ||
} | ||
} | ||
}, | ||
"dto.BackupInfo": { | ||
"type": "object", | ||
"properties": { | ||
|
@@ -19448,7 +19544,10 @@ const docTemplate = `{ | |
"zh", | ||
"en", | ||
"tw", | ||
"ru" | ||
"ja", | ||
"ru", | ||
"ms", | ||
"pt-BR" | ||
] | ||
}, | ||
"name": { | ||
|
@@ -24834,94 +24933,94 @@ const docTemplate = `{ | |
} | ||
} | ||
}, | ||
"response.AppDto": { | ||
"response.AppInstalledCheck": { | ||
"type": "object", | ||
"properties": { | ||
"icon": { | ||
"app": { | ||
"type": "string" | ||
}, | ||
"id": { | ||
"appInstallId": { | ||
"type": "integer" | ||
}, | ||
"installed": { | ||
"type": "boolean" | ||
"containerName": { | ||
"type": "string" | ||
}, | ||
"key": { | ||
"createdAt": { | ||
"type": "string" | ||
}, | ||
"limit": { | ||
"httpPort": { | ||
"type": "integer" | ||
}, | ||
"name": { | ||
"type": "string" | ||
"httpsPort": { | ||
"type": "integer" | ||
}, | ||
"resource": { | ||
"installPath": { | ||
"type": "string" | ||
}, | ||
"shortDescEn": { | ||
"isExist": { | ||
"type": "boolean" | ||
}, | ||
"lastBackupAt": { | ||
"type": "string" | ||
}, | ||
"shortDescZh": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"status": { | ||
"type": "string" | ||
}, | ||
"tags": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/model.Tag" | ||
} | ||
}, | ||
"type": { | ||
"version": { | ||
"type": "string" | ||
}, | ||
"versions": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
"response.AppInstalledCheck": { | ||
"response.AppItem": { | ||
"type": "object", | ||
"properties": { | ||
"app": { | ||
"icon": { | ||
"type": "string" | ||
}, | ||
"appInstallId": { | ||
"id": { | ||
"type": "integer" | ||
}, | ||
"containerName": { | ||
"type": "string" | ||
"installed": { | ||
"type": "boolean" | ||
}, | ||
"createdAt": { | ||
"key": { | ||
"type": "string" | ||
}, | ||
"httpPort": { | ||
"type": "integer" | ||
}, | ||
"httpsPort": { | ||
"limit": { | ||
"type": "integer" | ||
}, | ||
"installPath": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"isExist": { | ||
"type": "boolean" | ||
"resource": { | ||
"type": "string" | ||
}, | ||
"lastBackupAt": { | ||
"shortDescEn": { | ||
"type": "string" | ||
}, | ||
"name": { | ||
"shortDescZh": { | ||
"type": "string" | ||
}, | ||
"status": { | ||
"type": "string" | ||
}, | ||
"version": { | ||
"tags": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/model.Tag" | ||
} | ||
}, | ||
"type": { | ||
"type": "string" | ||
}, | ||
"versions": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
|
@@ -24965,7 +25064,7 @@ const docTemplate = `{ | |
"items": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/response.AppDto" | ||
"$ref": "#/definitions/response.AppItem" | ||
} | ||
}, | ||
"total": { | ||
|
@@ -25965,7 +26064,7 @@ const docTemplate = `{ | |
}, | ||
"securityDefinitions": { | ||
"ApiKeyAuth": { | ||
"description": "Custom Token Format, Format: md5('1panel' + API-Key + UnixTimestamp).\n` + "`" + `` + "`" + `` + "`" + `\neg:\ncurl -X GET \"http://localhost:4004/api/v1/resource\" \\\n-H \"1Panel-Token: \u003c1panel_token\u003e\" \\\n-H \"1Panel-Timestamp: \u003ccurrent_unix_timestamp\u003e\"\n` + "`" + `` + "`" + `` + "`" + `\n- ` + "`" + `1Panel-Token` + "`" + ` is the key for the panel API Key.", | ||
"description": "Custom Token Format, Format: md5('1panel' + API-Key + UnixTimestamp).\n` + "`" + `` + "`" + `` + "`" + `\neg:\ncurl -X GET \"http://localhost:4004/api/v1/dashboard/current\" \\\n-H \"1Panel-Token: \u003c1panel_token\u003e\" \\\n-H \"1Panel-Timestamp: \u003ccurrent_unix_timestamp\u003e\"\n` + "`" + `` + "`" + `` + "`" + `\n- ` + "`" + `1Panel-Token` + "`" + ` is the key for the panel API Key.", | ||
"type": "apiKey", | ||
"name": "1Panel-Token", | ||
"in": "header" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code Differences
Overall, the changes enhance the clarity and maintainability of the API documentation by introducing new functionality related to backup record sizes and improving schema definitions. The updated security definition ensures proper handling of API keys across different routes. |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The given code differs slightly in terms of comments regarding the success responses for both
/settings/backup/record/size
and/settings/backup/record/size/bycronjob
. Both methods indicate a successful response with an array ofdto.BackupFile
, but there is no significant change beyond this detail.To streamline the documentation, you could consider merging these two entries into one to ensure consistency:
If the intent was to highlight that both endpoints return the same type of data (an array of
dto.BackupFile
), you might also want to mention that in the first comment under each route. However, if they indeed differ, it's worth noting that this is consistent with the current implementation.