Bug 845244
| Summary: | links in JSON results are difficult to navigate | ||
|---|---|---|---|
| Product: | [JBoss] JBoss Operations Network | Reporter: | Alan Santos <asantos> |
| Component: | REST | Assignee: | Heiko W. Rupp <hrupp> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | |
| Severity: | medium | Docs Contact: | |
| Priority: | high | ||
| Version: | JON 3.1.0 | CC: | kejohnso, mfoley, myarboro |
| Target Milestone: | ER01 | ||
| Target Release: | JON 3.2.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-01-02 20:33:21 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
Heiko please comment... 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": {
"href":"http://localhost:7080/rest/resource/10001/children"
}
}
As this is MODIFIED or ON_QA, setting milestone to ER1. verified |
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": "http://127.0.0.1:7080/rest/1/operation/definitions?resourceId=10001" }, 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: e.g. A resaonable summary of the issue and suggestions http://caines.ca/blog/programming/json-is-under-defined-for-rest/ see HAL - the Hypertext Application Language http://stateless.co/hal_specification.html see this post where a facebook engineer describes their use: http://montrics.blogspot.com/2010/05/web-linking-in-json.html