Skip to content

Make Resource and Resources a general abstraction for hypermedia resources #37

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

Closed
dschulten opened this issue Dec 30, 2012 · 4 comments
Closed

Comments

@dschulten
Copy link
Contributor

While experimenting with the Hal support it occured to me, that maybe we should re-focus the current approach to providing both our own and third-party hypermedia content types. The current Resource classes with their json links and content attributes are in fact yet another way of adding hypermedia controls to json, IOW we are establishing yet another hypermedia content-type, without defining a proper content-type for it (at least not yet).
Maybe we should use Resource and Resources as an abstraction which is meant to be represented in more widely-used hypermedia formats (atom, hal, siren, collection+json, json-ld, xhtml) - as requested by the client via Accept. I think this is what has just started by adding Hal. Enabling people to build abstract hypermedia resources and making the representation a matter of choice or taste would be the correct thing to do IMO. We could provide MessageConverters for the media types.

To support these media types better, Link seems to need these extensions:

Resource and Resources could be extended by the following properties:

  • actions (used by xhtml forms, Siren)
  • context (e.g. used by json-ld)

or maybe simply a facility to add arbitrary Object properties to it, so that people can add data to the Resource as needed.

I want to find out in which direction you are going here. We can then create single User stories and add these extensions one at a time.

Best regards
Dietrich

@fiddlerpianist
Copy link
Contributor

I would love to see this type of change made as well. I'm having difficulty making the Resource(s) work in a particularly HAL-friendly kind of way. Currently it appears that the code simply maps Atom names to HAL names on serialization rather than supporting a more full-featured content model for links and resources.

@mortizbey
Copy link

+1

@drewcox
Copy link

drewcox commented Dec 9, 2013

+1, I am also trying to render templated HAL links and there appears to be no way to do it. I'd be happy to even find a way to extend the project with some custom coding?

@gregturn
Copy link
Contributor

gregturn commented Mar 5, 2019

Resolved via #833.

@gregturn gregturn closed this as completed Mar 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants