From 19ed19935b713666e3401a4b01f1de87d05e57b0 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Thu, 9 Nov 2023 21:54:17 +0100 Subject: [PATCH] expose star activity to swagger --- modules/forgefed/star.go | 2 +- templates/swagger/v1_json.tmpl | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/modules/forgefed/star.go b/modules/forgefed/star.go index e34c67e7d9..3d52e7a4e1 100644 --- a/modules/forgefed/star.go +++ b/modules/forgefed/star.go @@ -28,7 +28,7 @@ var KnownSourceTypes = SourceTypes{ // Star activity for adding a star to an repository // swagger:model type Star struct { - // swagger: ignore + // swagger:ignore ap.Activity // Source identifies the system generated this Activity. Exact one value has to be specified. Source SourceType `jsonld:"source,omitempty"` diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 736e4e9068..dbe2dde930 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -21,7 +21,7 @@ }, "version": "{{AppVer | JSEscape | Safe}}" }, - "basePath": "{{AppSubUrl | JSEscape | Safe}}/api/v1", + "basePath": "/api/v1", "paths": { "/activitypub/repository-id/{repository-id}": { "get": { @@ -22352,6 +22352,20 @@ }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, + "SourceType": { + "type": "string", + "x-go-package": "code.gitea.io/gitea/modules/forgefed" + }, + "Star": { + "description": "Star activity for adding a star to an repository", + "type": "object", + "properties": { + "Source": { + "$ref": "#/definitions/SourceType" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/forgefed" + }, "StateType": { "description": "StateType issue state type", "type": "string", @@ -24231,4 +24245,4 @@ "TOTPHeader": [] } ] -} +} \ No newline at end of file