Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(api): make retention optional and fix metadata handling in update project (#11442)

Steffen Schmitz99ffc4517327
diff --git a/fern/apis/server/definition/projects.yml b/fern/apis/server/definition/projects.yml
index c97badd593..26809c571c 100644
--- a/fern/apis/server/definition/projects.yml
+++ b/fern/apis/server/definition/projects.yml
@@ -44,8 +44,12 @@ service:
type: optional<map<string, unknown>>
docs: Optional metadata for the project
retention:
- type: integer
- docs: Number of days to retain data. Must be 0 or at least 3 days. Requires data-retention entitlement for non-zero values. Optional.
+ type: optional<integer>
+ docs: |
+ Number of days to retain data.
+ Must be 0 or at least 3 days.
+ Requires data-retention entitlement for non-zero values.
+ Optional. Will retain existing retention setting if omitted.
response: Project
delete:
diff --git a/web/public/generated/api/openapi.yml b/web/public/generated/api/openapi.yml
index cc98f640e0..5bbe00ba8a 100644
--- a/web/public/generated/api/openapi.yml
+++ b/web/public/generated/api/openapi.yml
@@ -3935,13 +3935,14 @@ paths:
description: Optional metadata for the project
retention:
type: integer
- description: >-
- Number of days to retain data. Must be 0 or at least 3 days.
+ nullable: true
+ description: |-
+ Number of days to retain data.
+ Must be 0 or at least 3 days.
Requires data-retention entitlement for non-zero values.
- Optional.
+ Optional. Will retain existing retention setting if omitted.
required:
- name
- - retention
delete:
description: >-
Delete a project by ID (requires organization-scoped API key). Project
diff --git a/web/src/ee/features/admin-api/server/projects/projectById/index.ts b/web/src/ee/features/admin-api/server/projects/projectById/index.ts
index beb7761595..c6a63ac96b 100644
--- a/web/src/ee/features/admin-api/server/projects/projectById/index.ts
+++ b/web/src/ee/features/admin-api/server/projects/projectById/index.ts
@@ -77,7 +77,7 @@ export async function handleUpdateProject(
data: {
name,
...(retention !== undefined ? { retentionDays: retention } : {}),
- metadata,
+ ...(metadata !== undefined ? { metadata } : {}),
},
select: {
id: true,