fix: openapi schema for ap routes

This commit is contained in:
Julian Lam
2024-12-11 11:11:58 -05:00
parent 3340720e3d
commit c86b6f2498
4 changed files with 44 additions and 1 deletions

View File

@@ -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'

View File

@@ -142,6 +142,11 @@ get:
properties:
size:
type: number
activitypub:
type: object
properties:
probe:
type: number
acpLang:
type: string
openOutgoingLinksInNewTab:

View File

@@ -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

View File

@@ -174,3 +174,8 @@ get:
type: string
version:
type: string
activitypub:
type: object
properties:
probe:
type: number