[Iplant-api-dev] enum_values Format

Dennis Roberts dennis at iplantcollaborative.org
Thu Aug 14 15:01:31 MST 2014


The part that I don’t understand is why the enumeration values are returned as JSON objects by the app listing service. This would seem to imply that there’s some difference between the keys and the values in the JSON objects, but I don’t know what the key and value are supposed to represent. When I submit the enum_values field as a list of strings:

    “enum_values”: [ “foo”, “bar”, “baz” ]

then the app listing service uses the strings for the key and the value in the JSON objects that are returned:

    “enum_values”: [
        { “foo”: “foo” },
        { “bar”: “bar” },
        { “baz”: “baz” }
    ]

In this case, it doesn’t really matter if there’s a distinction between the two, but I can also submit app descriptions in the format returned by the app listing service using different strings for the key and value of each JSON object:

    “enum_values”: [
        { “foo”: “quux” },
        { “bar”: “blrfl” },
        { “baz”: “blargh” }
    ]

The option that seems to make the most sense to me is that the key for each list item is the display value and that the value for each list item is the value to be passed to the app, but I don’t know if that’s the case.

Thanks,
Dennis

On Aug 14, 2014, at 2:38 PM, Rion Dooley <dooley at tacc.utexas.edu> wrote:

> Enumerated values give an easier way to define select boxes with custom labels and values, tell consumers that they need to pick from a well-defined range of values, and cleanly support multiple selections.
> 
> --
> Rion
> 
> 
> 
> 
> On Aug 14, 2014, at 4:16 PM, Dennis Roberts <dennis at iplantcollaborative.org> wrote:
> 
>> My job completed, and it looks like my assumption was incorrect. The value that was passed to the app was the same value that I passed in. Since this is the case, what is the purpose of defining enumeration values using JSON objects? I’m sure I’m missing something, but I don’t know exactly what it is yet.
>> 
>> Thanks,
>> Dennis
>> 
>> On Aug 14, 2014, at 1:50 PM, Dennis Roberts <dennis at iplantcollaborative.org> wrote:
>> 
>>> It appears that Agave accepts JSON objects for enumeration values. I assume that the key of each JSON object is the display value and that the value of each JSON object is the value that is passed to the app, but I haven’t been able to confirm that yet. (I submitted a job to find out, but it’s still pending.) Is my assumption correct?
>>> 
>>> Thanks,
>>> Dennis
>>> 
>> 
>> 
>> _______________________________________________
>> Iplant-api-dev Mailing List: Iplant-api-dev at iplantcollaborative.org
>> List Info and Archives: http://mail.iplantcollaborative.org/mailman/listinfo/iplant-api-dev  
>> One-click Unsubscribe: http://mail.iplantcollaborative.org/mailman/options/iplant-api-dev/dooley%40tacc.utexas.edu?unsub=1&unsubconfirm=1 
> 




More information about the Iplant-api-dev mailing list