Apipie / apipie-rails

Ruby on Rails API documentation tool
Apache License 2.0
2.47k stars 463 forks source link

validators executes after before_filter #168

Open freemanoid opened 11 years ago

freemanoid commented 11 years ago

Apipie params validators executes after rails before_filter so if we want to use some params in before_filter we should validate it manually.

kikonen-fiksu commented 10 years ago

Is there any workaround, which would allow tuning this ordering? Most preferable solution would be to able to explicitly set before_filter which will trigger apipie validations, then it would be possible to tune ordering. This would allow strict validations, which must be done before anything else to be done properly before apipie, and those which depend from validated params to be done after.

iNecas commented 10 years ago

We have a TODO on turning the validation into a filter (right now, it'd done by metaprograming, which I agree is not the best way of dealing with this), After that's done, it should be possible to tweak the ordering by explicitly caling before_filter :apipie_validations in the context of the controller

iNecas commented 10 years ago

Probably not simple workaround right now :/