In the context of
NXP-24471, we are about to PUT/POST the full entity (and not only the id) when it comes to set Document, Directory Entry or User/Group in a document schema field.
Problem is that when setting the document full entity, we get a `Converting circular structure to JSON` from the js client:
nuxeo-document-edit.html:111 TypeError: Converting circular structure to JSON
at JSON.stringify (<anonymous>)
at Nuxeo._computeFetchOptions (nuxeo.js:2298)
at Nuxeo.http (nuxeo.js:2172)
at Request.execute (nuxeo.js:3236)
at HTMLElement._doExecute (nuxeo-resource.html:227)
at HTMLElement.<anonymous> (nuxeo-resource.html:209)
The following diff fixes the issue:
But I also understand it is shameful to PUT/POST the whole entity in the payload when only the id would do the job. So I guess we could even make the the js client prune the payload when scanning one the following entity:
- "entity-type": "document"
- "entity-type": "directoryEntry"
- "entity-type": "user"
- "entity-type": "group"
to keep only the uid/id.