Open
Description
API Issue Report
Title
POST /api/endpoint – Duplicate name error does not specify the conflicting name in the name
field
Description
When trying to create or update a resource with an already existing name, the API returns the same generic message ("The name has already been taken.") in both the top-level message
and under the errors.name
field. However, in the errors.name
field, the response should ideally include the exact conflicting name value or a more descriptive message to clarify which name has already been taken.
This will help end users and developers identify the conflict without guessing.
Steps to Reproduce
- Send a
POST
request to the API endpoint with aname
field that already exists in the system. - Observe the response body:
{ "message": "The name has already been taken.", "errors": { "name": [ "The name has already been taken." ] } }
Expected Result
- The
errors.name
field should indicate which name is causing the duplication.
Example:"errors": { "name": [ "The name 'example_name' has already been taken." ] }
Actual Result
- Both
message
anderrors.name
return the same generic message without identifying the conflicting name.
Metadata
Metadata
Assignees
Labels
No labels