You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(spec): support recursive path creation and colon-syntax URLs
Document the MS Graph colon-syntax URL forms
POST /v1beta1/drives/{drive-id}/root:/{path}:/children
POST /v1beta1/drives/{drive-id}/items/{item-id}:/{path}:/children
on both create-item operations. OpenAPI cannot express the colon-delimited
path segment, so the URL forms aren't represented as separate operations,
but the description makes clear the server accepts them.
Add a @libre.graph.missingParentsBehavior query parameter (enum fail|create,
default fail) controlling recursive creation of missing intermediate
folders along a colon-syntax path. Libregraph extension; ignored for
non-colon URLs.
Copy file name to clipboardExpand all lines: api/openapi-spec/v1.0.yaml
+32Lines changed: 32 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -479,6 +479,12 @@ paths:
479
479
The request body must specify exactly one of `folder` (set to `{}` to create a folder), `file` (to create a file item), or `remoteItem` (to mount a shared item; see [sharedWithMe](#/me.drive/ListSharedWithMe) for obtaining the source `remoteItem.id`). Requests with none of these, or with more than one, return 400. Mounting a share changes the `@client.synchronize` property of the `driveItem` in [sharedWithMe](#/me.drive/ListSharedWithMe) to true.
480
480
481
481
The `@libre.graph.conflictBehavior` query parameter controls what happens if a child with the same name already exists.
482
+
483
+
This endpoint also accepts the MS Graph colon-syntax URL form:
484
+
485
+
POST /v1beta1/drives/{drive-id}/root:/{path}:/children
486
+
487
+
OpenAPI cannot express the colon-delimited path segment, so this URL form is not represented as a separate operation in this specification. The server still accepts it, resolves `:/{path}:` as the parent of the new item, and applies `@libre.graph.missingParentsBehavior` to decide whether to create missing intermediate folders.
482
488
parameters:
483
489
- name: drive-id
484
490
in: path
@@ -498,6 +504,16 @@ paths:
498
504
- fail
499
505
- replace
500
506
default: fail
507
+
- name: '@libre.graph.missingParentsBehavior'
508
+
in: query
509
+
description: |
510
+
Controls what happens when a colon-syntax URL refers to a path whose intermediate folders don't all exist yet. `fail` (default) returns 404; `create` creates the missing intermediate folders before creating the final item. Only meaningful for colon-syntax URLs; ignored otherwise.
511
+
schema:
512
+
type: string
513
+
enum:
514
+
- fail
515
+
- create
516
+
default: fail
501
517
requestBody:
502
518
description: In the request body, provide a JSON object describing the new driveItem. Must specify exactly one of `folder`, `file`, or `remoteItem`. For mount-share, see [sharedWithMe](#/me.drive/ListSharedWithMe) for obtaining the source `remoteItem.id` and `permission` id.
503
519
content:
@@ -1349,6 +1365,12 @@ paths:
1349
1365
Identical request and response shape to the [drive-root variant](#/drives.root/CreateDriveItem), just with an explicit parent item id rather than the drive root.
1350
1366
1351
1367
The request body must specify exactly one of `folder` (set to `{}` to create a folder) or `file` (to create a file item). Requests with none of these, or with both, return 400. The `@libre.graph.conflictBehavior` query parameter controls what happens if a child with the same name already exists.
1368
+
1369
+
This endpoint also accepts the MS Graph colon-syntax URL form:
1370
+
1371
+
POST /v1beta1/drives/{drive-id}/items/{item-id}:/{path}:/children
1372
+
1373
+
OpenAPI cannot express the colon-delimited path segment, so this URL form is not represented as a separate operation in this specification. The server still accepts it, resolves `:/{path}:` as the parent of the new item (relative to `item-id`), and applies `@libre.graph.missingParentsBehavior` to decide whether to create missing intermediate folders.
1352
1374
parameters:
1353
1375
- name: drive-id
1354
1376
in: path
@@ -1376,6 +1398,16 @@ paths:
1376
1398
- fail
1377
1399
- replace
1378
1400
default: fail
1401
+
- name: '@libre.graph.missingParentsBehavior'
1402
+
in: query
1403
+
description: |
1404
+
Controls what happens when a colon-syntax URL refers to a path whose intermediate folders don't all exist yet. `fail` (default) returns 404; `create` creates the missing intermediate folders before creating the final item. Only meaningful for colon-syntax URLs; ignored otherwise.
1405
+
schema:
1406
+
type: string
1407
+
enum:
1408
+
- fail
1409
+
- create
1410
+
default: fail
1379
1411
requestBody:
1380
1412
description: In the request body, provide a JSON object describing the new driveItem. Must specify exactly one of `folder` or `file`.
0 commit comments