Details
-
Bug
-
Resolution: Fixed
-
Low
-
6.10.0, 7.6.0
-
1
-
Severity 3 - Minor
-
1
-
Description
Issue Summary
Unable to reset the value of a repository description afterwards to an empty string using the REST API.
Steps to Reproduce
Step 1: Use the REST API query to set a description for a repository to something like 'test':
curl -u admin:admin -v -X PUT -d '{ "description": "test" }' -H "Content-Type: application/json" http://localhost:7990/rest/api/1.0/projects/FIR/repos/new-repo
Response:
{"slug":"new-repo","id":13,"name":"new-repo","description":"test","scmId":"git","state":"AVAILABLE","statusMessage":"Available","forkable":false,"project":{"key":"FIR","id":1,"name":"first","public":false,"type":"NORMAL","links":{"self":[{"href":"http://localhost:7990/projects/FIR"}]}},"public":true,"links":{"clone":[{"href":"http://localhost:7990/scm/fir/new-repo.git","name":"http"},{"href":"ssh://git@localhost:7999/fir/new-repo.git","name":"ssh"}],"self":[{"href":"http://localhost:7990/projects/FIR/repos/new-repo/browse"}]}}*
Step 2: Now try to change this to a null value using the following:
curl -u admin:admin -v -X PUT -d '{ "description": "" }' -H "Content-Type: application/json" http://localhost:7990/rest/api/1.0/projects/FIR/repos/new-repo
Response:
{"slug":"new-repo","id":13,"name":"new-repo","description":"test","scmId":"git","state":"AVAILABLE","statusMessage":"Available","forkable":false,"project":{"key":"FIR","id":1,"name":"first","public":false,"type":"NORMAL","links":{"self":[{"href":"http://localhost:7990/projects/FIR"}]}},"public":true,"links":{"clone":[{"href":"http://localhost:7990/scm/fir/new-repo.git","name":"http"},{"href":"ssh://git@localhost:7999/fir/new-repo.git","name":"ssh"}],"self":[{"href":"http://localhost:7990/projects/FIR/repos/new-repo/browse"}]}}*
Expected Results
It should change it to a null value, that is, the description of the repository should be reset to empty.
Actual Results
curl -u admin:admin -v -X PUT -d '{ "description": "" }' -H "Content-Type: application/json" http://localhost:7990/rest/api/1.0/projects/FIR/repos/new-repo
Response:
{"slug":"new-repo","id":13,"name":"new-repo","description":"test","scmId":"git","state":"AVAILABLE","statusMessage":"Available","forkable":false,"project":{"key":"FIR","id":1,"name":"first","public":false,"type":"NORMAL","links":{"self":[{"href":"http://localhost:7990/projects/FIR"}]}},"public":true,"links":{"clone":[{"href":"http://localhost:7990/scm/fir/new-repo.git","name":"http"},{"href":"ssh://git@localhost:7999/fir/new-repo.git","name":"ssh"}],"self":[{"href":"http://localhost:7990/projects/FIR/repos/new-repo/browse"}]}}*
the description is still “test”, which means that when you pass an empty value it is ignored. This happens for ” ” null and well anything that is not actual text.
Workaround
Currently there is no known workaround for this behavior. A workaround will be added here when available. Can use the Bitbucket UI instead to change the description.