summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Vyr Cossont <VyrCossont@users.noreply.github.com>2024-03-13 04:23:26 -0700
committerLibravatar GitHub <noreply@github.com>2024-03-13 12:23:26 +0100
commit13b9fd5f9257d02b85cb5e8df54c6a2495bf48ae (patch)
treee3204267946e61ba9b078409bc49e2c27fddf8f0
parent[chore] bump modernc.org/sqlite v1.28.0 -> v1.29.4 (#2749) (diff)
downloadgotosocial-13b9fd5f9257d02b85cb5e8df54c6a2495bf48ae.tar.xz
[bugfix]: Add missing Link headers in Swagger spec (#2751)
* Adds Link headers to all endpoints that use it for paging * Fixes the return type for listing what accounts someone follows
-rw-r--r--docs/api/swagger.yaml24
-rw-r--r--internal/api/client/accounts/followers.go4
-rw-r--r--internal/api/client/accounts/following.go10
-rw-r--r--internal/api/client/accounts/statuses.go4
-rw-r--r--internal/api/client/admin/reportsget.go4
-rw-r--r--internal/api/client/reports/reportsget.go4
6 files changed, 47 insertions, 3 deletions
diff --git a/docs/api/swagger.yaml b/docs/api/swagger.yaml
index 0fe932daa..8e3c942c2 100644
--- a/docs/api/swagger.yaml
+++ b/docs/api/swagger.yaml
@@ -2907,6 +2907,10 @@ paths:
responses:
"200":
description: Array of accounts that follow this account.
+ headers:
+ Link:
+ description: Links to the next and previous queries.
+ type: string
schema:
items:
$ref: '#/definitions/account'
@@ -2967,6 +2971,14 @@ paths:
responses:
"200":
description: Array of accounts that are followed by this account.
+ headers:
+ Link:
+ description: Links to the next and previous queries.
+ type: string
+ schema:
+ items:
+ $ref: '#/definitions/account'
+ type: array
"400":
description: bad request
"401":
@@ -3109,6 +3121,10 @@ paths:
responses:
"200":
description: Array of statuses.
+ headers:
+ Link:
+ description: Links to the next and previous queries.
+ type: string
schema:
items:
$ref: '#/definitions/status'
@@ -4875,6 +4891,10 @@ paths:
responses:
"200":
description: Array of reports.
+ headers:
+ Link:
+ description: Links to the next and previous queries.
+ type: string
schema:
items:
$ref: '#/definitions/adminReport'
@@ -6614,6 +6634,10 @@ paths:
responses:
"200":
description: Array of reports.
+ headers:
+ Link:
+ description: Links to the next and previous queries.
+ type: string
schema:
items:
$ref: '#/definitions/report'
diff --git a/internal/api/client/accounts/followers.go b/internal/api/client/accounts/followers.go
index bedbcef24..d54fd6084 100644
--- a/internal/api/client/accounts/followers.go
+++ b/internal/api/client/accounts/followers.go
@@ -102,6 +102,10 @@ import (
// type: array
// items:
// "$ref": "#/definitions/account"
+// headers:
+// Link:
+// type: string
+// description: Links to the next and previous queries.
// '400':
// description: bad request
// '401':
diff --git a/internal/api/client/accounts/following.go b/internal/api/client/accounts/following.go
index 9a8e488b2..1503eddbf 100644
--- a/internal/api/client/accounts/following.go
+++ b/internal/api/client/accounts/following.go
@@ -99,9 +99,13 @@ import (
// name: accounts
// description: Array of accounts that are followed by this account.
// schema:
-// type: array
-// items:
-// "$ref": "#/definitions/account"
+// type: array
+// items:
+// "$ref": "#/definitions/account"
+// headers:
+// Link:
+// type: string
+// description: Links to the next and previous queries.
// '400':
// description: bad request
// '401':
diff --git a/internal/api/client/accounts/statuses.go b/internal/api/client/accounts/statuses.go
index 870a96891..cd93cb74e 100644
--- a/internal/api/client/accounts/statuses.go
+++ b/internal/api/client/accounts/statuses.go
@@ -119,6 +119,10 @@ import (
// type: array
// items:
// "$ref": "#/definitions/status"
+// headers:
+// Link:
+// type: string
+// description: Links to the next and previous queries.
// '400':
// description: bad request
// '401':
diff --git a/internal/api/client/admin/reportsget.go b/internal/api/client/admin/reportsget.go
index 394962f6b..58501a6d7 100644
--- a/internal/api/client/admin/reportsget.go
+++ b/internal/api/client/admin/reportsget.go
@@ -112,6 +112,10 @@ import (
// type: array
// items:
// "$ref": "#/definitions/adminReport"
+// headers:
+// Link:
+// type: string
+// description: Links to the next and previous queries.
// '400':
// description: bad request
// '401':
diff --git a/internal/api/client/reports/reportsget.go b/internal/api/client/reports/reportsget.go
index ba47f1b8b..5f194a589 100644
--- a/internal/api/client/reports/reportsget.go
+++ b/internal/api/client/reports/reportsget.go
@@ -108,6 +108,10 @@ import (
// type: array
// items:
// "$ref": "#/definitions/report"
+// headers:
+// Link:
+// type: string
+// description: Links to the next and previous queries.
// '400':
// description: bad request
// '401':