vic / params

Easy parameters validation/casting with Ecto.Schema, akin to Rails' strong parameters.
http://hex.pm/packages/params
Apache License 2.0
364 stars 47 forks source link

Fix incorrect `Params.Behaviour.data/2` typespec #22

Closed take-five closed 7 years ago

take-five commented 7 years ago

After I updated params in our project, I got new Dialyzer warnings:

web/controllers/queue_controller.ex:1: The inferred return type of data/2 ({'error',_} | {'ok',#{'__struct__'=>atom(), atom()=>_}}) has nothing in common with #{'__struct__'=>atom(), atom()=>_}, which is the expected return type for the callback of 'Elixir.Params.Behaviour' behaviour

The only file that uses Params.Behaviour is Params.Schema, so I changed callback spec. With this change Dialyzer warnings are gone.

take-five commented 7 years ago

@vic ping :)

vic commented 7 years ago

@take-five pong!

Sure I'm merging this and will release a new minor version. Thanks!