diff --git a/changelog.d/4-docs/list-connections b/changelog.d/4-docs/list-connections new file mode 100644 index 0000000000..2dc162819d --- /dev/null +++ b/changelog.d/4-docs/list-connections @@ -0,0 +1 @@ +Add pagination docs to `POST /list-connections` diff --git a/libs/wire-api/src/Wire/API/Routes/Public/Brig.hs b/libs/wire-api/src/Wire/API/Routes/Public/Brig.hs index 97c3f85b4b..54f4ce20a6 100644 --- a/libs/wire-api/src/Wire/API/Routes/Public/Brig.hs +++ b/libs/wire-api/src/Wire/API/Routes/Public/Brig.hs @@ -601,6 +601,7 @@ type ConnectionAPI = :<|> Named "list-connections" ( Summary "List the connections to other users, including remote users" + :> Description PaginationDocs :> ZUser :> "list-connections" :> ReqBody '[JSON] ListConnectionsRequestPaginated diff --git a/libs/wire-api/src/Wire/API/Routes/Public/Galley.hs b/libs/wire-api/src/Wire/API/Routes/Public/Galley.hs index a7bdcd73d2..5f72c2d152 100644 --- a/libs/wire-api/src/Wire/API/Routes/Public/Galley.hs +++ b/libs/wire-api/src/Wire/API/Routes/Public/Galley.hs @@ -225,17 +225,7 @@ type ConversationAPI = :<|> Named "list-conversation-ids" ( Summary "Get all conversation IDs." - :> Description - "The IDs returned by this endpoint are paginated. To\ - \ get the first page, make a call with the `paging_state` field set to\ - \ `null` (or omitted). Whenever the `has_more` field of the response is\ - \ set to `true`, more results are available, and they can be obtained\ - \ by calling the endpoint again, but this time passing the value of\ - \ `paging_state` returned by the previous call. One can continue in\ - \ this fashion until all results are returned, which is indicated by\ - \ `has_more` being `false`. Note that `paging_state` should be\ - \ considered an opaque token. It should not be inspected, or stored, or\ - \ reused across multiple unrelated invokations of the endpoint." + :> Description PaginationDocs :> ZLocalUser :> "conversations" :> "list-ids" diff --git a/libs/wire-api/src/Wire/API/Routes/Public/Util.hs b/libs/wire-api/src/Wire/API/Routes/Public/Util.hs index 1071ef5221..440967cdee 100644 --- a/libs/wire-api/src/Wire/API/Routes/Public/Util.hs +++ b/libs/wire-api/src/Wire/API/Routes/Public/Util.hs @@ -77,3 +77,14 @@ instance fromUnion (Z (I ())) = Unchanged fromUnion (S (Z (I a))) = Updated a fromUnion (S (S x)) = case x of + +type PaginationDocs = + "The IDs returned by this endpoint are paginated. To get the first page, make\ + \ a call with the `paging_state` field set to `null` (or omitted). Whenever the\ + \ `has_more` field of the response is set to `true`, more results are available,\ + \ and they can be obtained by calling the endpoint again, but this time passing\ + \ the value of `paging_state` returned by the previous call. One can continue in\ + \ this fashion until all results are returned, which is indicated by `has_more`\ + \ being `false`. Note that `paging_state` should be considered an opaque token.\ + \ It should not be inspected, or stored, or reused across multiple unrelated\ + \ invocations of the endpoint."