Skip to content

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

fix(api): match batch score results before the accepted response (#18518)

Hassieb Pakzad1744e301ff37
diff --git a/fern/apis/client/definition/score.yml b/fern/apis/client/definition/score.yml
index 90d59114d9..024ec3f983 100644
--- a/fern/apis/client/definition/score.yml
+++ b/fern/apis/client/definition/score.yml
@@ -135,10 +135,13 @@ types:
CreateScoresResponse:
discriminated: false
+ # Undiscriminated unions match in order. CreateScoreBatchResponse must stay
+ # last: its literal `message` is defaulted in generated clients, so it would
+ # also match 207 bodies and hide rejected scores.
union:
+ - CreateScoreBatchResults
- CreateScoreResponse
- CreateScoreBatchResponse
- - CreateScoreBatchResults
CreateScoreBatchResponse:
docs: Batch accepted (HTTP 202).
diff --git a/fern/apis/server/definition/scores.yml b/fern/apis/server/definition/scores.yml
index 847d0cc9f2..98ea9abfa6 100644
--- a/fern/apis/server/definition/scores.yml
+++ b/fern/apis/server/definition/scores.yml
@@ -219,10 +219,13 @@ types:
- ANNOTATION
CreateScoresResponse:
discriminated: false
+ # Undiscriminated unions match in order. CreateScoreBatchResponse must stay
+ # last: its literal `message` is defaulted in generated clients, so it would
+ # also match 207 bodies and hide rejected scores.
union:
+ - CreateScoreBatchResults
- CreateScoreResponse
- CreateScoreBatchResponse
- - CreateScoreBatchResults
CreateScoreBatchResponse:
docs: Batch accepted (HTTP 202).
diff --git a/web/public/generated/api-client/openapi.yml b/web/public/generated/api-client/openapi.yml
index 6fccf6c76a..6fe7535bdb 100644
--- a/web/public/generated/api-client/openapi.yml
+++ b/web/public/generated/api-client/openapi.yml
@@ -158,9 +158,9 @@ components:
CreateScoresResponse:
title: CreateScoresResponse
oneOf:
+ - $ref: '#/components/schemas/CreateScoreBatchResults'
- $ref: '#/components/schemas/CreateScoreResponse'
- $ref: '#/components/schemas/CreateScoreBatchResponse'
- - $ref: '#/components/schemas/CreateScoreBatchResults'
CreateScoreBatchResponse:
title: CreateScoreBatchResponse
type: object
diff --git a/web/public/generated/api/openapi.yml b/web/public/generated/api/openapi.yml
index 5b08f9b3f7..ecc4f56865 100644
--- a/web/public/generated/api/openapi.yml
+++ b/web/public/generated/api/openapi.yml
@@ -16938,9 +16938,9 @@ components:
CreateScoresResponse:
title: CreateScoresResponse
oneOf:
+ - $ref: '#/components/schemas/CreateScoreBatchResults'
- $ref: '#/components/schemas/CreateScoreResponse'
- $ref: '#/components/schemas/CreateScoreBatchResponse'
- - $ref: '#/components/schemas/CreateScoreBatchResults'
CreateScoreBatchResponse:
title: CreateScoreBatchResponse
type: object