Skip to content

Commit 6f12841

Browse files
committed
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.
1 parent e06dc22 commit 6f12841

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

api/openapi-spec/v1.0.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,12 @@ paths:
479479
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.
480480
481481
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.
482488
parameters:
483489
- name: drive-id
484490
in: path
@@ -498,6 +504,16 @@ paths:
498504
- fail
499505
- replace
500506
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
501517
requestBody:
502518
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.
503519
content:
@@ -1349,6 +1365,12 @@ paths:
13491365
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.
13501366
13511367
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.
13521374
parameters:
13531375
- name: drive-id
13541376
in: path
@@ -1376,6 +1398,16 @@ paths:
13761398
- fail
13771399
- replace
13781400
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
13791411
requestBody:
13801412
description: In the request body, provide a JSON object describing the new driveItem. Must specify exactly one of `folder` or `file`.
13811413
required: true

0 commit comments

Comments
 (0)