-
Bug
-
Resolution: Done
-
Medium
-
Jakarta Release
-
None
org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java
use objectMapper to convert REST-API objects to Java-API object:
private DmiPluginRegistration convertRestObjectToJavaApiObject( final RestDmiPluginRegistration restDmiPluginRegistration) { return objectMapper.convertValue(restDmiPluginRegistration, DmiPluginRegistration.class);
This depends on json property annotations (using REST API names!) in the Java API:
src/main/java/org/onap/cps/ncmp/api/models/CmHandle.java
public class CmHandle { @JsonProperty("*cmHandle*") private String cmHandleID; @JsonSetter(nulls = Nulls.AS_EMPTY) @JsonProperty("*cmHandleProperties*") private Map<String, String> dmiProperties = Collections.emptyMap(); }
So when the REST API changes the coversion to Java-API objects will fail unless the Java API is changed in the same way (json property names) The solution is to use POJO conversion instead! Teh json prpoerty annotation should be removed from