From a225063ae203a8c8e6357274ce4276b6cbc2fe8e Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Sat, 11 Apr 2026 16:42:44 +0200 Subject: [PATCH 1/4] Add open extensions management endpoints Added endpoints for managing open extensions on DriveItems, including listing, retrieving, creating, updating, and deleting extensions. --- api/openapi-spec/v1.0.yaml | 261 +++++++++++++++++++++++++++++++++++++ 1 file changed, 261 insertions(+) diff --git a/api/openapi-spec/v1.0.yaml b/api/openapi-spec/v1.0.yaml index c8e2708..9449c4c 100644 --- a/api/openapi-spec/v1.0.yaml +++ b/api/openapi-spec/v1.0.yaml @@ -2086,6 +2086,227 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + '/v1beta1/drives/{drive-id}/items/{item-id}/extensions': + get: + tags: + - driveItem.extensions + summary: List all extensions on a DriveItem + operationId: ListExtensions + description: | + Get the collection of open extensions on the specified DriveItem. + + Each extension is identified by its `extensionName`, which follows a reverse DNS naming convention + (e.g. `com.example.myApp`). + parameters: + - name: drive-id + in: path + description: "key: id of drive" + required: true + schema: + type: string + example: a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668 + x-ms-docs-key-type: drive + - name: item-id + in: path + description: "key: id of item" + required: true + schema: + type: string + example: a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!share-id + x-ms-docs-key-type: item + responses: + "200": + description: Retrieved extensions + content: + application/json: + schema: + title: Collection of openTypeExtensions + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/openTypeExtension' + examples: + list extensions: + value: + value: + - extensionName: "com.example.project" + status: "reviewed" + assignee: "alice" + - extensionName: "eu.opencloud.workflow" + step: "approval" + default: + $ref: '#/components/responses/error' + x-ms-docs-operation-type: operation + '/v1beta1/drives/{drive-id}/items/{item-id}/extensions/{extensionName}': + get: + tags: + - driveItem.extensions + summary: Get an extension by name + operationId: GetExtension + description: | + Get a specific open extension identified by the extension name. + parameters: + - name: drive-id + in: path + description: "key: id of drive" + required: true + schema: + type: string + example: a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668 + x-ms-docs-key-type: drive + - name: item-id + in: path + description: "key: id of item" + required: true + schema: + type: string + example: a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!share-id + x-ms-docs-key-type: item + - name: extensionName + in: path + description: "The unique name of the extension, using reverse DNS notation (e.g. com.example.myApp)" + required: true + schema: + type: string + example: com.example.project + responses: + "200": + description: Retrieved extension + content: + application/json: + schema: + $ref: '#/components/schemas/openTypeExtension' + examples: + get extension: + value: + extensionName: "com.example.project" + status: "reviewed" + assignee: "alice" + priority: 3 + "404": + description: Extension not found + default: + $ref: '#/components/responses/error' + x-ms-docs-operation-type: operation + put: + tags: + - driveItem.extensions + summary: Create or update an extension + operationId: UpsertExtension + description: | + Create or update an open extension on the specified DriveItem. + + If the extension does not exist, it is created. If it already exists, the provided properties + are merged with the existing data: + + * Properties included in the request body are added or updated. + * Properties set to `null` are removed from the extension. + * Properties not included in the request body remain unchanged. + + The extension name should follow reverse DNS naming conventions (e.g. `com.example.myApp`) + to avoid collisions between applications. + parameters: + - name: drive-id + in: path + description: "key: id of drive" + required: true + schema: + type: string + example: a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668 + x-ms-docs-key-type: drive + - name: item-id + in: path + description: "key: id of item" + required: true + schema: + type: string + example: a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!share-id + x-ms-docs-key-type: item + - name: extensionName + in: path + description: "The unique name of the extension, using reverse DNS notation (e.g. com.example.myApp)" + required: true + schema: + type: string + example: com.example.project + requestBody: + description: Extension properties to set. Use `null` values to remove individual properties. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/openTypeExtensionUpdate' + examples: + create extension: + value: + status: "reviewed" + assignee: "alice" + priority: 3 + update single property: + value: + status: "approved" + remove a property: + value: + priority: null + responses: + "200": + description: Extension updated + content: + application/json: + schema: + $ref: '#/components/schemas/openTypeExtension' + "201": + description: Extension created + content: + application/json: + schema: + $ref: '#/components/schemas/openTypeExtension' + default: + $ref: '#/components/responses/error' + x-ms-docs-operation-type: operation + delete: + tags: + - driveItem.extensions + summary: Delete an extension + operationId: DeleteExtension + description: | + Delete an open extension from the specified DriveItem. + + This removes the extension and all its properties. + parameters: + - name: drive-id + in: path + description: "key: id of drive" + required: true + schema: + type: string + example: a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668 + x-ms-docs-key-type: drive + - name: item-id + in: path + description: "key: id of item" + required: true + schema: + type: string + example: a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!share-id + x-ms-docs-key-type: item + - name: extensionName + in: path + description: "The unique name of the extension, using reverse DNS notation (e.g. com.example.myApp)" + required: true + schema: + type: string + example: com.example.project + responses: + "204": + description: Extension deleted + "404": + description: Extension not found + default: + $ref: '#/components/responses/error' + x-ms-docs-operation-type: operation '/v1.0/drives/{drive-id}/root': get: tags: @@ -4990,6 +5211,12 @@ components: '@UI.Hidden': description: Properties or facets (see UI.Facet) annotated with this term will not be rendered if the annotation evaluates to true. Users can set this to hide permissions. type: boolean + extensions: + description: The collection of open extensions defined for this DriveItem. Nullable. Returned only on `$expand`. + type: array + items: + $ref: '#/components/schemas/openTypeExtension' + readOnly: true sharingLinkType: type: string enum: [ internal, view, upload, edit, createOnly, blocksDownload ] @@ -5556,6 +5783,40 @@ components: password: type: string description: Password. It may require a password policy. + openTypeExtension: + type: object + description: | + Represents an open extension on a DriveItem, providing a flexible way to attach + untyped custom data to a resource. + + Extensions are identified by their `extensionName`, which should follow reverse DNS + naming conventions (e.g. `com.example.myApp`) to avoid collisions between applications. + properties: + extensionName: + type: string + description: | + The unique identifier of the extension. Use reverse DNS naming conventions + (e.g. `com.example.myApp`). + readOnly: true + additionalProperties: true + example: + extensionName: "com.example.project" + status: "reviewed" + assignee: "alice" + priority: 3 + openTypeExtensionUpdate: + type: object + description: | + Properties to set or remove on an open extension. + + * Properties included in the request body are added or updated. + * Properties set to `null` are removed from the extension. + * Properties not included in the request body remain unchanged. + additionalProperties: + nullable: true + example: + status: "approved" + priority: null audio: type: object description: | From 35afc9a9c9fd0d89fdc40227006c9f081aae45b4 Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Sat, 11 Apr 2026 18:35:45 +0200 Subject: [PATCH 2/4] fix: copilot review findings --- api/openapi-spec/v1.0.yaml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/api/openapi-spec/v1.0.yaml b/api/openapi-spec/v1.0.yaml index 9449c4c..00b3416 100644 --- a/api/openapi-spec/v1.0.yaml +++ b/api/openapi-spec/v1.0.yaml @@ -1207,6 +1207,18 @@ paths: example: a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!share-id x-ms-docs-key-type: item - $ref: '#/components/parameters/driveItemSelect' + - name: $expand + in: query + description: Expand related entities + style: form + explode: false + schema: + uniqueItems: true + type: array + items: + enum: + - extensions + type: string responses: "200": description: Retrieved driveItem @@ -2186,7 +2198,7 @@ paths: assignee: "alice" priority: 3 "404": - description: Extension not found + $ref: '#/components/responses/error' default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation @@ -2232,7 +2244,11 @@ paths: type: string example: com.example.project requestBody: - description: Extension properties to set. Use `null` values to remove individual properties. + description: | + Extension properties to set. Use `null` values to remove individual properties. + + The `extensionName` is derived from the URL path parameter and must not be included + in the request body. If present, it will be ignored. required: true content: application/json: @@ -2303,7 +2319,7 @@ paths: "204": description: Extension deleted "404": - description: Extension not found + $ref: '#/components/responses/error' default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation From 3a739ee6ccc2d34d9e7344d817133354044f6153 Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Sat, 11 Apr 2026 19:07:51 +0200 Subject: [PATCH 3/4] fix: copilot review findings --- api/openapi-spec/v1.0.yaml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/api/openapi-spec/v1.0.yaml b/api/openapi-spec/v1.0.yaml index 00b3416..e10c5c7 100644 --- a/api/openapi-spec/v1.0.yaml +++ b/api/openapi-spec/v1.0.yaml @@ -2127,7 +2127,7 @@ paths: example: a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!share-id x-ms-docs-key-type: item responses: - "200": + '200': description: Retrieved extensions content: application/json: @@ -2151,7 +2151,7 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation - '/v1beta1/drives/{drive-id}/items/{item-id}/extensions/{extensionName}': + '/v1beta1/drives/{drive-id}/items/{item-id}/extensions/{extension-name}': get: tags: - driveItem.extensions @@ -2176,7 +2176,7 @@ paths: type: string example: a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!share-id x-ms-docs-key-type: item - - name: extensionName + - name: extension-name in: path description: "The unique name of the extension, using reverse DNS notation (e.g. com.example.myApp)" required: true @@ -2184,7 +2184,7 @@ paths: type: string example: com.example.project responses: - "200": + '200': description: Retrieved extension content: application/json: @@ -2197,7 +2197,7 @@ paths: status: "reviewed" assignee: "alice" priority: 3 - "404": + '404': $ref: '#/components/responses/error' default: $ref: '#/components/responses/error' @@ -2236,7 +2236,7 @@ paths: type: string example: a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!share-id x-ms-docs-key-type: item - - name: extensionName + - name: extension-name in: path description: "The unique name of the extension, using reverse DNS notation (e.g. com.example.myApp)" required: true @@ -2267,13 +2267,13 @@ paths: value: priority: null responses: - "200": + '200': description: Extension updated content: application/json: schema: $ref: '#/components/schemas/openTypeExtension' - "201": + '201': description: Extension created content: application/json: @@ -2308,7 +2308,7 @@ paths: type: string example: a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!share-id x-ms-docs-key-type: item - - name: extensionName + - name: extension-name in: path description: "The unique name of the extension, using reverse DNS notation (e.g. com.example.myApp)" required: true @@ -2316,9 +2316,9 @@ paths: type: string example: com.example.project responses: - "204": + '204': description: Extension deleted - "404": + '404': $ref: '#/components/responses/error' default: $ref: '#/components/responses/error' @@ -5807,6 +5807,8 @@ components: Extensions are identified by their `extensionName`, which should follow reverse DNS naming conventions (e.g. `com.example.myApp`) to avoid collisions between applications. + required: + - extensionName properties: extensionName: type: string From c2c054d9504fa5e0466944467c7e154742827dbf Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Tue, 5 May 2026 19:59:02 +0200 Subject: [PATCH 4/4] refactor: factor out driveItemExpand parameter component Mirror the existing driveItemSelect pattern so $expand on driveItem is referenced via $ref instead of inlined. --- api/openapi-spec/v1.0.yaml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/api/openapi-spec/v1.0.yaml b/api/openapi-spec/v1.0.yaml index e10c5c7..d33b0b0 100644 --- a/api/openapi-spec/v1.0.yaml +++ b/api/openapi-spec/v1.0.yaml @@ -1207,18 +1207,7 @@ paths: example: a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!share-id x-ms-docs-key-type: item - $ref: '#/components/parameters/driveItemSelect' - - name: $expand - in: query - description: Expand related entities - style: form - explode: false - schema: - uniqueItems: true - type: array - items: - enum: - - extensions - type: string + - $ref: '#/components/parameters/driveItemExpand' responses: "200": description: Retrieved driveItem @@ -6280,6 +6269,19 @@ components: request download url: value: - '@microsoft.graph.downloadUrl' + driveItemExpand: + name: $expand + in: query + description: Expand related entities + style: form + explode: false + schema: + uniqueItems: true + type: array + items: + enum: + - extensions + type: string drivesFilter: name: $filter in: query