Skip to content

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

refactor(api): unify cursor pagination meta into a shared envelope (#17888)

Niklas Semmlerce4a1e9e0330
diff --git a/fern/apis/server/definition/evaluators.yml b/fern/apis/server/definition/evaluators.yml
index 4b540ceeb0..83d0099a20 100644
--- a/fern/apis/server/definition/evaluators.yml
+++ b/fern/apis/server/definition/evaluators.yml
@@ -2,6 +2,7 @@
imports:
evals: ./evaluation-commons.yml
errors: ./evaluation-errors.yml
+ pagination: ./utils/pagination.yml
service:
auth: true
@@ -522,10 +523,9 @@ types:
docs: Cursor pagination metadata.
CursorMeta:
- properties:
- cursor:
- type: optional<string>
- docs: Opaque cursor for the next page. Omitted when there is no next page.
+ docs: Cursor pagination metadata.
+ extends:
+ - pagination.CursorMetaResponse
DeletedEvaluator:
docs: Confirmation returned after successful evaluator deletion.
diff --git a/fern/apis/server/definition/experiments.yml b/fern/apis/server/definition/experiments.yml
index 55c44c132c..2f626e3e01 100644
--- a/fern/apis/server/definition/experiments.yml
+++ b/fern/apis/server/definition/experiments.yml
@@ -2,6 +2,7 @@
imports:
commons: ./commons.yml
scoresV3: ./scores-v3.yml
+ pagination: ./utils/pagination.yml
service:
auth: true
@@ -119,10 +120,9 @@ types:
meta: ExperimentsResponseMeta
ExperimentsResponseMeta:
- properties:
- cursor:
- type: optional<string>
- docs: Versioned base64url cursor for retrieving the next page. Absent when there are no more results.
+ docs: Metadata for cursor-based pagination.
+ extends:
+ - pagination.CursorMetaResponse
Experiment:
properties:
diff --git a/fern/apis/server/definition/observations.yml b/fern/apis/server/definition/observations.yml
index 552b3fb7a5..fcd5901970 100644
--- a/fern/apis/server/definition/observations.yml
+++ b/fern/apis/server/definition/observations.yml
@@ -1,6 +1,7 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json
imports:
commons: ./commons.yml
+ pagination: ./utils/pagination.yml
service:
auth: true
base-path: /api/public
@@ -231,8 +232,6 @@ types:
meta: ObservationsV2Meta
ObservationsV2Meta:
- docs: Metadata for cursor-based pagination
- properties:
- cursor:
- type: optional<string>
- docs: Base64-encoded cursor to use for retrieving the next page. If not present, there are no more results.
+ docs: Metadata for cursor-based pagination.
+ extends:
+ - pagination.CursorMetaResponse
diff --git a/fern/apis/server/definition/scores-v3.yml b/fern/apis/server/definition/scores-v3.yml
index 24f03c62ec..d2c439b070 100644
--- a/fern/apis/server/definition/scores-v3.yml
+++ b/fern/apis/server/definition/scores-v3.yml
@@ -1,6 +1,7 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json
imports:
commons: ./commons.yml
+ pagination: ./utils/pagination.yml
service:
auth: true
@@ -240,11 +241,10 @@ types:
docs: Score with CORRECTION data type. Value is the correction string.
GetScoresV3Meta:
+ extends:
+ - pagination.CursorMetaResponse
properties:
limit: integer
- cursor:
- type: optional<string>
- docs: URL-safe base64 (base64url) cursor for the next page. Absent when there are no more results.
GetScoresV3Response:
properties:
diff --git a/fern/apis/server/definition/utils/pagination.yml b/fern/apis/server/definition/utils/pagination.yml
index ab6e7ef86b..9e6dc1c629 100644
--- a/fern/apis/server/definition/utils/pagination.yml
+++ b/fern/apis/server/definition/utils/pagination.yml
@@ -22,3 +22,9 @@ types:
totalPages:
type: integer
docs: number of total pages given the current limit
+ CursorMetaResponse:
+ docs: Metadata for cursor-based pagination.
+ properties:
+ cursor:
+ type: optional<string>
+ docs: Opaque cursor for the next page. Omitted when there is no next page.
diff --git a/web/public/generated/api/openapi.yml b/web/public/generated/api/openapi.yml
index df11a0de97..898f60f3a6 100644
--- a/web/public/generated/api/openapi.yml
+++ b/web/public/generated/api/openapi.yml
@@ -13354,11 +13354,10 @@ components:
CursorMeta:
title: CursorMeta
type: object
- properties:
- cursor:
- type: string
- nullable: true
- description: Opaque cursor for the next page. Omitted when there is no next page.
+ description: Cursor pagination metadata.
+ properties: {}
+ allOf:
+ - $ref: '#/components/schemas/utilsCursorMetaResponse'
DeletedEvaluator:
title: DeletedEvaluator
type: object
@@ -13385,13 +13384,10 @@ components:
ExperimentsResponseMeta:
title: ExperimentsResponseMeta
type: object
- properties:
- cursor:
- type: string
- nullable: true
- description: >-
- Versioned base64url cursor for retrieving the next page. Absent when
- there are no more results.
+ description: Metadata for cursor-based pagination.
+ properties: {}
+ allOf:
+ - $ref: '#/components/schemas/utilsCursorMetaResponse'
Experiment:
title: Experiment
type: object
@@ -14972,14 +14968,10 @@ components:
ObservationsV2Meta:
title: ObservationsV2Meta
type: object
- description: Metadata for cursor-based pagination
- properties:
- cursor:
- type: string
- nullable: true
- description: >-
- Base64-encoded cursor to use for retrieving the next page. If not
- present, there are no more results.
+ description: Metadata for cursor-based pagination.
+ properties: {}
+ allOf:
+ - $ref: '#/components/schemas/utilsCursorMetaResponse'
OtelResourceSpan:
title: OtelResourceSpan
type: object
@@ -16342,14 +16334,10 @@ components:
properties:
limit:
type: integer
- cursor:
- type: string
- nullable: true
- description: >-
- URL-safe base64 (base64url) cursor for the next page. Absent when
- there are no more results.
required:
- limit
+ allOf:
+ - $ref: '#/components/schemas/utilsCursorMetaResponse'
GetScoresV3Response:
title: GetScoresV3Response
type: object
@@ -17378,6 +17366,15 @@ components:
- limit
- totalItems
- totalPages
+ utilsCursorMetaResponse:
+ title: utilsCursorMetaResponse
+ type: object
+ description: Metadata for cursor-based pagination.
+ properties:
+ cursor:
+ type: string
+ nullable: true
+ description: Opaque cursor for the next page. Omitted when there is no next page.
securitySchemes:
BasicAuth:
type: http