[ckan-dev] package_create url validation

Milo Thurston milo.thurston at oerc.ox.ac.uk
Thu Dec 4 10:45:30 UTC 2014


This is probably a very simple mistake of mine, but I’ve been stuck on it for a while and I wonder if anyone can offer any suggestions.
I’ve been trying to create packages on a CKAN installation using the api, i.e. 

/api/3/action/package_create

Here’s an example of the data being POSTed:

{'extras': [{'key': ’source',
             'value': 'http://www.mysite.org/original-data'}],
 'name': 'Training Materials',
 'owner_org': ‘mysite',
 'url': '4c90b3c7-d8fa-4b9d-a02b-c11eedc4970a’}

CKAN gives a 409 error and puts this in the logs:

ERROR [ckan.controllers.api] Validation error: "{'__type': 'Validation Error', 'name': [u'Url must be purely lowercase alphanumeric (ascii) characters and these symbols: -_']}”

It doesn’t seem to matter what I set the value of ‘url’ to; even string of entirely lower-case ascii characters doesn’t do the trick. Leaving url blank or changing the key to ‘Url’ doesn’t succeed either. The validator seems to be responding correctly for other errors, e.g. incorrect formatting of ‘extras’.

Does anyone have any suggestions?





More information about the ckan-dev mailing list