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

HATEOAS - Should Aye Aye Support it? #16

Closed
Gisleburt opened this issue Mar 10, 2015 · 1 comment
Closed

HATEOAS - Should Aye Aye Support it? #16

Gisleburt opened this issue Mar 10, 2015 · 1 comment
Assignees
Milestone

Comments

@Gisleburt
Copy link
Member

http://en.wikipedia.org/wiki/HATEOAS

I'm not a major fan of Hateoas as with every request for data it additionally tells you how the API works (rather than the Aye Aye way of having you just ask the Api how it works and when you ask for data you just get data).

It might be really good to support this in OPTIONS requests, which would be a good match with #15

@Gisleburt
Copy link
Member Author

This can be made to work using generators (see: 9e6c1e3) so probably doesn't need additional work. Eg:

public function getDataEndpoint() {
    yield 'data';
    yield 'links' => getHateoas();
}

This has the benefit of not doing the computationally expensive Hateoas stuff if all you want is the data.

$gen = $controller->getDataEndpoint();
$data = next($gen);

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

1 participant