uo-lca / CalRecycleLCA

CalRecycle Used Oil LCA Online Tool
Other
0 stars 0 forks source link

Implement stateful (HATEOAS) resources #123

Closed bkuczenski closed 9 years ago

bkuczenski commented 9 years ago

all resources returned by the API should inherit from a base Resource class that provides ContentType, Content, and Links fields. The Content should be whatever resource the API route is returning. then ContentType = typeof(content). content could also be, e.g., an HTTP error status.

Links can be populated based on ContentType and RouteData.

bkuczenski commented 9 years ago

useful reading: http://benfoster.io/blog/generating-hypermedia-links-in-aspnet-web-api

bkuczenski commented 9 years ago

Note- this issue has been postponed until such time as AngularJS provides an easy mechanism to accept HATEOAS resources.

The interim solution will be to provide a list of links in response to a client requesting the api root, as in GET $WEB_ROOT/api

bkuczenski commented 9 years ago

Should we use JSON-LD for this? https://en.wikipedia.org/wiki/JSON-LD

uo-lca commented 9 years ago

I don't remember what was the issue with AngularJS. If the JSON-LD format will simply add a few new properties to every resource, the angular web app could ignore those properties. I like the idea of using JSON-LD. It has W3C Recommendation, and it would support a data browser capable of processing JSON-LD.

binaworks commented 9 years ago

won;t do any further work on this in this project- got 80% there