[ckan-dev] [ckan-discuss] CKAN says I am sending __junk

Yu Chen cheny18 at rpi.edu
Fri Oct 11 22:00:52 UTC 2013


Thanks David for your code! I'll adopt that and try some possible fields that makes ckan happy. 

Yu

On Oct 11, 2013, at 3:17 PM, David Read <david.read at hackneyworkshop.com> wrote:

> It means you have added a field that it doesn't like. Try removing
> fields in the resource until it works. The revision_gtimestamp looks
> suspicious to me. Also worth removing the generated/system ones: id,
> position, state, revision_id.
> 
> Unfortunately the __junk thing is not documented, even in the code,
> nor is there a helpful log message. I did a patch last week that
> improves the error message to tell you which field is the problem,
> that you could cherry-pick:
> https://github.com/datagovuk/ckan/commit/836201852cd9b09a954b88872a1bc7bf1ad43dd3
> 
> David
> 
> On 10 October 2013 20:16, Yu Chen <cheny18 at rpi.edu> wrote:
>> Hi,
>> 
>> I am trying to use the ckan http api to update the resources in a certain dataset. What I do is just to send the post request with the body as a json file like this:
>> 
>> {
>>    "resource": [
>>        {
>>            "resource_group_id": "d1ed31c4-c356-4f9a-aaaf-6b79ba2f4efd",
>>            "hash": "",
>>            "description": "",
>>            "format": "",
>>            "url": "http://udco.tw.rpi.edu/ckan/storage/f/2013-10-09-123102/DataScience_2013_Assignment-2.pdf",
>>            "revision_gtimestamp": "",
>>            "state": "active",
>>            "position": 0,
>>            "revision_id": "",
>>            "id": ""
>>        }
>>    ],
>>    "num_resources": 1
>> }
>> 
>> and ckan says what I send is __junk.
>> 
>> However, if I try to send
>> 
>> {
>>    "resource": [],
>>    "num_resources": 1
>> }
>> 
>> it works perfectly. I saw some of the previous post on this issue and figure out it might be the problem with the fields. Does anyone know what's the required field that I need to send in the json file? Thanks!
>> 
>> Cheers
>> Yu
>> 
>> 
>> 
>> _______________________________________________
>> ckan-discuss mailing list
>> ckan-discuss at lists.okfn.org
>> http://lists.okfn.org/mailman/listinfo/ckan-discuss
>> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-discuss
> 





More information about the ckan-dev mailing list