import java.util.Map;
+import org.codehaus.jackson.map.DeserializationConfig;
import org.codehaus.jackson.map.ObjectMapper;
import org.openecomp.sdc.be.datatypes.elements.ConsumerDataDefinition;
import org.openecomp.sdc.be.model.User;
String bodyToParse = restResponse.getResponse();
ObjectMapper mapper = new ObjectMapper();
try {
+ mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
ConsumerDataDefinition component = mapper.readValue(bodyToParse, ConsumerDataDefinition.class);
return component;
} catch (Exception e) {
mapper.registerModule(module);
ComponentInstanceProperty propertyDefinition = null;
try {
+ mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
propertyDefinition = mapper.readValue(response, ComponentInstanceProperty.class);
logger.debug(propertyDefinition.toString());
} catch (IOException e) {
ObjectMapper mapper = new ObjectMapper();
ArtifactDefinition artifactDefinition = null;
try {
-
+ mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
artifactDefinition = mapper.readValue(response, ArtifactDefinition.class);
logger.debug(artifactDefinition.toString());
} catch (IOException e) {
JsonDeserializer<PropertyConstraint> desrializer = new PropertyConstraintJacksonDeserialiser();
addDeserializer(module, PropertyConstraint.class, desrializer);
mapper.registerModule(module);
+ mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
try {
object = mapper.readValue(json, clazz);
// System.out.println("Class: "+clazz.getSimpleName()+", json:
mapper.registerModule(module);
Service service = null;
try {
+// TODO Andrey L. uncomment line below in case to ignore on unknown properties, not recommended, added by Matvey
+ mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
service = mapper.readValue(response, Service.class);
logger.debug(service.toString());
} catch (IOException e) {
Product product = null;
try {
+ mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
product = mapper.readValue(response, Product.class);
logger.debug(product.toString());
} catch (IOException e) {
mapper.registerModule(module);
ComponentInstance componentInstance = null;
try {
+ mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
componentInstance = mapper.readValue(response, ComponentInstance.class);
logger.debug(componentInstance.toString());
} catch (IOException e) {