Debugging this issue, I found the following, and I am not sure whether this is a bug in jsreport or maybe in my client.
To create the asset, I first create a folder, then get the shortid of the created folder, and then create the asset with a folderRef with that shortid. The generated client sends the FolderRef like this:
So when I get the asset via the odata api, the whole object looks like this:
However, if I create the same asset with the same content in the UI, it looks almost all the same, just that the folder does not have the "@odata.type" property - and then it works. Seeing that, I modified my generated client code so that it does not send the folder.@odata.type property, and indeed, then it works. Looking ad the odata spec, I think the @odata.type property should actually be included, and I would expect it to work.
What do you think / am I doing something wrong? Thanks in advance!