dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #30096
Re: SystemSettings API to post other data types
I think that is a good idea. Much appreciated if you take that on.
best regards,
Lars
On Thu, May 15, 2014 at 10:51 AM, Aravind Muralikrishnan <
aravindm@xxxxxxxxxxxxxxxx> wrote:
> Hi Lars,
>
> Sample payload looks like this:
>
> {
> "key0": true,
> "key1": "true"
> "key2": {
> "name": "some name"
> },
> "key3": 3
> }
>
> key0 will be stored as boolean, key1 will be stored as string, key2 will
> be stored as a map, key3 will be stored as integer.
>
> Thanks,
> Aravind
>
>
> On Thu, May 15, 2014 at 2:17 PM, Lars Helge Øverland <larshelge@xxxxxxxxx>wrote:
>
>> Hi Aravind,
>>
>> you are correct. We only support string based values in the API at the
>> moment, which is a weakness. I think your suggestion makes sense. Could you
>> provide an example payload with type information the way you envision it?
>>
>> best regards,
>>
>> Lars
>>
>>
>> On Thu, May 15, 2014 at 10:40 AM, Aravind Muralikrishnan <
>> aravindm@xxxxxxxxxxxxxxxx> wrote:
>>
>>> Hello all,
>>>
>>> While trying to store *"**keyHideUnapprovedDataInAnalytics"* as *false*using the system settings api, we realised that it stores it as a String,
>>> while the DefaultAnalyticsSecurityManager when reading the value back
>>> tries to type cast it to a Boolean and it fails.
>>>
>>> Right now, the system settings api does not expose an endpoint to store
>>> other data types except String.
>>>
>>> We were thinking of exposing another api all together, which can take a
>>> JSON as post body,
>>> ex: *{"keyHideUnapprovedDataInAnalytics":true}* and then store the
>>> values along with type information.
>>>
>>> Please suggest if there are better alternatives.
>>>
>>> Thanks,
>>> Aravind
>>>
>>> _______________________________________________
>>> Mailing list: https://launchpad.net/~dhis2-devs
>>> Post to : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>> More help : https://help.launchpad.net/ListHelp
>>>
>>>
>>
>
Follow ups
References