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.
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.
Comments
Similar requests
Homomorphic Encryption of MariaDB contents in Appwrite Cloud
1 vote · 0 comments
🚀 Feature: Cloud functions keep alive
1 vote · 0 comments
🚀 Feature: Something like Claims in FirebaseAuth
1 vote · 0 comments
🗯️ Let's talk about Appwrite's queries
10 votes · 0 comments
🚀 Feature: Block or make it harder to scrape data
1 vote · 0 comments
No comments yet.