← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14546: web-api: don't include objects is none of the properties actually exists in schema

 

------------------------------------------------------------
revno: 14546
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-03-31 12:22:34 +0700
message:
  web-api: don't include objects is none of the properties actually exists in schema
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/filter/DefaultFilterService.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/filter/DefaultFilterService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/filter/DefaultFilterService.java	2014-03-26 15:02:47 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/filter/DefaultFilterService.java	2014-03-31 05:22:34 +0000
@@ -178,13 +178,21 @@
                     for ( Object obj : objects )
                     {
                         Map<String, Object> properties = buildObjectOutput( obj, value );
-                        arrayList.add( properties );
+
+                        if ( !properties.isEmpty() )
+                        {
+                            arrayList.add( properties );
+                        }
                     }
                 }
                 else
                 {
                     Map<String, Object> properties = buildObjectOutput( returned, value );
-                    output.put( key, properties );
+
+                    if ( !properties.isEmpty() )
+                    {
+                        output.put( key, properties );
+                    }
                 }
             }
         }