representable
representable copied to clipboard
Using the :skip_parse option with JSON::Hash values produces Pipeline::Stop
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}
Hi @jpsikorra I kind of gave up on Representable, we will soon publish transform which will suit all your needs (FYI).