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

Weird return using Sequel #10

Closed
jnylen opened this issue Sep 3, 2017 · 4 comments
Closed

Weird return using Sequel #10

jnylen opened this issue Sep 3, 2017 · 4 comments

Comments

@jnylen
Copy link

jnylen commented Sep 3, 2017

Hi,
Returning data is quite weird:

[:data, [{:id=>"1", :type=>:channel, :attributes=>{:name=>"hi", :slug=>"hi"}}]]

Controller:

module ApiV2::Controllers::Channel
  class Index
    include ApiV2::Action
    include JSONAPI::Hanami::Action

    def call(params)
      self.data = Channel.all
      #self.include = [:author, comments: [:author]]
      #self.fields = { users: [:name, :email] }
      #self.status = 201
    end
  end
end
@beauby
Copy link
Member

beauby commented Sep 12, 2017

Looks like a .to_json is missing somewhere, thanks for pointing it out!

@beauby
Copy link
Member

beauby commented Sep 12, 2017

Specifically here.

@jnylen
Copy link
Author

jnylen commented Dec 15, 2017

Working now.

@jnylen jnylen closed this as completed Dec 15, 2017
@tragiclifestories
Copy link

For anyone else that stumbles upon this: the problem is that sometimes bundler will resolve incompatible versions of the other JSONAPI gems. The solution is to pin to ~> 0.1.3 for both jsonapi-serializable and jsonapi-renderer.

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

3 participants