diff --git a/routers/api/v1/activitypub/person.go b/routers/api/v1/activitypub/person.go index 4be076a9c..3d9c9b0bb 100644 --- a/routers/api/v1/activitypub/person.go +++ b/routers/api/v1/activitypub/person.go @@ -109,8 +109,29 @@ func PersonInbox(ctx *context.APIContext) { // required: true // responses: // responses: - // "204": + // "200": // "$ref": "#/responses/empty" ctx.Status(http.StatusNoContent) } + +// PersonOutbox function +func PersonOutbox(ctx *context.APIContext) { + // swagger:operation GET /activitypub/user/{username}/outbox activitypub activitypubPersonOutbox + // --- + // summary: Returns the outbox + // produces: + // - application/json + // parameters: + // - name: username + // in: path + // description: username of the user + // type: string + // required: true + // responses: + // responses: + // "200": + // "$ref": "#/responses/empty" + + ctx.Status(http.StatusNoContent) +} \ No newline at end of file diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index fb1af75ec..ea0109bfe 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -601,6 +601,7 @@ func Routes(sessioner func(http.Handler) http.Handler) *web.Route { m.Group("/activitypub", func() { m.Get("/user/{username}", activitypub.Person) m.Post("/user/{username}/inbox", activitypub.ReqSignature(), activitypub.PersonInbox) + m.Get("/user/{username}/outbox", activitypub.ReqSignature(), activitypub.PersonOutbox) }) } m.Get("/signing-key.gpg", misc.SigningKey) diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index c068612f5..fdefee778 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -69,8 +69,34 @@ } ], "responses": { - "204": { - "$ref": "#/responses/empty" + "200": { + "$ref": "#/responses/ActivityPub" + } + } + } + }, + "/activitypub/user/{username}/outbox": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "activitypub" + ], + "summary": "Returns the outbox", + "operationId": "activitypubPersonOutbox", + "parameters": [ + { + "type": "string", + "description": "username of the user", + "name": "username", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/ActivityPub" } } }