Added resource /streams/stream/<streamName>
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / main / java / org / opendaylight / controller / sal / rest / impl / JsonMapper.java
index ca318e4f3692d28da298810d0b4ff7272bc4f615..d1441d7b9d904a202ad90bfcc53d36c794ae993e 100644 (file)
@@ -203,7 +203,6 @@ class JsonMapper {
                     + baseType.getClass().getSimpleName() + ".");
         }
 
-        // TODO check InstanceIdentifierTypeDefinition
         if (baseType instanceof IdentityrefTypeDefinition) {
             if (node.getValue() instanceof QName) {
                 IdentityValuesDTO valueDTO = (IdentityValuesDTO) RestCodec.from(baseType, mountPoint).serialize(
@@ -252,14 +251,18 @@ class JsonMapper {
             result.append("/");
 
             writeModuleNameAndIdentifier(result, identityValue);
-            if (identityValue.getPredicates() != null) {
+            if (identityValue.getPredicates() != null && !identityValue.getPredicates().isEmpty()) {
                 for (Predicate predicate : identityValue.getPredicates()) {
                     IdentityValue identityValuePredicate = predicate.getName();
                     result.append("[");
-                    writeModuleNameAndIdentifier(result, identityValuePredicate);
-                    result.append("=\"");
+                    if (identityValuePredicate == null) {
+                        result.append(".");
+                    } else {
+                        writeModuleNameAndIdentifier(result, identityValuePredicate);
+                    }
+                    result.append("='");
                     result.append(predicate.getValue());
-                    result.append("\"");
+                    result.append("'");
                     result.append("]");
                 }
             }