-
Notifications
You must be signed in to change notification settings - Fork 10
Labels
bugSomething isn't workingSomething isn't working
Description
Is your feature request related to a problem?
The POST /configs/{id}/versions endpoint currently returns a raw Pydantic ValidationError string instead of structured field-level errors. This inconsistency hinders effective error handling and debugging.
Describe the solution you'd like
- Return structured errors in the response, similar to other endpoints.
- Ensure the errors are formatted in an array with field and message attributes.
Original issue
Describe the bug
The POST /configs/{id}/versions endpoint returns raw Pydantic ValidationError string in the error field instead of structured field-level errors in the errors array. This is inconsistent with other validation errors.
To Reproduce
- Create a config with a valid config_blob
- Call POST /configs/{id}/versions with an invalid partial update (e.g., provider: "openai" instead of "openai-native", or temperature: 10)
- See the raw error string in the response
Expected behavior
Response should return structured errors like other endpoints:
{
"success": false,
"data": null,
"error": "Validation failed",
"errors": [
{
"field": "name",
"message": "Field required"
},
{
"field": "config_blob.completion.provider",
"message": "Field required"
},
{
"field": "config_blob.completion.type",
"message": "Field required"
}
],
"metadata": null
}
Screenshots
Additional context
Now validation error would be like this:
"success": false,
"data": null,
"error": "Validation failed",
"errors": [
{
"field": "name",
"message": "Field required"
},
{
"field": "config_blob.completion.provider",
"message": "Field required"
},
{
"field": "config_blob.completion.type",
"message": "Field required"
}
],
"metadata": null
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Closed