Running this:
curl -u user:pwd -X PUT -H "Accept: application/json" -H "Content-type: application/json" -d "{\"name\":\"development\"}" http://git.somewhere.com/rest/api/1.0/projects/TM/repos/myrepo/branches/default
Yields this:
{"errors":[{"context":"name","message":"Unrecognized field \"name\" (Class com.atlassian.stash.rest.data.RestBranch), not marked as ignorable\n at [Source: org.apache.catalina.connector.CoyoteInputStream@18c82cf; line: 1, column: 10] (through reference chain: com.atlassian.stash.rest.data.RestBranch[\"name\"])","exceptionName":null}]}
The API browser offers no suggestion of what the field name is supposed to be. I've tried 'branch' and 'default' as the field name, neither of which work.
Try this:
curl -u user:pwd -X PUT -H "Accept: application/json" -H "Content-type: application/json" -d "{\"id\":\"development\"}" http://git.somewhere.com/rest/api/1.0/projects/TM/repos/myrepo/branches/default
(the json should use the "id" property, not "name".
That worked. Thank you for your help.
Is there any way those field names could be documented somewhere, such as the API Browser?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We will be documenting these fields, sorry for the inconvenience!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.