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 1598a2c commit e3abd8d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,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> apis = mapper.readValue(this.apiManagerResponse.get(filter), new TypeReference<List<API>>() {
});
apis.removeIf(filter::filter);

Expand Down Expand Up @@ -566,11 +566,13 @@ 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().setFailOnUnknownId(false);
FilterProvider filter = new SimpleFilterProvider().setDefaultFilter(
SimpleBeanPropertyFilter.serializeAllExcept(serializeAllExcept));
mapper.registerModule(new SimpleModule().setSerializerModifier(new APIImportSerializerModifier()));
mapper.registerModule(new SimpleModule().setSerializerModifier(new PolicySerializerModifier(false)));
mapper.setFilterProvider(filter);
mapper.registerModule(new SimpleModule().setSerializerModifier(new PolicySerializerModifier(false)));
translateMethodIds(api, api.getId(), METHOD_TRANSLATION.AS_ID);
try {
URI uri = new URIBuilder(cmd.getAPIManagerURL()).setPath(cmd.getApiBasepath() + PROXIES + api.getId()).build();
Expand All @@ -590,7 +592,9 @@ public API updateAPIProxy(API api) throws AppException {
}
}


public String[] getSerializeAllExcept() {
return new String[]{"queryStringPassThrough", "apiDefinition", "certFile", "useForInbound", "useForOutbound", "organization", "applications", "image", "clientOrganizations", "applicationQuota", "systemQuota", "backendBasepath", "remoteHost"};
}

public void deleteAPIProxy(API api) throws AppException {
LOG.debug("Deleting API-Proxy with Name : {} and Id: {}", api.getName(), api.getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -810,9 +810,10 @@ public void updateAPIProxyWithBasicAuthEmptyPassword() throws IOException {
System.out.println(baseConfig.getAuthenticationProfiles());

ObjectMapper objectMapper = new ObjectMapper();

String[] serializeAllExcept = apiManagerAPIAdapter.getSerializeAllExcept();
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
FilterProvider filter = new SimpleFilterProvider().setFailOnUnknownId(false);
FilterProvider filter = new SimpleFilterProvider().setDefaultFilter(
SimpleBeanPropertyFilter.serializeAllExcept(serializeAllExcept));
objectMapper.setFilterProvider(filter);

System.out.println(objectMapper.writeValueAsString(baseConfig));
Expand Down

0 comments on commit e3abd8d

Please sign in to comment.