Allow a subordinate entry resource under a resource where there would normally be a field
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
High
|
Barry Warsaw | ||
lazr.restful |
Fix Released
|
High
|
Barry Warsaw |
Bug Description
We've designed our field resources based around the example of IBug.owner. Every bug has an owner but the owner can be any person at all. It makes sense to get bugs/1/owner to find out who the owner is, or PUT bugs/1/owner to change the owner.
But there's another use case, exemplified by IBranch.
It would make more sense if /branches/[branch name]/code_import designated a subordinate entry resource instead of a field resource.
In the meantime, a workaround: if you're in this situation there's a one-to-one relationship between the parent resource (IBranch) and the subordinate (ICodeImport). Do they really need to be separate resources just because they're separate in the underlying application? Maybe it makes sense to give IBranch the fields of ICodeImport and delegate reads and writes to the underlying object.
Related branches
- Curtis Hovey (community): Approve (code)
- Diff: None lines
Changed in launchpad-registry: | |
importance: | Undecided → Low |
status: | New → Triaged |
Changed in lazr.restful: | |
status: | Triaged → Fix Committed |
importance: | Undecided → High |
status: | Fix Committed → Fix Released |
Changed in launchpad-registry: | |
status: | Triaged → Fix Released |
assignee: | nobody → Barry Warsaw (barry) |
Changed in lazr.restful: | |
assignee: | nobody → Barry Warsaw (barry) |
milestone: | none → 0.9.2 |
Changed in launchpad-registry: | |
importance: | Low → High |
milestone: | none → 2.2.8 |
AFIACT, this is already supported. You just have to make sure that the web application can traverse to <branch> /code_import. Field navigation only kicks in after the regular web application traversal has taken place.
So adding the proper navigation to Branch to get to code_import would be work.