Skip to content

Commit 04042b2

Browse files
committed
removed ResponseBuilder#descriptionForStatus
1 parent c9d8600 commit 04042b2

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

src/main/java/org/dynapi/openapispec/core/ResponseBuilder.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@ public class ResponseBuilder {
2020
private final Map<String, Header> headers = new HashMap<>();
2121
private final Map<String, MediaType> content = new HashMap<>();
2222

23-
/**
24-
* sets the description based of the status code
25-
* @param status http-status code
26-
*/
27-
public ResponseBuilder descriptionForStatus(int status) {
28-
return description(Utils.statusCodeToText(status));
29-
}
30-
3123
/**
3224
* @param description description of this response
3325
*/

src/main/java/org/dynapi/openapispec/core/Utils.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import org.json.JSONArray;
44
import org.json.JSONObject;
55

6-
import java.util.HashMap;
76
import java.util.List;
87
import java.util.Map;
98
import java.util.stream.Collectors;
@@ -12,24 +11,6 @@
1211
* Utility methods that are used throughout the project
1312
*/
1413
public class Utils {
15-
private final static Map<Integer, String> code2text = new HashMap<>();
16-
17-
static {
18-
code2text.put(1, "Informational");
19-
code2text.put(2, "Successful Operation");
20-
code2text.put(3, "Redirect");
21-
code2text.put(4, "Bad Request");
22-
code2text.put(5, "Server Error");
23-
}
24-
25-
/**
26-
* @param status http status-code
27-
* @return http response class
28-
*/
29-
public static String statusCodeToText(int status) {
30-
return code2text.getOrDefault(status / 100, "Unknown Operation");
31-
}
32-
3314
/**
3415
* returns null or openapi-spec
3516
* @param specAble object to get the OpenApi-Spec from

0 commit comments

Comments
 (0)