feat(graph): add metadata API for custom xattrs (GET + PUT)#2960
feat(graph): add metadata API for custom xattrs (GET + PUT)#2960flash7777 wants to merge 1 commit into
Conversation
Add endpoints to read and write arbitrary metadata (user.oc.md.*)
on drive items via the Graph API:
- GET /drives/{driveID}/items/{itemID}/metadata
Returns all custom metadata as JSON key-value pairs.
- PUT /drives/{driveID}/items/{itemID}/metadata
Sets metadata from a JSON body. Keys map to user.oc.md.{key} xattrs.
This enables client-side features like notes, classifications, or
any custom properties without requiring WebDAV PROPPATCH (which has
namespace/key mapping issues for oc: properties).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 20 |
| Duplication | 4 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
This should be spec'ed in https://github.com/opencloud-eu/libre-graph-api first before the endpoints are added here. See my PR opencloud-eu/libre-graph-api#35 for an attempt to achieve something similar (I believe :)) Additional feedback on my PR would be greatly appreciated :) |
Summary
/graph/v1beta1/drives/{driveID}/items/{itemID}/metadata— returns all custom metadata (user.oc.md.*) as JSON/graph/v1beta1/drives/{driveID}/items/{itemID}/metadata— sets metadata from JSON body, keys map touser.oc.md.{key}xattrsThis enables client-side features like notes, classifications, or any custom properties without requiring WebDAV PROPPATCH (which has namespace/key mapping issues for
oc:properties).Test plan
{"note": "test"}to metadata endpoint, verify xattruser.oc.md.noteis set{"note": "test"}is returned🤖 Generated with Claude Code