From 714140dd26fd3d1ef9fbc8b4e4fe17848ff1445c Mon Sep 17 00:00:00 2001 From: localai-org-maint-bot <306269227+localai-org-maint-bot@users.noreply.github.com> Date: Mon, 21 Sep 2026 03:07:40 +0000 Subject: [PATCH] fix(swagger): describe backend metadata as an object Swag cannot resolve json.RawMessage in OpenAIResponse and aborts the daily schema generation. Set its Swagger type without changing JSON encoding, and regenerate the checked-in specifications. Assisted-by: Codex:gpt-6 --- core/schema/openai.go | 2 +- swagger/docs.go | 3 +++ swagger/swagger.json | 3 +++ swagger/swagger.yaml | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/core/schema/openai.go b/core/schema/openai.go index 2aa69969b..6f3717256 100644 --- a/core/schema/openai.go +++ b/core/schema/openai.go @@ -99,7 +99,7 @@ type OpenAIResponse struct { // OpenAI-SDK consumers that filter on a truthy `result.usage` // (continuedev/continue, Kilo Code, Roo Code, etc.). Usage *OpenAIUsage `json:"usage,omitempty"` - Metadata json.RawMessage `json:"metadata,omitempty"` + Metadata json.RawMessage `json:"metadata,omitempty" swaggertype:"object"` } // StreamOptions mirrors OpenAI's `stream_options` request field. The only diff --git a/swagger/docs.go b/swagger/docs.go index 6ae74b94a..dc2fcf063 100644 --- a/swagger/docs.go +++ b/swagger/docs.go @@ -7313,6 +7313,9 @@ const docTemplate = `{ "id": { "type": "string" }, + "metadata": { + "type": "object" + }, "model": { "type": "string" }, diff --git a/swagger/swagger.json b/swagger/swagger.json index c19487f6c..a1e71cbdb 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -7310,6 +7310,9 @@ "id": { "type": "string" }, + "metadata": { + "type": "object" + }, "model": { "type": "string" }, diff --git a/swagger/swagger.yaml b/swagger/swagger.yaml index 6f9f6b1b7..12de303a0 100644 --- a/swagger/swagger.yaml +++ b/swagger/swagger.yaml @@ -2266,6 +2266,8 @@ definitions: type: array id: type: string + metadata: + type: object model: type: string object: