fast_jsonapi icon indicating copy to clipboard operation
fast_jsonapi copied to clipboard

params option passed to serializer must be a hash

Open Adam-Stomski opened this issue 7 years ago • 0 comments

https://github.com/Netflix/fast_jsonapi/blob/master/lib/fast_jsonapi/object_serializer.rb#L86

Any reason why is this Hash only? I don't see any Hash specific methods running on params anywhere inside library itself. I'd like to pass params in a more OO way like:

Serializer.new(
  resource, 
  params: SerializationContext.new(
    params: params,
    current_scope: current_scope,
    alotofotherstuff: alotofotherstuff
  )
)

I understand the only use of this params option is to pass user defined attributes through library. If I'm right then how do you feel about removing this primtive obsession antipattern requirement?

Adam-Stomski avatar Dec 05 '18 16:12 Adam-Stomski