Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 2
    PagedResponse<T> { List<T>, bool } is another alternative. It might be more useful to return the total number of available results rather than just a bool. If you're designing a HTTP Api, you could put something like that in the X-Total-Count header. In fact I like what this guy does, something like PagedResponse<T> { T data; Paganation paging: { int total; int page etc } }. Commented Apr 26, 2017 at 23:10
  • For your example I think the Boolean is a bad choice no matter where you stick it or how you name it. Far better would be a response that includes and integer representing the total # of items. Commented May 17, 2017 at 2:04
  • at some number of pages, sending all those trues is slower than asking for one page too many Commented May 17, 2017 at 12:48
  • "not explicit what the boolean means" can almost always be solved by replacing the boolean with an enum. Commented May 17, 2017 at 13:07