-
Notifications
You must be signed in to change notification settings - Fork 2.4k
fix: Update swagger docs #8002
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
fix: Update swagger docs #8002
Conversation
@@ -26721,7 +26727,7 @@ const docTemplate = `{ | |||
}, | |||
"securityDefinitions": { | |||
"ApiKeyAuth": { | |||
"description": "- ` + "`" + `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 comment
The reason will be displayed to describe this comment to others. Learn more.
The code contains a few issues that need to be addressed:
-
Type Inconsistency:
- Line 3483: The type from
"integer"
to"string"
should be re-evaluated since container identifiers are typically integers, not strings.
- Line 3483: The type from
-
Missing Property:
- Line 20708: Add the missing property
domainName
of typestring
underdto.OllamaBindDomainRes
.
- Line 20708: Add the missing property
-
Code Formatting:
- Lines 2966 and 2191 contain markdown syntax (
-
) which might interfere with JSON formatting. These lines should be removed as they are intended for comment blocks and do not affect the JSON structure.
- Lines 2966 and 2191 contain markdown syntax (
Here's the revised code snippet:
const docTemplate = `{
...
"type": "object",
"properties": {
...
},
"allowIPs": {
"type": "array",
"items": {
}
}
]
},
...
};
Additional changes needed outside this context can be provided if additional information or context is required.
@@ -391,7 +391,7 @@ func (b *BaseApi) ContainerOperation(c *gin.Context) { | |||
|
|||
// @Tags Container | |||
// @Summary Container stats | |||
// @Param id path integer true "container id" | |||
// @Param id path string true "container id" | |||
// @Success 200 {object} dto.ContainerStats | |||
// @Security ApiKeyAuth | |||
// @Security Timestamp |
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.
There is no significant issue with this function definition but there is a recommendation to change the type of id
from integer to string as specified in the comment above it. This allows more flexibility for what kind of value can be used when calling the endpoint, which could include strings like 'all' that represent all containers rather than just integers.
|
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.
/lgtm
Refs #8001