Community
Participate
Working Groups
When using the RepositoryService.editRepository() I always get a 422 response. I think it might be because the json that is sent contains all attributes of the repository and some of them is read-only? I tested by modifying the json so that it only contained the field that I wanted to change (the description) and that worked OK. The flow that fails is: 1. Obtain a Repository instance from GitHub 2. Change it's description 3. Call the editRepository with that instance Ideally, I would like a method to change individual fields and/or deleting their value. Perhaps the editRepository could take a Map<String,String> instead of a repository? Deleting a field would then be done as: repoService.editRepository(Collections.singletonMap("language", null));
Are you getting an error message back and if so what is it?
I got 422 back. Don't have that branch running now but IIRC, the message was "not authorized" which is bogus given the 422 "Unprocessable Entity" code. I know for sure that I was authorized since the call went through when I altered the json string in my debugger.
Pushed a change to https://git.eclipse.org/r/#/c/5062/ that adds the ability to edit certain fields only
I fixed this on the server side to no longer incorrectly return a 422, you should be able to now edit successfully. Please let me know if you still see issues, I still plan on adding the convenience edit call for the 1.3 release.
Merged commit 056626f17e1fd11b80d11366d12311110ce2e2b7 to master that adds support for editing given repository fields only
The change you made on the server side works well for us. Thanks.