|
|
@ -88,8 +88,8 @@ public class APIPublisherServiceImpl implements APIPublisherService {
|
|
|
|
provider.updateAPI(api);
|
|
|
|
provider.updateAPI(api);
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
log.debug("An API already exists with the name '" + api.getId().getApiName() +
|
|
|
|
log.debug("An API already exists with the name '" + api.getId().getApiName() +
|
|
|
|
"', context '" + api.getContext() + "' and version '"
|
|
|
|
"', context '" + api.getContext() + "' and version '"
|
|
|
|
+ api.getId().getVersion() + "'. Thus, the API config is updated");
|
|
|
|
+ api.getId().getVersion() + "'. Thus, the API config is updated");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|