Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hypermedia media types #291

Open
zdne opened this issue Dec 10, 2015 · 5 comments
Open

Hypermedia media types #291

zdne opened this issue Dec 10, 2015 · 5 comments

Comments

@zdne
Copy link
Contributor

zdne commented Dec 10, 2015

Using the information from the Attributes section and the Action section

The API Blueprint parser should be able to render Hypermedia media types on behalf of the user.

For example given following (pseudo) blueprint:

# Resource Blog Post
- attributes
    - content (string)

## Action Retrieve Blog Post
- relation: list (self)
- response 200 (application/hal+json)
    - Attributes (Blog Post)
    - Affordances
        - list
        - edit

## Action Edit Blog Post 
- relation: edit

The response message payload body could be generated as:

{
    "_links": {
        "self": {"href": "..."},
        "edit": {"href": "..."},
    },
    "content": "..."
}

Note this feature can be dramatically improved by implementing the #288 and #290 where the - Affordances could refer to a state (and therefore its collection of affordances):

- Response 200 (application/hal+json)
    - Attributes (Blog Post)
    - Affordances (Archived) 
@pksunkara
Copy link
Contributor

I love this part, Affordances could refer to a state. Simple but powerful.

@akuckartz
Copy link

First of all I would like to see support for application/ld+json.

@jamesdixon
Copy link

👍

This would be awesome! Just discovered Apiary and loving it so far, but would love to have the JSON API support.

Is there any progress on this? Would love to help out.

@zdne
Copy link
Contributor Author

zdne commented Feb 15, 2016

Hey @jamesdixon it is currently number 8 on the roadmap so no real progress just yet.

I guess next step is to start carving out the RFC for the specification. If you want to play with that and draft a syntax for capturing actions-affordances that would work together with the current actions that would be sweet

@jamesdixon
Copy link

Thanks, @zdne. I'll see what I can do as I start working with Apiary a bit more -- definitely need more time to familiarize myself with how things work. Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants