-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Resources Relations #88
Comments
Several comments:
|
Ad 2
Correct. Ad 3Yes, this proposal is indeed meant to give you the option to list every relation (or affordance, if you will 😄) available for the resource, should you choose to design your API this way. This is could be beneficial for many things including:
Note the relation name should be covered in the Action specification (either equal to its name, or explicitly defined). If you are interested in this direction of API architectural style you can find more on it here. |
Inline actions... When could we expect this? As it is a requirement for my API. |
@dubcanada there is no ETA on this yet, but I would like to see some progress on this around the Q3-Q4. Would you please care elaborate on what are your expectations of it – why do you require such a functionality? Thanks! |
What's the current method for representing the following:
I want one top-level "Entity" resource that describes the actions as laid out above. I guess this is what the suggested inline actions are for. At the moment, it seems like I need to specify 2 top-level resources, one at /entity and the other at /entity/{id}. Is this correct? |
Currently, in a resource description, it is possible to describe only actions that are performed with the respective resource. Put in contrast offering (affording) actions on a resource that are not directly manipulating the resource in question – this is something this issue should cover. Please see this question at Stack Overflow. Moving forward. With this feature implemented you will be able to add an arbitrary action to a resource even it is not manipulating the respective resource directly (
With this, the idea is the |
Thanks for responding so promptly. I agree that each distinct URI is a separate resource but to me, a single entity (as in the concept) is what is being added; I see the entity as an individual representation of an instance of the model. Practically, if I use the suggested (and perhaps semantically more appropriate) alternative with a collection that has query parameters, they are "inherited" by the creation action:
Results in a create action URI of:
|
This is a bug in current Apiary documentation. If you do discuss these parameters under let's say a GET section of We are currently working on the fix. |
So if the blueprint would be something like this
You should really see only |
Just for clarity, that's basically exactly what I have: Thanks for confirming that it is a bug and not simply misunderstanding on my part. |
@psynaptic yep that looks correct! The bug is on our side – sorry about this I will do my best to fix this as soon as possible! |
@psynaptic the parameters rendering bug discussed here #88 (comment) has been fixed in Apiary. |
Any idea when it will be fixed on Apiary site? |
@zdne Just to be clear. Is this addressing the following scenario:
|
@fosrias not exactly, you still have to have a top-level resource defined e.g.
|
This would be a better example, however I would still recommend defining Update: I have edited the original post accordingly |
@zdne Concur on the separate resources. Probably was not paying close On Fri, Feb 20, 2015 at 4:36 AM, Z notifications@github.com wrote:
|
What if I want it to be separate API Blueprint Resource? The use case here is that I want to have a Resource which contains only 1 action. So, instead of writing Resource header and Action header, I want to combine them both in a single line. |
Both "inline actions": ## Create New Task [POST /tasks] and "action relation types": + Relation: create are now supported in Apiary (as of 1A8). Please let us know how do you like these new features! Also refer to: |
Expressing relations between resources through available actions (affordances).
Currently a resource can define only actions defined on the respective resource.
However, in reality, a resource may afford an actions that are not limited to the resource itself.
Inline Action
In-place definition of another Resource.
This section would follow standard rules for
Action Sections.
With the exception that a different URI may be used.
Defining an in-line action does not create a new API Blueprint Resource.
Relation Identifiers
Optionally it SHOULD be possible to specify additional link relation types as specified in the RFC 5988.
The syntax should be:
For example:
Update: Referencing another actions is not planned at the moment
Referencing Another Resource's ActionAffording another Resource action on this resource. Such a section would not have any other content except its definition.The text was updated successfully, but these errors were encountered: