Skip to content

Commit

Permalink
- Remove api version check
Browse files Browse the repository at this point in the history
  • Loading branch information
rathnapandi committed Oct 23, 2024
1 parent 007b472 commit ac252eb
Showing 1 changed file with 2 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,6 @@ public class APIManagerAPIAdapter {
Map<APIFilter, String> apiManagerResponse = new HashMap<>();
ObjectMapper mapper = new ObjectMapper();
private final CoreParameters cmd;
private final List<String> queryStringPassThroughBreakingVersion = Arrays.asList("7.7.20220530", "7.7.20220830", "7.7.20221130", "7.7.20230228", "7.7.20230530", "7.7.20230830", "7.7.20231130", "7.7.20240228", "7.7.20240530");

/**
* Maps the provided status to the REST-API endpoint to change the status!
*/


public APIManagerAPIAdapter() {
cmd = CoreParameters.getInstance();
Expand Down Expand Up @@ -211,7 +205,7 @@ public String getVersion(APIFilter apiFilter) {
}

private List<API> filterAPIs(APIFilter filter) throws IOException {
List<API> apis = mapper.readValue(this.apiManagerResponse.get(filter), new TypeReference<List<API>>() {
List<API> apis = mapper.readValue(this.apiManagerResponse.get(filter), new TypeReference<>() {
});
apis.removeIf(filter::filter);

Expand Down Expand Up @@ -572,12 +566,8 @@ public API createAPIProxy(API api) throws AppException {

public API updateAPIProxy(API api) throws AppException {
LOG.debug("Updating API-Proxy: {} {} ( {} )", api.getName(), api.getVersion(), api.getId());
String[] serializeAllExcept = getSerializeAllExcept();
mapper.setSerializationInclusion(Include.NON_NULL);
FilterProvider filter = new SimpleFilterProvider().setDefaultFilter(
SimpleBeanPropertyFilter.serializeAllExcept(serializeAllExcept));
mapper.registerModule(new SimpleModule().setSerializerModifier(new APIImportSerializerModifier()));
mapper.setFilterProvider(filter);
mapper.registerModule(new SimpleModule().setSerializerModifier(new PolicySerializerModifier(false)));
translateMethodIds(api, api.getId(), METHOD_TRANSLATION.AS_ID);
try {
Expand All @@ -598,16 +588,7 @@ public API updateAPIProxy(API api) throws AppException {
}
}

public String[] getSerializeAllExcept() throws AppException {
String[] serializeAllExcept;
// queryStringPassThrough added in inboundProfiles on API manager version 7.7.20220530
if (queryStringPassThroughBreakingVersion.contains(APIManagerAdapter.getInstance().getApiManagerVersion())) {
serializeAllExcept = new String[]{"apiDefinition", "certFile", "useForInbound", "useForOutbound", "organization", "applications", "image", "clientOrganizations", "applicationQuota", "systemQuota", "backendBasepath", "remoteHost"};
} else {
serializeAllExcept = new String[]{"queryStringPassThrough", "apiDefinition", "certFile", "useForInbound", "useForOutbound", "organization", "applications", "image", "clientOrganizations", "applicationQuota", "systemQuota", "backendBasepath", "remoteHost"};
}
return serializeAllExcept;
}


public void deleteAPIProxy(API api) throws AppException {
LOG.debug("Deleting API-Proxy with Name : {} and Id: {}", api.getName(), api.getId());
Expand Down

0 comments on commit ac252eb

Please sign in to comment.