Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Resources affording other resources actions (linking) #288

Open
zdne opened this issue Dec 9, 2015 · 2 comments
Open

Resources affording other resources actions (linking) #288

zdne opened this issue Dec 9, 2015 · 2 comments

Comments

@zdne
Copy link
Contributor

zdne commented Dec 9, 2015

Given this blueprint (currently valid syntax):

# Author [/author/{id}]
- Parameters
    - id (number) - Id of the author
- Attributes
    - email (string) - Email of the author

## Retrieve Author [GET]
- Relation: self
- Response 200 (application/json)   
    - Attributes (Author)

I want to be able express that another resource affords the "Retrieve Author" action without the need to duplicate the "Retrieve Author".

For example like this:

# Blog Post [/blogpost/{id}]
- Parameters
    - id (number) - Id of the Blog Post
- Attributes
    - content (string) - Content of the Blog Post

## Retrieve [GET]
- Relation: self
- Response 200 (application/json)   
    - Attributes (Blog Post)

## Action Retrieve Gist Author 
- Relation: author (Author[self])

This enables linking of the resources and hence HATEOAS description.

To be addressed in draft APIB RFC

@pksunkara
Copy link
Contributor

Can you please update the last part of the second example? It's not exactly clear. Is it an action?

@zdne
Copy link
Contributor Author

zdne commented Dec 10, 2015

@pksunkara that is just a sketch of my idea. Yes, it is introducing the Action keyword (so you do not have to specify a method)

@zdne zdne changed the title Resources affording other resource actions (linking) Resources affording other resources actions (linking) Dec 10, 2015
This was referenced Dec 10, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants