Open joevandyk opened 9 years ago
I may be having a related issue with the parameter name resource_id
. For an unknown reason, the call:
param :chassis_id, Fixnum, required: true
param :resource_id, Fixnum, required: true
error 422, 'Any error in association'
Results in the following validation error when attempting to call that endpoint:
Missing parameter resource
Looking closer,
# lib/apipie/dsl_definitions.rb:213
method_params = self.class._apipie_get_method_params(action_name)
returns ['chassis_id', 'resource']
as keys. It seems as if resource_id
is a keyword for Apipie and mucking things up.
Say you have
Rails will populates
params[:action]
with the name of the controller action, which probably isn't what you want.A fix would probably be to use
request.query_parameters[:action] || request.request_parameters[:action]
.Same thing probably happens with a param called
controller
.