Hi,
I am experiencing an error i never encountered before. It happen when i try to create. a new node. The error message say so: “Value of type [java.lang.String] cannot be converted to [Reference]: UUID cannot be blank”
The object i send to create API is:
Well, the first logical step here would be to try and find the field(s) which cause the error. There are only a few fields that are mandatory for create operation: parentPath, contentType and data. So try to create a node only with those and then start adding the rest of the fields until you get the error. Let us know which field that was.
Thanks both for answers. I checked and there are no functions in the object i send to “create”. The fields where reside the errors seems to be the attachments , they are required in order to save the content but in the content-type both are not required:
We found out the problem do not reside on the schema but in how Enonic want the empty attachments to be set in case do not exists. In the code we set attachments as empty array, [], and reapirAttachemnt as empty string, ‘’, (since accept only one file), if no file exists. By changing both to “undefined” instead we got rid of the error.
Oh, I see. Yes, they cannot be an empty array or especially a string. I assume by saying that you changed to “undefined” you meant that you simply stopped sending these fields? Or does it only work when you send attachments: undefined and repairAttachment: undefined? You shouldn’t have to send them at all.
Yes by defining these values as “undefined” they are not sent as object properties to create or modify API and the UUID error is gone! thanks for support