This commit is contained in:
Mike Schwörer 2023-12-13 22:41:44 +01:00
parent e691640055
commit c38afc6ef3
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF
3 changed files with 4 additions and 4 deletions

View File

@ -29,7 +29,7 @@ func NewAPIHandler(app *logic.Application) APIHandler {
// @Router /server [GET]
func (h APIHandler) ListServer(pctx ginext.PreContext) ginext.HTTPResponse {
type response struct {
Server []models.Server `json:"server"`
Servers []models.Server `json:"servers"`
}
ctx, _, errResp := pctx.Start()
@ -43,5 +43,5 @@ func (h APIHandler) ListServer(pctx ginext.PreContext) ginext.HTTPResponse {
return ginext.Error(err)
}
return ginext.JSON(http.StatusOK, response{Server: srvs})
return ginext.JSON(http.StatusOK, response{Servers: srvs})
}

View File

@ -225,7 +225,7 @@
"handler.ListServer.response": {
"type": "object",
"properties": {
"server": {
"servers": {
"type": "array",
"items": {
"$ref": "#/definitions/models.Server"

View File

@ -7,7 +7,7 @@ definitions:
type: object
handler.ListServer.response:
properties:
server:
servers:
items:
$ref: '#/definitions/models.Server'
type: array