Uploaded image for project: 'Configuration Persistence Service'
  1. Configuration Persistence Service
  2. CPS-893

NCMP Java API depends on NCM-Rest-API (cyclic) through json properties on Java API

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • Jakarta Release
    • Jakarta Release
    • NCMP
    • 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   
       

            dylanb95est dylanb95est
            ToineSiebelink Toine Siebelink
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: