You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need a better example of what the payload should look like here, the documentation offers a glimpse, based on what is displayed it appears you can have either names or id's.
As you can see it appears that you can have a name or an id, but based on the POST it seems like you need a sourceref param, which is not the case. Additionally working with repos in ado currently if i do not pass a repository id I receive the following error:
Invoke-RestMethod: {"$id":"1","innerException":null,"message":"The guid specified for parameter repositoryId must not be Guid.Empty.\r\nParameter name: repositoryId","typeName":"System.ArgumentException,mscorlib","typeKey":"ArgumentException","errorCode":0,"eventId":0}
The payload in this request used a name for the forked repository akin to the first example. It appears based on the error message the payload is expected to have a RepositoryID. Now, based on this error message one would assume a ResourceId json field is required, but that is actually incorrect, instead of project.name it should be project.id. I tried several different iterations, assuming that perhaps that we cannot mix names and id's which i believe is in fact true, but also using just names failed, in fact using the first payload above complete with the POST yieled an error message that stated a projectId had to be in the URI or in the payload.
It would be incredibly helpful if the documentation included a payload schema with all possible values to be passed in, and a matrix of when to use which. Also, the lackluster error messages are frustrating and attempting to search the internet yields nearly zero useful results.
I am very open to talk about this if anyone from the documentation team would like to take the time.
Jeff
The text was updated successfully, but these errors were encountered:
jeffpatton1971
added a commit
to Azure-Devops-PowerShell-Module/AzDevOps
that referenced
this issue
Jan 21, 2023
We need a better example of what the payload should look like here, the documentation offers a glimpse, based on what is displayed it appears you can have either names or id's.
Name
POST https://dev.azure.com/{organization}/_apis/git/repositories?api-version=7.0
ID POST https://dev.azure.com/{organization}/_apis/git/repositories?sourceRef=users/heads/master&api-version=7.0
As you can see it appears that you can have a name or an id, but based on the POST it seems like you need a sourceref param, which is not the case. Additionally working with repos in ado currently if i do not pass a repository id I receive the following error:
The payload in this request used a name for the forked repository akin to the first example. It appears based on the error message the payload is expected to have a RepositoryID. Now, based on this error message one would assume a ResourceId json field is required, but that is actually incorrect, instead of project.name it should be project.id. I tried several different iterations, assuming that perhaps that we cannot mix names and id's which i believe is in fact true, but also using just names failed, in fact using the first payload above complete with the POST yieled an error message that stated a projectId had to be in the URI or in the payload.
It would be incredibly helpful if the documentation included a payload schema with all possible values to be passed in, and a matrix of when to use which. Also, the lackluster error messages are frustrating and attempting to search the internet yields nearly zero useful results.
I am very open to talk about this if anyone from the documentation team would like to take the time.
Jeff
The text was updated successfully, but these errors were encountered: