Skip to content

Assignee causes 422 Validation Error #19

Closed
magnific0 opened this Issue Feb 20, 2014 · 6 comments

4 participants

@magnific0

patch on line 60 of issue.py causes a "422: Validation Error."

Upon inspection of the error the value to the assignee field is 'invalid', APIv3 says the following about this error:

This means the formatting of a field is invalid. The documentation for that resource should be able to give you more specific information.

The value in my case is just a simple string.

@ttencate
Owner

No idea... Maybe caused by https://github.com/ttencate/sf2github/pull/18/files? Please send a pull request if/when you figure this out!

@codeguru42

@magnific0 Can you give a specific, complete example of the string value which causes this error?

@magnific0

Hi, thanks for the fast responses I created a small test case and it seems that this occurs for any assignee, but myself. Does the assignee have to be the repo owner or contributor?

#!/usr/bin/env python
import json
import requests
from getpass import getpass

username = "magnific0"
password = getpass('%s\'s GitHub password: ' % username)
auth = (username, password)

updateData = {
    'title': "New title"
}

# Try with repo owner
updateData['assignee'] = username

response = requests.patch("https://api.github.com/repos/magnific0/testpagmo/issues/39", data=json.dumps(updateData), auth=auth)
print response.status_code
print response
print response.json().get('message')
print response.json().get('error')

# 200
# <Response [200]>
# None
# None

updateData['assignee'] = "ttencate"

response = requests.patch("https://api.github.com/repos/magnific0/testpagmo/issues/39", data=json.dumps(updateData), auth=auth)
print response.status_code
print response
print response.json().get('message')
print response.json().get('error')

# 422
# <Response [422]>
# Validation Failed
# None
@jpschewe
jpschewe commented Apr 6, 2014

The assignee needs to be someone that is listed as a contributor. So the script should actually have a list of known contributors and skip the assignment to unknown contributors. This would happen if you had 4 people on SourceForge and only 3 of them are on Github.

@codeguru42

Is this fixed with 3ea23e9?

@ttencate
Owner
ttencate commented Aug 7, 2014

Yes, I think so.

@ttencate ttencate closed this Aug 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.