Fixing the empty methods for resources in the synapse configuration issue when auto publishing the apis for the REST service.

revert-70aa11f8
sinthuja 8 years ago
parent 00e57bd800
commit a6203845c9

@ -181,18 +181,10 @@ public class APIPublisherServiceImpl implements APIPublisherService {
* *
* @param api The actual API model object * @param api The actual API model object
*/ */
private void processHttpVerbs(API api){ private void processHttpVerbs(API api) {
for (URITemplate uriTemplate : api.getUriTemplates()){ for (URITemplate uriTemplate : api.getUriTemplates()) {
String httpVerbString = uriTemplate.getHTTPVerb(); String httpVerbString = uriTemplate.getHTTPVerb();
String[] httpVerbs = uriTemplate.getMethodsAsString().split(" "); if (httpVerbString != null && !httpVerbString.isEmpty()) {
boolean httpVerbStringExistsMethods = false;
for (String aHttpVerb: httpVerbs){
if (aHttpVerb.trim().equalsIgnoreCase(httpVerbString)){
httpVerbStringExistsMethods = true;
break;
}
}
if (!httpVerbStringExistsMethods){
uriTemplate.setHttpVerbs(httpVerbString); uriTemplate.setHttpVerbs(httpVerbString);
} }
} }

Loading…
Cancel
Save