Skip to content

Commit

Permalink
revert swagger changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Yinnii committed Oct 4, 2024
1 parent aba0b34 commit ed0f7fd
Showing 1 changed file with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1463,20 +1463,17 @@ public JSONObject getSwagger(){
JSONObject swagger = new JSONObject();
String uri = webconnectorUrl + "/SBFManager/v3/api-docs";
RestTemplate restTemplate = new RestTemplate();
String result = restTemplate.getForObject(uri, String.class);
JSONParser parser = new JSONParser(JSONParser.MODE_PERMISSIVE);
JSONObject resultJson = new JSONObject();
try {
resultJson = (JSONObject) parser.parse(result);
} catch (ParseException e) {
JSONObject result = restTemplate.getForObject(uri, JSONObject.class);
try{
swagger.put("swagger", "2.0");
swagger.put("info", result.get("info"));
swagger.put("basePath", "/SBFManager");
swagger.put("paths", result.get("paths"));
return swagger;
} catch (Exception e){
e.printStackTrace();
return null;
}

swagger.put("swagger", "2.0");
swagger.put("info", resultJson.get("info"));
swagger.put("basePath", "/SBFManager");
swagger.put("paths", resultJson.get("paths"));
return swagger;
}

}

0 comments on commit ed0f7fd

Please sign in to comment.