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/LinkCodec.java b/core/common/src/main/java/org/onosproject/codec/impl/LinkCodec.java
index 491d751..14ee9b7 100644
--- a/core/common/src/main/java/org/onosproject/codec/impl/LinkCodec.java
+++ b/core/common/src/main/java/org/onosproject/codec/impl/LinkCodec.java
@@ -70,8 +70,8 @@
// TODO: add providerId to JSON if we need to recover them.
ProviderId pid = new ProviderId("json", "LinkCodec");
- ConnectPoint src = codec.decode((ObjectNode) json.get(SRC), context);
- ConnectPoint dst = codec.decode((ObjectNode) json.get(DST), context);
+ ConnectPoint src = codec.decode(get(json, SRC), context);
+ ConnectPoint dst = codec.decode(get(json, DST), context);
Type type = Type.valueOf(json.get(TYPE).asText());
Annotations annotations = extractAnnotations(json, context);