Details
-
Bug
-
Resolution: Not A Bug
-
Major
-
None
-
3.36.0
-
4
Description
When you try to create a repository with a duplicate key, you get a database error string instead of a json formatted error.
Create a repository that already exists with same name.
curl -u admin:admin123 -v -X 'POST' \ 'http://localhost:8081/service/rest/v1/repositories/maven/hosted' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "name": "maven-test-host", "online": true, "storage": { "blobStoreName": "default", "strictContentTypeValidation": true, "writePolicy": "allow_once" }, "cleanup": { "policyNames": [ "string" ] }, "component": { "proprietaryComponents": true }, "maven": { "versionPolicy": "MIXED", "layoutPolicy": "STRICT", "contentDisposition": "ATTACHMENT" } }'
If that repo name already exists then it returns a 400 response.
"Cannot index record #67:0: found duplicated key 'maven-test-host' in index 'repository_repository_name_idx' previously assigned to the record #66:0 DB name="config""
Expected Behaviour
Responses should be json format stating that repository maven-test-host already exists.
The API should always return errors of the same format.
Attachments
Issue Links
- is related to
-
NEXUS-30166 Error responses from roles REST API are not in consistent format
-
- Closed
-