Skip to content

Commit cc32b26

Browse files
authored
Add pagination docs to list-connections (#2369)
1 parent ad10493 commit cc32b26

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

changelog.d/4-docs/list-connections

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add pagination docs to `POST /list-connections`

libs/wire-api/src/Wire/API/Routes/Public/Brig.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,7 @@ type ConnectionAPI =
601601
:<|> Named
602602
"list-connections"
603603
( Summary "List the connections to other users, including remote users"
604+
:> Description PaginationDocs
604605
:> ZUser
605606
:> "list-connections"
606607
:> ReqBody '[JSON] ListConnectionsRequestPaginated

libs/wire-api/src/Wire/API/Routes/Public/Galley.hs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -225,17 +225,7 @@ type ConversationAPI =
225225
:<|> Named
226226
"list-conversation-ids"
227227
( Summary "Get all conversation IDs."
228-
:> Description
229-
"The IDs returned by this endpoint are paginated. To\
230-
\ get the first page, make a call with the `paging_state` field set to\
231-
\ `null` (or omitted). Whenever the `has_more` field of the response is\
232-
\ set to `true`, more results are available, and they can be obtained\
233-
\ by calling the endpoint again, but this time passing the value of\
234-
\ `paging_state` returned by the previous call. One can continue in\
235-
\ this fashion until all results are returned, which is indicated by\
236-
\ `has_more` being `false`. Note that `paging_state` should be\
237-
\ considered an opaque token. It should not be inspected, or stored, or\
238-
\ reused across multiple unrelated invokations of the endpoint."
228+
:> Description PaginationDocs
239229
:> ZLocalUser
240230
:> "conversations"
241231
:> "list-ids"

libs/wire-api/src/Wire/API/Routes/Public/Util.hs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,14 @@ instance
7777
fromUnion (Z (I ())) = Unchanged
7878
fromUnion (S (Z (I a))) = Updated a
7979
fromUnion (S (S x)) = case x of
80+
81+
type PaginationDocs =
82+
"The IDs returned by this endpoint are paginated. To get the first page, make\
83+
\ a call with the `paging_state` field set to `null` (or omitted). Whenever the\
84+
\ `has_more` field of the response is set to `true`, more results are available,\
85+
\ and they can be obtained by calling the endpoint again, but this time passing\
86+
\ the value of `paging_state` returned by the previous call. One can continue in\
87+
\ this fashion until all results are returned, which is indicated by `has_more`\
88+
\ being `false`. Note that `paging_state` should be considered an opaque token.\
89+
\ It should not be inspected, or stored, or reused across multiple unrelated\
90+
\ invocations of the endpoint."

0 commit comments

Comments
 (0)