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

There should be a public API that allows to render in a hash. #55

Closed
vasilakisfil opened this issue Mar 16, 2017 · 2 comments · Fixed by #56
Closed

There should be a public API that allows to render in a hash. #55

vasilakisfil opened this issue Mar 16, 2017 · 2 comments · Fixed by #56

Comments

@vasilakisfil
Copy link
Contributor

At the moment it seems render returns only a String since it uses to_json. There should be a as_json equivalent publicly accessible.

https://github.com/jsonapi-rb/jsonapi-serializable/blob/master/lib/jsonapi/serializable/renderer.rb#L22

@beauby
Copy link
Member

beauby commented Mar 16, 2017

Hi @vasilakisfil – you are right. I've had that under my radar for a while but somehow forgot about it. As jsonapi-serializable does not depend on ActiveSupport, there would be no #as_json, but the returned hash would be what one would expect from #as_json.
So, basically it's just a matter of removing .to_json here and here. Feel free to open a PR if you have the file open in your text editor already, otherwise I'll do it myself over the weekend.

@Aryk
Copy link

Aryk commented Jul 9, 2017

@beauby was this merged into rubygems version?

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 a pull request may close this issue.

3 participants