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

Remove SirenContext implicit parameter for conversion to root entity #3

Merged
merged 1 commit into from Oct 13, 2014

Conversation

dwestheide
Copy link
Contributor

This is another API-breaking change that I propose to include, but I think it's worth it. It removes the SirenContext type from the library altogether, and hence, toSiren and the other functions no longer have an implicit parameter list with the SirenContext parameter.

The reasoning behind this is that having to provide an implementation of this trait is quite a heavy burden, given that there may be many cases where it is not required at all for conversion to a Siren root entity. Where it is required, the same effect can easily be achieved this way (see the ExampleSpec):

implicit def orderSirenWriter(implicit baseUri: String): SirenRootEntityWriter[Order] = ???
implicit val baseUri: String = "http://api.x.io"

This way, providing the information like a base URI is left optional to situations where it is required, and it will be less cumbersome to integrate the library with existing web frameworks or libraries, that may have their own way of providing the kind of information transported in the SirenContext so far.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 01cc4ed on dwestheide:remove-implicit-siren-context into 772b031 on yetu:master.

zmeda added a commit that referenced this pull request Oct 13, 2014
Remove SirenContext implicit parameter for conversion to root entity
@zmeda zmeda merged commit 10fa1af into yetu:master Oct 13, 2014
@dwestheide dwestheide deleted the remove-implicit-siren-context branch October 13, 2014 19:39
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

Successfully merging this pull request may close these issues.

None yet

3 participants