Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Why is json "truncated" for enumerations if externalValue="" ?

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

0 votes



2 answers

Permanent link
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

0 votes

Comments

Done.   290470 in RTC


Permanent link
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

0 votes

Comments

As does giving externalValue a value.

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 516
× 137

Question asked: Nov 18 '13, 3:24 p.m.

Question was seen: 5,833 times

Last updated: Nov 21 '13, 11:47 a.m.

Confirmation Cancel Confirm