Skip to content

Node.js based forum software built for the modern web

fix: openapi schema for ap routes

Julian Lamc86b6f2498d6
diff --git a/public/openapi/read.yaml b/public/openapi/read.yaml
index 9c710781d0..14ed40e1d4 100644
--- a/public/openapi/read.yaml
+++ b/public/openapi/read.yaml
@@ -356,7 +356,9 @@ paths:
$ref: 'read/groups/slug.yaml'
"/api/groups/{slug}/members":
$ref: 'read/groups/slug/members.yaml'
- "/api/world":
+ /api/world:
$ref: 'read/world.yaml'
+ /api/ap:
+ $ref: 'read/ap.yaml'
/api/outgoing:
$ref: 'read/outgoing.yaml'
\ No newline at end of file
diff --git a/public/openapi/read/admin/config.yaml b/public/openapi/read/admin/config.yaml
index f79df9eca6..dcfbcaffc1 100644
--- a/public/openapi/read/admin/config.yaml
+++ b/public/openapi/read/admin/config.yaml
@@ -142,6 +142,11 @@ get:
properties:
size:
type: number
+ activitypub:
+ type: object
+ properties:
+ probe:
+ type: number
acpLang:
type: string
openOutgoingLinksInNewTab:
diff --git a/public/openapi/read/ap.yaml b/public/openapi/read/ap.yaml
new file mode 100644
index 0000000000..0704cc6dab
--- /dev/null
+++ b/public/openapi/read/ap.yaml
@@ -0,0 +1,31 @@
+get:
+ tags:
+ - activitypub
+ summary: Fetch URL for in-app processing
+ description: |
+ This route accepts a URL in the `resource` query parameter, and runs some quick tests to
+ determine whether that address points to an ActivityPub resource. If so, then it will try
+ to process it locally and redirect the user to the local representation of it.
+
+ If there is no local representation available, then the user is sent off-site as originally
+ expected.
+ parameters:
+ - in: query
+ name: resource
+ schema:
+ type: string
+ description: A URL to query for potential ActivityPub resource
+ example: 'https://example.org/ap'
+ responses:
+ "200":
+ description: Sent if the `/api` prefix is used. The `X-Redirect` header is sent with the redirection target.
+ headers:
+ 'X-Redirect':
+ schema:
+ type: string
+ "307":
+ description: Redirect the user to the local representation or original URL.
+ headers:
+ Location:
+ schema:
+ type: string
\ No newline at end of file
diff --git a/public/openapi/read/config.yaml b/public/openapi/read/config.yaml
index 3b38168c2e..77c31d871b 100644
--- a/public/openapi/read/config.yaml
+++ b/public/openapi/read/config.yaml
@@ -174,3 +174,8 @@ get:
type: string
version:
type: string
+ activitypub:
+ type: object
+ properties:
+ probe:
+ type: number
\ No newline at end of file