Bug #60 : JSON list responses from the NB-APIs returns native object (instead of... 31/1131/3
authorMadhu Venugopal <vmadhu@cisco.com>
Mon, 9 Sep 2013 12:00:39 +0000 (05:00 -0700)
committerGiovanni Meo <gmeo@cisco.com>
Tue, 10 Sep 2013 09:55:38 +0000 (11:55 +0200)
commit468405c27b007e896bf12713651ae383740b6c2c
treeba1f7249b75accfc6fac2d58f96266df327664d7
parent119b994019d7c8b9af8f65e200e8afa68baa2b6e
Bug #60 : JSON list responses from the NB-APIs returns native object (instead of List) when the API returns a single element.

We use Jersey and JAXB frameworks for the NB-API implementation.
Jersey by default uses Jettison for the JSON marshalling/demarshalling. It seems like there is a bug in Jettison for this case.
And the recommended approach is to use Jackson instead.
Among various approaches to replace Jettison with Jackson (including package scanning, etc..), the only easy approach in an
OSGi environment is to directly refer to the JerseyJaxbJsonProvider class from the Northbound application.
JerseyJaxbJsonProvider has dependancies on jersey-xc which is also pulled in.

The Northbound Integration Test has inbuilt assumption that the NB-APIs use Jettison & hence a whole bunch of such bugs were
hidden and not visible to the tests as well. The correct approach is to use JAXB bindings in the IT so that immaterial of
Jettison or Jackson as the NB Marshalling infra, the IT need not change.
But, that is a bigger change and hence to restrict to the changes being addressed, this changeset just fixed these incorrect
assumptions and continued to use the Jettison library for demarshalling (while the actual Northbound API uses Jackson).

Also note that, such infra changes call for bumping both the NB-API version and the bundle version.
But, given the fact that the API freeze is scheduled later in October and more NB related changes are coming, the version bump
process can be scheduled later to ease the development work.

Change-Id: I47d8309dfbe11c251a30316bca37c7823cb0325a
Signed-off-by: Madhu Venugopal <vmadhu@cisco.com>
31 files changed:
opendaylight/commons/opendaylight/pom.xml
opendaylight/northbound/flowprogrammer/pom.xml
opendaylight/northbound/flowprogrammer/src/main/java/org/opendaylight/controller/flowprogrammer/northbound/FlowProgrammerNorthbound.java
opendaylight/northbound/flowprogrammer/src/main/java/org/opendaylight/controller/flowprogrammer/northbound/FlowProgrammerNorthboundRSApplication.java
opendaylight/northbound/hosttracker/pom.xml
opendaylight/northbound/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/northbound/HostTrackerNorthbound.java
opendaylight/northbound/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/northbound/HostTrackerNorthboundRSApplication.java
opendaylight/northbound/integrationtest/pom.xml
opendaylight/northbound/integrationtest/src/test/java/org/opendaylight/controller/northbound/integrationtest/NorthboundIT.java
opendaylight/northbound/networkconfiguration/bridgedomain/pom.xml
opendaylight/northbound/networkconfiguration/bridgedomain/src/main/java/org/opendaylight/controller/networkconfig/bridgedomain/northbound/BridgeDomainNorthboundApplication.java
opendaylight/northbound/staticrouting/pom.xml
opendaylight/northbound/staticrouting/src/main/java/org/opendaylight/controller/forwarding/staticrouting/northbound/StaticRoutingNorthbound.java
opendaylight/northbound/staticrouting/src/main/java/org/opendaylight/controller/forwarding/staticrouting/northbound/StaticRoutingNorthboundRSApplication.java
opendaylight/northbound/statistics/pom.xml
opendaylight/northbound/statistics/src/main/java/org/opendaylight/controller/statistics/northbound/StatisticsNorthboundRSApplication.java
opendaylight/northbound/subnets/pom.xml
opendaylight/northbound/subnets/src/main/java/org/opendaylight/controller/subnets/northbound/SubnetConfigs.java
opendaylight/northbound/subnets/src/main/java/org/opendaylight/controller/subnets/northbound/SubnetsNorthbound.java
opendaylight/northbound/subnets/src/main/java/org/opendaylight/controller/subnets/northbound/SubnetsNorthboundRSApplication.java
opendaylight/northbound/switchmanager/pom.xml
opendaylight/northbound/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/northbound/SwitchNorthboundRSApplication.java
opendaylight/northbound/topology/pom.xml
opendaylight/northbound/topology/src/main/java/org/opendaylight/controller/topology/northbound/TopologyNorthboundJAXRS.java
opendaylight/northbound/topology/src/main/java/org/opendaylight/controller/topology/northbound/TopologyNorthboundRSApplication.java
opendaylight/northbound/topology/src/main/java/org/opendaylight/controller/topology/northbound/TopologyUserLinks.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/action/Action.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/TimeStamp.java
opendaylight/samples/northbound/loadbalancer/pom.xml
opendaylight/samples/northbound/loadbalancer/src/main/java/org/opendaylight/controller/samples/loadbalancer/northbound/LoadBalancerNorthbound.java
opendaylight/samples/northbound/loadbalancer/src/main/java/org/opendaylight/controller/samples/loadbalancer/northbound/LoadBalancerNorthboundRSApplication.java