Skip to content

Commit cc667c2

Browse files
committed
docs(files): declare the conflict response on replace file content
1 parent 3db0488 commit cc667c2

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎apps/docs/openapi-v2-files-audit.json‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2744,7 +2744,7 @@
27442744
"put": {
27452745
"operationId": "updateFileContent",
27462746
"summary": "Replace File Content",
2747-
"description": "Replace the complete contents of an existing file from UTF-8 or base64 input.\n\nOAuth scope: `api:write`.",
2747+
"description": "Replace the complete contents of an existing file from UTF-8 or base64 input. A stale `expectedRevision`, or a write that raced this one, returns `409`; re-read before retrying.\n\nOAuth scope: `api:write`.",
27482748
"x-sim-operation": "files.update_content",
27492749
"x-oauth-scope": "api:write",
27502750
"tags": ["Files"],
@@ -2808,6 +2808,9 @@
28082808
"404": {
28092809
"$ref": "#/components/responses/NotFound"
28102810
},
2811+
"409": {
2812+
"$ref": "#/components/responses/Conflict"
2813+
},
28112814
"413": {
28122815
"$ref": "#/components/responses/PayloadTooLarge"
28132816
},

‎apps/sim/lib/api/contracts/v2/openapi/files-audit.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,8 +1168,9 @@ const declaredRoutes = [
11681168
applicationOperation: fileOperations.updateContent,
11691169
operationId: 'updateFileContent',
11701170
summary: 'Replace File Content',
1171-
description: 'Replace the complete contents of an existing file from UTF-8 or base64 input.',
1172-
errors: [...RESOURCE_ERRORS, 'PayloadTooLarge'],
1171+
description:
1172+
'Replace the complete contents of an existing file from UTF-8 or base64 input. A stale `expectedRevision`, or a write that raced this one, returns `409`; re-read before retrying.',
1173+
errors: [...RESOURCE_CONFLICT_ERRORS, 'PayloadTooLarge'],
11731174
success: { description: 'The updated file.' },
11741175
}),
11751176
{

‎apps/sim/lib/api/mcp/generated/v2-operations.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2094,7 +2094,7 @@ export const V2_MCP_OPERATIONS = {
20942094
contract: v2UpdateFileContentContract,
20952095
summary: 'Replace File Content',
20962096
description:
2097-
'Replace the complete contents of an existing file from UTF-8 or base64 input.\n\nOAuth scope: `api:write`.',
2097+
'Replace the complete contents of an existing file from UTF-8 or base64 input. A stale `expectedRevision`, or a write that raced this one, returns `409`; re-read before retrying.\n\nOAuth scope: `api:write`.',
20982098
handler: () => import('@/app/api/v2/files/[fileId]/content/route').then((route) => route.PUT),
20992099
},
21002100
updateKnowledgeBase: {

0 commit comments

Comments
 (0)