[ckan-dev] Creating resources via API and via UI

Niall Beard niall.beard at manchester.ac.uk
Fri Mar 27 11:43:38 UTC 2015


Hi guys,

I've ran into a little issue and I'm not sure if it's a bug in CKAN or if
the problem exists between chair and keyboard (so to speak).

Basically when I create a resource via the API, the name is constrained to
being lowercase and with no spaces (e.g. this-_is-valid). If I create this
using the UI, the name can be set to anything (e.g. This is Valid). In the
UI its the name attribute that is being displayed on the read page; so I
end up with a horrible lowercase string on names of API created resources
and nice ones on UI created resources.
e.g.
Bad (API created):
http://freya.cs.man.ac.uk:5000/dataset/genome3d-disopred_ffpred_mempack/resource/0302b216-fb4c-4917-966f-cb413c92edb0


Good (UI created):
http://freya.cs.man.ac.uk:5000/dataset/ui-uploaded/resource/81892533-76bb-43e0-b3cc-17caa9fae8c2

The error returned when trying to add a human readable name is:
 "name": ["Must be purely lowercase alphanumeric (ascii) characters and
these symbols: -_"]}}


Should that check in the API for lowercaseyness exist, or are we using the
API wrong?


Niall Beard
Scientific Web Technologist,
myGrid Team,
University of Manchester
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20150327/db50daf6/attachment-0002.html>


More information about the ckan-dev mailing list