What is the default sort order for API endpoints? #66434
Replies: 2 comments 2 replies
This comment was marked as off-topic.
This comment was marked as off-topic.
|
Yes, you are correct. The GitHub API issue events endpoint does not support sorting. The default sort order is created: desc, which means that the events are sorted by their creation time in descending order. The GitHub documentation does not explicitly state the default sort order for the issue events endpoint, but it does mention that the sort and order query parameters are not supported. I agree that it would be helpful to document the default sort order for all API endpoints, even if sorting is not supported. This would make it easier for developers to understand how the data is returned. Here is a link to the GitHub documentation for the issue events endpoint: |
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Uh oh!
There was an error while loading. Please reload this page.
Select Topic Area
Question
Body
Some GitHub API endpoints can be sorted by different attributes, for example issues, comments) let you sort by created or updated.
For other API endpoints, there is no sorting available. For example issue events.
Ideally we could specify sort order for all API endpoints but I realize that is additional work. Just in case it was existing but undocumented behavior, I attempted to specify
/repos/$USERNAME/$REPO_NAME/issues/events?sort=created&order=descbut it did not do anything.It seems like the issue events endpoint sorts items by
created: descby default. Is this the case? Documenting the default sort order would be helpful if we cannot specify a sort order.All reactions