Merge lp:~leonardr/lazr.restful/431986-field-resource-link into lp:lazr.restful
Proposed by
Leonard Richardson
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~leonardr/lazr.restful/431986-field-resource-link |
Merge into: | lp:lazr.restful |
Diff against target: |
104 lines 5 files modified
src/lazr/restful/NEWS.txt (+6/-0) src/lazr/restful/_resource.py (+1/-1) src/lazr/restful/example/base/tests/field.txt (+30/-0) src/lazr/restful/publisher.py (+9/-0) src/lazr/restful/version.txt (+1/-1) |
To merge this branch: | bzr merge lp:~leonardr/lazr.restful/431986-field-resource-link |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul Hummer (community) | Approve | ||
Review via email: mp+12357@code.launchpad.net |
To post a comment you must log in.
This branch fixes bug 431986 by making it possible to navigate to the field resource at /entry/foo_link or /entry/ foo_collection_ link.
Here's how it should work (and does work with this branch):
1. /bugs/1/owner points to an entry resource. If you GET that object you get a JSON dictionary. If you PATCH it you should send a JSON dictionary. (Though you should really PATCH the user's self_link so you're modifying it at the canonical location.)
2. /bugs/1/owner_link points to a field resource. If you GET that object you'll get a JSON-encoded string, containing the canonical URL of the bug's owner. If you PATCH it you can change which user is the bug's owner.
Previously, you could not navigate to owner_link at all. There was a hack (I don't remember the details) that would let you navigate to owner_link, but even then you couldn't PATCH the field because the resource class was using the internal schema name ("owner") instead of the web service schema name ("owner_link"). So you'd try to PATCH owner_link and get "No such field: owner". This branch fixes both problems.