From 1598a2ccb80111b16e3ba02facccb77f58100926 Mon Sep 17 00:00:00 2001 From: rathnapandi Date: Wed, 23 Oct 2024 15:08:36 -0700 Subject: [PATCH] - Remove api version check --- .../com/axway/apim/adapter/apis/APIManagerAPIAdapter.java | 2 ++ .../axway/apim/adapter/apis/APIManagerAPIAdapterTest.java | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/apim-adapter/src/main/java/com/axway/apim/adapter/apis/APIManagerAPIAdapter.java b/modules/apim-adapter/src/main/java/com/axway/apim/adapter/apis/APIManagerAPIAdapter.java index 01fe70b40..7235b7b74 100644 --- a/modules/apim-adapter/src/main/java/com/axway/apim/adapter/apis/APIManagerAPIAdapter.java +++ b/modules/apim-adapter/src/main/java/com/axway/apim/adapter/apis/APIManagerAPIAdapter.java @@ -567,8 +567,10 @@ 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()); mapper.setSerializationInclusion(Include.NON_NULL); + FilterProvider filter = new SimpleFilterProvider().setFailOnUnknownId(false); mapper.registerModule(new SimpleModule().setSerializerModifier(new APIImportSerializerModifier())); mapper.registerModule(new SimpleModule().setSerializerModifier(new PolicySerializerModifier(false))); + mapper.setFilterProvider(filter); translateMethodIds(api, api.getId(), METHOD_TRANSLATION.AS_ID); try { URI uri = new URIBuilder(cmd.getAPIManagerURL()).setPath(cmd.getApiBasepath() + PROXIES + api.getId()).build(); diff --git a/modules/apim-adapter/src/test/java/com/axway/apim/adapter/apis/APIManagerAPIAdapterTest.java b/modules/apim-adapter/src/test/java/com/axway/apim/adapter/apis/APIManagerAPIAdapterTest.java index 49bc02024..cc114fc3d 100644 --- a/modules/apim-adapter/src/test/java/com/axway/apim/adapter/apis/APIManagerAPIAdapterTest.java +++ b/modules/apim-adapter/src/test/java/com/axway/apim/adapter/apis/APIManagerAPIAdapterTest.java @@ -810,10 +810,9 @@ 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().setDefaultFilter( - SimpleBeanPropertyFilter.serializeAllExcept(serializeAllExcept)); + FilterProvider filter = new SimpleFilterProvider().setFailOnUnknownId(false); objectMapper.setFilterProvider(filter); System.out.println(objectMapper.writeValueAsString(baseConfig));