Use API error helpers and improve response codes (#2366)

This commit is contained in:
qwerty287
2023-09-02 13:31:10 +02:00
committed by GitHub
parent 3bee51dc7a
commit 3e563ef198
25 changed files with 117 additions and 156 deletions

View File

@@ -605,7 +605,7 @@ const docTemplate = `{
},
"/healthz": {
"get": {
"description": "If everything is fine, just a 200 will be returned, a 500 signals server state is unhealthy.",
"description": "If everything is fine, just a 204 will be returned, a 500 signals server state is unhealthy.",
"produces": [
"text/plain"
],
@@ -614,8 +614,8 @@ const docTemplate = `{
],
"summary": "Health information",
"responses": {
"200": {
"description": "OK"
"204": {
"description": "No Content"
},
"500": {
"description": "Internal Server Error"
@@ -869,7 +869,7 @@ const docTemplate = `{
"delete": {
"description": "Deletes the given org. Requires admin rights.",
"produces": [
"application/json"
"text/plain"
],
"tags": [
"Orgs"
@@ -894,10 +894,7 @@ const docTemplate = `{
],
"responses": {
"204": {
"description": "No Content",
"schema": {
"$ref": "#/definitions/Org"
}
"description": "No Content"
}
}
}
@@ -1838,8 +1835,8 @@ const docTemplate = `{
}
],
"responses": {
"200": {
"description": "OK"
"204": {
"description": "No Content"
}
}
},
@@ -1928,8 +1925,8 @@ const docTemplate = `{
}
],
"responses": {
"200": {
"description": "OK"
"204": {
"description": "No Content"
}
}
}
@@ -2667,8 +2664,8 @@ const docTemplate = `{
}
],
"responses": {
"200": {
"description": "OK"
"204": {
"description": "No Content"
}
}
},
@@ -3307,7 +3304,7 @@ const docTemplate = `{
"tags": [
"User"
],
"summary": "Return the token of the current user as stringª",
"summary": "Return the token of the current user as string",
"parameters": [
{
"type": "string",
@@ -3473,7 +3470,7 @@ const docTemplate = `{
"delete": {
"description": "Deletes the given user. Requires admin rights.",
"produces": [
"application/json"
"text/plain"
],
"tags": [
"Users"
@@ -3497,11 +3494,8 @@ const docTemplate = `{
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/User"
}
"204": {
"description": "No Content"
}
}
},