Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"validation_errors": "Could not determine specific validation errors" #428

Open
hussaintamboli opened this issue Apr 16, 2015 · 3 comments
Labels

Comments

@hussaintamboli
Copy link

I tried to make a POST request to my API

import requests
import json

url = 'http://127.0.0.1:5000/api/candidate'
data = {
    'first_name' : 'Hussain',
    'country_id' : 1,
    'city' : 'pune',
    'email' : 'hussain@screen-magic.com',
    'phone' : '919975542588',
    'education' : 'B Tech',
    'department' : 1,
    'experinece_years' : 2
}
json_data = json.dumps(data)

try:
    result = requests.post(url, data=json_data, headers={"Content-Type" : "application/json"})
    print(result)
    print(result.text)
except requests.exceptions.ConnectionError as conn_err:
    print(conn_err)

And I get an error

<Response [400]>
{
     "validation_errors": "Could not determine specific validation errors"
}

On the server side it says

ERROR in views [/home/hussain/workspace/magic-chips/backend/venv/local/lib/python2.7/site-packages/flask_restless/views.py:413]:

need more than 1 value to unpack

I looked for this kind of issue but didn't find any help.

Also I checked line 413 from views.py and I am guessing the restless is not able to identify the exception.

@zablotski
Copy link

@hussaintamboli

Look at this method : https://github.com/jfinkels/flask-restless/blob/master/flask_restless/views.py#L389
In declared API endpoint you need to provide validation_exceptions classes that return expected by extract_error_messages structures.

@jfinkels
Copy link
Owner

jfinkels commented Feb 4, 2016

The validation checking in Flask-Restless is very shaky. If you can provide a minimal working example that causes the error, I can perhaps address this issue.

@jfinkels jfinkels added the bug label Feb 4, 2016
@coanor
Copy link

coanor commented Dec 10, 2017

so, this still a bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants