Azure / Azure/azure-rest-api-specs
[BUG]Get Commits $top parameter ignored
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
### API Spec link
https://learn.microsoft.com/en-us/rest/api/azure/devops/git/commits/get-commits?view=azure-devops-rest-7.1&tabs=HTTP#on-a-branch
### API Spec version
7.1
### Describe the bug
the $top parameter is ignored as the generated output does not contain more or less items with the parameter being set to different values
### Expected behavior
to match the documentation
### Actual behavior
```
$ curl -H "authorization: bearer $token" -H "content-type: application/json" -X GET "https://dev.azure.com/Clarios/SW_Euler/_apis/git/repositories/Euler/commits?api-version=7.1&searchCriteria.$top=1000" | jq | head
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 67531 100 67531 0 0 67502 0 0:00:01 0:00:01 --:--:-- 67531
{
"count": 100,
"value": [
{
"commitId": "d926c886eaa6bc5e765840f77c8cbfbd82db1910",
"author": {
},
$ curl -H "authorization: bearer $token" -H "content-type: application/json" -X GET "https://dev.azure.com/Clarios/SW_Euler/_apis/git/repositories/Euler/commits?api-version=7.1&searchCriteria.$top=10"
| jq | head
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 67531 100 67531 0 0 83947 0 --:--:-- --:--:-- --:--:-- 83889
{
"count": 100,
"value": [
{
"commitId": "d926c886eaa6bc5e765840f77c8cbfbd82db1910",
"author": {
},
```
### Reproduction Steps
can be taken from actual behavior snippet
### Environment
_No response_
Contributor guide
Research direction
Start with the Azure DevOps Git commits endpoint and compare the repository's 7.1 API specification with the linked Microsoft documentation, focusing on searchCriteria.$top. Reproduce the requests using values 10 and 1000, then verify that the generated API behavior returns the requested number of commits.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100