Why is json "truncated" for enumerations if externalValue="" ?
Kevin Ramer (4.5k●9●186●201)
| asked Nov 18 '13, 3:24 p.m.
edited Nov 18 '13, 7:28 p.m. by Millard Ellingsworth (2.5k●1●24●31)
I spent some time this morning trying to figure out why an OSLC library I use began complaining about a null result on some enumeration literal or another. I figured out "why" but would like to understand why the json output will NOT contain literals which have externalValue="" on their definition ? [ I guess because they could not be distinguished from one another,otherwise ]
That is, if say priority has the following: <enumeration attributeTypeId="priority"> <literal default="true" externalValue="" icon="processattachment:/enumeration/unassigned.gif" id="priority.literal.l01" name="Unassigned"/> <literal externalValue="" icon="processattachment:/enumeration/low.gif" id="priority.literal.l02" name="Low"/> <literal externalValue="" icon="processattachment:/enumeration/medium.gif" id="priority.literal.l07" name="Medium"/> <literal externalValue="" icon="processattachment:/enumeration/high.gif" id="priority.literal.l11" name="High"/> </enumeration> Doing a REST call to get it (https://server:port/CONTEXT/oslc/enumerations/PROJECT_UUID/priority.json gives this: [ { "rdf:resource": "https://server:port/CONTEXT/oslc/enumerations/PROJECT_UUID/priority/priority.literal.l01", "dc:title": "Unassigned" } ] I have worked around this by setting the externalValue == id. Is removing the externalValue="" also an acceptable course ? I followed the above trail thanks to https://jazz.net/library/article/1002#enumerations RTC 4.0.3 |
2 answers
Bryan Miller - Integration Developer (449●35●31)
| answered Nov 19 '13, 1:58 p.m.
edited Nov 19 '13, 2:57 p.m.
Kevin,
We should collaborate on submitting a work item for this. It appears that there is a bookkeeping issue that OSLC cannot resolve. BTW, this is not isolated to JSON. We tried it with XML, etc and the data medium appears not to matter. It is an OSLC/REST issue. Cheers, Bryan |
Kevin,
When creating a new project area, the externalValue entries are not present on the enumeration definition. Adding externalValue="" to all the enumeration entries for priority causes the problem you've described to appear for both 4.0.3 and 4.0.6 M1. Removing externalValue="" from all the enumeration entries for priority allows all of the enumerations to be returned instead of just one for both 4.0.3 and 4.0.6 M1. Shawn |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.