Implementation of REST POST API for creating intents
- codec for constraint decode
- codec for intent decode
- POST method for intents
- unit tests for codecs and POST method

Change-Id: Ibc0ef8f99a0c0664710a733985424c77010c49b5
diff --git a/core/common/src/main/java/org/onosproject/codec/impl/TrafficTreatmentCodec.java b/core/common/src/main/java/org/onosproject/codec/impl/TrafficTreatmentCodec.java
index edfe10c..0d7fb42 100644
--- a/core/common/src/main/java/org/onosproject/codec/impl/TrafficTreatmentCodec.java
+++ b/core/common/src/main/java/org/onosproject/codec/impl/TrafficTreatmentCodec.java
@@ -68,7 +68,7 @@
         if (instructionsJson != null) {
             IntStream.range(0, instructionsJson.size())
                     .forEach(i -> builder.add(
-                            instructionsCodec.decode((ObjectNode) instructionsJson.get(i),
+                            instructionsCodec.decode(get(instructionsJson, i),
                                     context)));
         }
         return builder.build();