ruby on rails - Apipie interferes with proper error codes -
I can not find this little bit in the API's docs.
Let me make this special AP ready, and I thought I would document it with APP, all fine and dandy, and the ultimate verification is good, but I feel that the response to failure in verification I can not seem to throw the right HTTP code in For example, I have this post / user method, which obviously makes the user in my database good, right? Well, this is something wrong, and it's ok, but if, say, I throw the standards that it does not pass the validity of the apipie, chops apipies and throws a good old-fashioned error, if something is wrong, 422 responds with a fixed unit
failure / error: post '/users.json' ,: user = & gt; D Apipie :: ParamInvalid: Invalid parameter 'Email' value "": Regular expression / [a-zA-Z0-9 will match - -] + \ @ [a-zA-Z0-9 \ -.] + \. [Az] {2,} /. # ./spec/requests/usersapi_spec.rb:66:in `In Block (Level 3) & lt; Top (required) & gt; '
Let me assume that I have a regexp validation on the email parameter. Instead, I like it very well (maybe in Jason, or in the blank body) and set the release code in 422.
Any thoughts?
EDIT : Yes, I know that I can disable the validity of the API and I can do this otherwise ...
Hope you have already received the answer - but if someone has to disable the assumptions from APP - then it is.
Apipi. Configure | Config | Config.validate = false end
Comments
Post a Comment