Skip to content

Commit 193b0f3

Browse files
authored
fix: Update swagger docs (#8002)
Refs #8001
1 parent 67c1bf2 commit 193b0f3

File tree

4 files changed

+31
-7
lines changed

4 files changed

+31
-7
lines changed

backend/app/api/v1/container.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ func (b *BaseApi) ContainerOperation(c *gin.Context) {
391391

392392
// @Tags Container
393393
// @Summary Container stats
394-
// @Param id path integer true "container id"
394+
// @Param id path string true "container id"
395395
// @Success 200 {object} dto.ContainerStats
396396
// @Security ApiKeyAuth
397397
// @Security Timestamp

cmd/server/docs/docs.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -3483,7 +3483,7 @@ const docTemplate = `{
34833483
"summary": "Container stats",
34843484
"parameters": [
34853485
{
3486-
"type": "integer",
3486+
"type": "string",
34873487
"description": "container id",
34883488
"name": "id",
34893489
"in": "path",
@@ -19382,6 +19382,9 @@ const docTemplate = `{
1938219382
"dto.ForwardRuleOperate": {
1938319383
"type": "object",
1938419384
"properties": {
19385+
"forceDelete": {
19386+
"type": "boolean"
19387+
},
1938519388
"rules": {
1938619389
"type": "array",
1938719390
"items": {
@@ -20708,6 +20711,9 @@ const docTemplate = `{
2070820711
"dto.OllamaBindDomainRes": {
2070920712
"type": "object",
2071020713
"properties": {
20714+
"acmeAccountID": {
20715+
"type": "integer"
20716+
},
2071120717
"allowIPs": {
2071220718
"type": "array",
2071320719
"items": {
@@ -26721,7 +26727,7 @@ const docTemplate = `{
2672126727
},
2672226728
"securityDefinitions": {
2672326729
"ApiKeyAuth": {
26724-
"description": "- ` + "`" + `1Panel-Token` + "`" + ` is the key for the panel API Key.",
26730+
"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.",
2672526731
"type": "apiKey",
2672626732
"name": "1Panel-Token",
2672726733
"in": "header"

cmd/server/docs/swagger.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -3480,7 +3480,7 @@
34803480
"summary": "Container stats",
34813481
"parameters": [
34823482
{
3483-
"type": "integer",
3483+
"type": "string",
34843484
"description": "container id",
34853485
"name": "id",
34863486
"in": "path",
@@ -19379,6 +19379,9 @@
1937919379
"dto.ForwardRuleOperate": {
1938019380
"type": "object",
1938119381
"properties": {
19382+
"forceDelete": {
19383+
"type": "boolean"
19384+
},
1938219385
"rules": {
1938319386
"type": "array",
1938419387
"items": {
@@ -20705,6 +20708,9 @@
2070520708
"dto.OllamaBindDomainRes": {
2070620709
"type": "object",
2070720710
"properties": {
20711+
"acmeAccountID": {
20712+
"type": "integer"
20713+
},
2070820714
"allowIPs": {
2070920715
"type": "array",
2071020716
"items": {
@@ -26718,7 +26724,7 @@
2671826724
},
2671926725
"securityDefinitions": {
2672026726
"ApiKeyAuth": {
26721-
"description": "- `1Panel-Token` is the key for the panel API Key.",
26727+
"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.",
2672226728
"type": "apiKey",
2672326729
"name": "1Panel-Token",
2672426730
"in": "header"

cmd/server/docs/swagger.yaml

+14-2
Original file line numberDiff line numberDiff line change
@@ -1578,6 +1578,8 @@ definitions:
15781578
type: object
15791579
dto.ForwardRuleOperate:
15801580
properties:
1581+
forceDelete:
1582+
type: boolean
15811583
rules:
15821584
items:
15831585
properties:
@@ -2480,6 +2482,8 @@ definitions:
24802482
type: object
24812483
dto.OllamaBindDomainRes:
24822484
properties:
2485+
acmeAccountID:
2486+
type: integer
24832487
allowIPs:
24842488
items:
24852489
type: string
@@ -8585,7 +8589,7 @@ paths:
85858589
in: path
85868590
name: id
85878591
required: true
8588-
type: integer
8592+
type: string
85898593
responses:
85908594
"200":
85918595
description: OK
@@ -16762,7 +16766,15 @@ schemes:
1676216766
- https
1676316767
securityDefinitions:
1676416768
ApiKeyAuth:
16765-
description: '- `1Panel-Token` is the key for the panel API Key.'
16769+
description: |-
16770+
Custom Token Format, Format: md5('1panel' + API-Key + UnixTimestamp).
16771+
```
16772+
eg:
16773+
curl -X GET "http://localhost:4004/api/v1/dashboard/current" \
16774+
-H "1Panel-Token: <1panel_token>" \
16775+
-H "1Panel-Timestamp: <current_unix_timestamp>"
16776+
```
16777+
- `1Panel-Token` is the key for the panel API Key.
1676616778
in: header
1676716779
name: 1Panel-Token
1676816780
type: apiKey

0 commit comments

Comments
 (0)