Is there a way to deactivate the JSON API validation for an action?
santostiago opened this issue · 1 comments
santostiago commented
I want all my actions except for #create
to use JSON API.
The action create
has too many relationships and becomes cumbersome in the JSON API format. Is there a way to deactivate the validations just for one action?
tiagopog commented
Hey there, @santostiago. Sorry for the long delay to answer you, it's been really busy days here.
Yeah, if you really want to avoid conforming that endpoint to JSON:API you can actually skip the method called on the controller's before_action
:
class AppointmentsController < BaseController
skip_before_action :jsonapi_request_handling, only: :create
# ...
end