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

Using the :skip_parse option with JSON::Hash values produces Pipeline::Stop #225

Open
jpsikorra opened this issue Mar 14, 2018 · 1 comment

Comments

@jpsikorra
Copy link

Using the option :skip_parse with values will set Representable::Pipeline::Stop on the represented object. I expected it to be nil.

class SomeRepresenter < Grape::Roar::Decorator
  include Roar::JSON
  include Roar::Coercion
  include Representable::JSON::Hash

  values skip_parse: ->(fragment:,**) { fragment.nil? }
end
SomeRepresenter.new(Hash.new).from_hash('foo' => nil)
#=> {"foo"=>Representable::Pipeline::Stop}
@jpsikorra jpsikorra changed the title Using the :skip_parse option with Representable::JSON::Hash values produces Representable::Pipeline::Stop Using the :skip_parse option with JSON::Hash values produces Pipeline::Stop Mar 14, 2018
@apotonick
Copy link
Member

Hi @jpsikorra I kind of gave up on Representable, we will soon publish transform which will suit all your needs (FYI).

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

2 participants