From e35c8ee1738637ad0996c247f29e371f9b4d88a8 Mon Sep 17 00:00:00 2001 From: Ryosuke Hayashi Date: Wed, 30 Apr 2025 01:05:02 +0900 Subject: [PATCH] fix OpenAPI schema generation error caused by mappingproxy in models (#8121) --- openhands/integrations/provider.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/openhands/integrations/provider.py b/openhands/integrations/provider.py index d0551805e1..7639919c66 100644 --- a/openhands/integrations/provider.py +++ b/openhands/integrations/provider.py @@ -60,6 +60,10 @@ PROVIDER_TOKEN_TYPE_WITH_JSON_SCHEMA = Annotated[ PROVIDER_TOKEN_TYPE, WithJsonSchema({'type': 'object', 'additionalProperties': {'type': 'string'}}), ] +CUSTOM_SECRETS_TYPE_WITH_JSON_SCHEMA = Annotated[ + CUSTOM_SECRETS_TYPE, + WithJsonSchema({'type': 'object', 'additionalProperties': {'type': 'string'}}), +] class SecretStore(BaseModel): @@ -67,8 +71,8 @@ class SecretStore(BaseModel): default_factory=lambda: MappingProxyType({}) ) - custom_secrets: CUSTOM_SECRETS_TYPE = Field( - default_factory=lambda: MappingProxyType({}) + custom_secrets: CUSTOM_SECRETS_TYPE_WITH_JSON_SCHEMA = Field( + default_factory=lambda: MappingProxyType({}), ) model_config = {