From b2a117c0b4e99cd693ab270b131a0012da0eaac8 Mon Sep 17 00:00:00 2001 From: Gustaw Lippa Date: Tue, 28 Sep 2021 10:58:35 +0200 Subject: [PATCH] Unify error descriptions --- doc/developers-guide/domain_management.md | 22 ++++++++++++---------- doc/rest-api/Dynamic-domains_swagger.yml | 8 ++++---- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/doc/developers-guide/domain_management.md b/doc/developers-guide/domain_management.md index 5b50531311b..e555db16c2c 100644 --- a/doc/developers-guide/domain_management.md +++ b/doc/developers-guide/domain_management.md @@ -128,10 +128,11 @@ curl -v -X PUT "http://localhost:8088/api/domains/example.db" \ Result codes: -* 204 - inserted. -* 403 - DB service disabled, or an unknown host type. -* 409 - domain already exists with a different host type. -* 500 - other errors. +* 204 - Domain was successfully inserted. +* 400 - Bad request. +* 403 - DB service disabled, or the host type is unknown. +* 409 - Domain already exists with a different host type. +* 500 - Other errors. Example of the result body with a failure reason: @@ -154,9 +155,9 @@ curl -v -X DELETE "http://localhost:8088/api/domains/example.db" \ Result codes: -* 204 - the domain is removed or not found. -* 403 - the domain is static, the DB service is disabled, the host type is wrong (does not match the host type in the database), or the host type is unknown. -* 500 - other errors. +* 204 - The domain is removed or not found. +* 403 - The domain is static, the DB service is disabled, the host type is wrong (does not match the host type in the database), or the host type is unknown. +* 500 - Other errors. ### Enable/disable domain @@ -172,9 +173,10 @@ curl -v -X PATCH "http://localhost:8088/api/domains/example.db" \ Result codes: -* 204 - updated. -* 403 - the domain is static, or the service is disabled. -* 404 - domain not found. +* 204 - Domain was successfully updated. +* 403 - Domain is static, or the service is disabled. +* 404 - Domain not found. +* 500 - Other errors. ## Command Line Interface diff --git a/doc/rest-api/Dynamic-domains_swagger.yml b/doc/rest-api/Dynamic-domains_swagger.yml index 677a05a40b8..887ee848d01 100644 --- a/doc/rest-api/Dynamic-domains_swagger.yml +++ b/doc/rest-api/Dynamic-domains_swagger.yml @@ -42,7 +42,7 @@ paths: 204: description: Domain was successfully inserted. 400: - description: Bad request + description: Bad request. examples: application/json: {"what": "body is empty"} 409: @@ -50,7 +50,7 @@ paths: examples: application/json: {"what": "duplicate"} 403: - description: DB service disabled or the host type is unknown. + description: DB service disabled, or the host type is unknown. examples: application/json: {"what": "domain is static"} 500: @@ -79,7 +79,7 @@ paths: type: boolean responses: 204: - description: Domain was sucessfully updated. + description: Domain was successfully updated. 404: description: Domain not found. examples: @@ -141,6 +141,6 @@ paths: examples: application/json: {"what": "unknown host type"} 500: - description: "Other errors" + description: "Other errors." examples: application/json: {"what": "database error"}