← Back to team overview

dhis2-users team mailing list archive

Re: API 2.25: Return Full Property Set

 

Hi Jason,

simple example: 
https://play.dhis2.org/demo/api/organisationUnits.json?paging=false&filter=level:eq:3&fields=name,comment

What I'd expect would be a json package with name & comment for ALL organisationUnits, even when the comment is NULL. What I get is a comment property for Badjia (which I created for the example), for all the other I only get the name property:
[{"name":"Badjia","comment":"This is a comment."},{"name":"Bagruwa"},{"name":"Baoma"}...]

Converting this package in kettle would result to an error message that 50 (or whatever) instances of name were found, but only 1 instance of comment. kettle expects always the complete set of properties for all objects. Not sure how R or others handle this ...

If there was a query parameter like returnNull=true , that could give back the null properties like {"name":"Bagruwa","comment":""}, it would be possible to work with these packages. Actually I had expected this to be the default behaviour, when specifying fields.

Best regards, 

Uwe

---

> Jason Pickering <jason.p.pickering@xxxxxxxxx> hat am 16. Dezember 2016 um 12:05 geschrieben:
> 
> 
> Hi Uwe,
> Could you give a specific example from the demo server with an API call,
> and what is not working as you expect?
> 
> Regards,
> Jason
> 
> 
> On Fri, Dec 16, 2016 at 8:48 AM, Uwe Wahser <uwe@xxxxxxxxx> wrote:
> 
> > Sorry, on a closer look it only seems to work for empty collections.
> > Properties of the object itself (e.g. email, comments of organizationUnits)
> > are still left out.
> >
> > The floor is open again for other suggestions :-)
> >
> > Regards, Uwe
> >
> > > Uwe Wahser <uwe@xxxxxxxxx> hat am 16. Dezember 2016 um 10:24
> > geschrieben:
> > >
> > >
> > > Thanks a lot, Jason, I will try that. I tried 'fields=' expecting this
> > would be the same as 'fields=:all' , which is obviously wrong.
> > >
> > > That's a very useful information - do you mind including it into the
> > manual?
> > >
> > > Regards, Uwe
> > >
> > > ---
> > >
> > > > Jason Pickering <jason.p.pickering@xxxxxxxxx> hat am 16. Dezember
> > 2016 um 10:13 geschrieben:
> > > >
> > > >
> > > > Hi Uwe
> > > > Have a look here
> > > >
> > > > https://ci.dhis2.org/docs/master/en/developer/html/
> > webapi_metadata_field_filter.html
> > > >
> > > > and specifically the use of  the ?fields=:all paramater.
> > > >
> > > > Regards,
> > > > Jason
> > > >
> > > >
> > > > On Fri, Dec 16, 2016 at 7:58 AM, Uwe Wahser <uwe@xxxxxxxxx> wrote:
> > > >
> > > > > Dear all,
> > > > >
> > > > > I am having a bit of an issue when querying metadata from the api in
> > json
> > > > > format and further processing them in kettle (Pentaho DI): DHIS2 only
> > > > > returns those properties in the json-package that are not NULL.
> > However,
> > > > > the json converter in kettle needs the full property-set in order to
> > create
> > > > > a tabular structure from the data (don't know the reason for that).
> > > > >
> > > > > Is there a way to force the api to return the full property set,
> > e.g. a
> > > > > secret flag? I'd actually expect to get the full list - even if the
> > > > > property is NULL -, at least when I specify a list of properties in
> > the
> > > > > field-filter ...
> > > > >
> > > > > Of course, I could also ask the kettle-guys to be a bit more
> > flexible, but
> > > > > normally they are not as agile as the DHIS2-DEVs ;-)
> > > > >
> > > > > Best regards,
> > > > >
> > > > > Uwe
> > > > >
> > > > > _______________________________________________
> > > > > Mailing list: https://launchpad.net/~dhis2-users
> > > > > Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
> > > > > Unsubscribe : https://launchpad.net/~dhis2-users
> > > > > More help   : https://help.launchpad.net/ListHelp
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Jason P. Pickering
> > > > email: jason.p.pickering@xxxxxxxxx
> > > > tel:+46764147049
> > >
> > > _______________________________________________
> > > Mailing list: https://launchpad.net/~dhis2-users
> > > Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
> > > Unsubscribe : https://launchpad.net/~dhis2-users
> > > More help   : https://help.launchpad.net/ListHelp
> >
> 
> 
> 
> -- 
> Jason P. Pickering
> email: jason.p.pickering@xxxxxxxxx
> tel:+46764147049


Follow ups

References