FeatureFuel
4

Using total VS sum for API responses when querying lists of data

Source: appwrite/appwrite#2692 · opened by @brandonroberts
For the REST API responses, when retrieving data from APIs, I'm used to getting some value for the "total number of records" returned in addition to a property that holds an array of the records.

For documents, the response returned currently is:



Traditionally, I've seen total used instead of sum to denote the total number of records returned by the query for the list. I think its worth considering changing sum to total or a name that includes total to align more with how other APIs return the count of records alongside the array of records.

AFTER:



This would be a breaking change, but could possibly provide some sort of backward compatibility for existing users depending on the sum property.

The goal here is to reduce the number of things that diverge away from what other developers consuming REST APIs are used to seeing.

Some examples for reference




Also interested in hearing what others think about this.

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests