Bug 845244 - links in JSON results are difficult to navigate
links in JSON results are difficult to navigate
Product: JBoss Operations Network
Classification: JBoss
Component: REST (Show other bugs)
JON 3.1.0
Unspecified Unspecified
high Severity medium
: ER01
: JON 3.2.0
Assigned To: Heiko W. Rupp
Depends On:
  Show dependency treegraph
Reported: 2012-08-02 08:51 EDT by Alan Santos
Modified: 2015-02-05 20:19 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-01-02 15:33:21 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Alan Santos 2012-08-02 08:51:47 EDT
Description of problem:

When a resource is returned as JSON the associated links are modeled as an array with a 'rel' and 'href' tag. 

"links": [
                "rel": "operationDefinitions",
                "href": ""

While this follows the HATEOS convention it's unnecessarily tedious to navigate and discover the semantics of each link.  I can't pick a known relation; I have to iterate an array, pick the 'rel' key and evaluate. 

Though there's no standard mechanism to express links with JSON there's some consensus that the current pattern is not friendly and other patterns are available that follow HATEOS conventions and are more accessible. 

Additional info:
A resaonable summary of the issue and suggestions

see HAL - the Hypertext Application Language

see this post where a facebook engineer describes their use:
Comment 1 mark yarborough 2013-03-04 17:12:40 EST
Heiko please comment...
Comment 2 Heiko W. Rupp 2013-03-07 07:21:28 EST
Changed in master 1913e7e27d495

This was less than trivial, as the standard jax-rs way does not allow for this.

Links now look like this:

  "children": {
Comment 3 Larry O'Leary 2013-09-06 10:30:13 EDT
As this is MODIFIED or ON_QA, setting milestone to ER1.
Comment 4 Mike Foley 2013-09-13 14:08:43 EDT

Note You need to log in before you can comment on or make changes to this bug.