File tree Expand file tree Collapse file tree 2 files changed +0
-27
lines changed
src/main/java/org/dynapi/openapispec/core Expand file tree Collapse file tree 2 files changed +0
-27
lines changed Original file line number Diff line number Diff 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 */
Original file line number Diff line number Diff line change 33import org .json .JSONArray ;
44import org .json .JSONObject ;
55
6- import java .util .HashMap ;
76import java .util .List ;
87import java .util .Map ;
98import java .util .stream .Collectors ;
1211 * Utility methods that are used throughout the project
1312 */
1413public 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
You can’t perform that action at this time.
0 commit comments