fix(schemas): align MCPServer schema validation with database constraints
- Update config_type validation to accept ['studio', 'sse'] instead of ['studio', 'custom'] - Update type validation to accept ['official', 'community'] instead of ['official', 'custom'] - Resolves ResponseValidationError when listing MCP servers
This commit is contained in:
parent
d4618fa345
commit
1df83ea2dd
@ -427,7 +427,7 @@ class MCPServerBase(BaseModel):
|
|||||||
@field_validator("config_type")
|
@field_validator("config_type")
|
||||||
@classmethod
|
@classmethod
|
||||||
def validate_config_type(cls, v):
|
def validate_config_type(cls, v):
|
||||||
valid_types = ["studio", "custom"]
|
valid_types = ["studio", "sse"]
|
||||||
if v not in valid_types:
|
if v not in valid_types:
|
||||||
raise ValueError(f"config_type must be one of: {valid_types}")
|
raise ValueError(f"config_type must be one of: {valid_types}")
|
||||||
return v
|
return v
|
||||||
@ -435,7 +435,7 @@ class MCPServerBase(BaseModel):
|
|||||||
@field_validator("type")
|
@field_validator("type")
|
||||||
@classmethod
|
@classmethod
|
||||||
def validate_type(cls, v):
|
def validate_type(cls, v):
|
||||||
valid_types = ["official", "custom"]
|
valid_types = ["official", "community"]
|
||||||
if v not in valid_types:
|
if v not in valid_types:
|
||||||
raise ValueError(f"type must be one of: {valid_types}")
|
raise ValueError(f"type must be one of: {valid_types}")
|
||||||
return v
|
return v
|
||||||
|
Loading…
Reference in New Issue
Block a user