From 4bf040d11eb81d8565027018fdc3a3fed7bb1f34 Mon Sep 17 00:00:00 2001 From: Gaballa Date: Sat, 30 Aug 2025 21:26:46 -0700 Subject: [PATCH 1/2] swagger-cli documentation --- cmd/api/main.go | 3 +- utils/swagger_helper.go | 109 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 utils/swagger_helper.go diff --git a/cmd/api/main.go b/cmd/api/main.go index a4f6b80..ac7fb77 100644 --- a/cmd/api/main.go +++ b/cmd/api/main.go @@ -13,6 +13,7 @@ import ( "github.com/acmcsufoss/api.acmcsuf.com/internal/api/services" "github.com/acmcsufoss/api.acmcsuf.com/internal/db" "github.com/acmcsufoss/api.acmcsuf.com/internal/db/models" + "github.com/acmcsufoss/api.acmcsuf.com/utils" "github.com/gin-gonic/gin" _ "modernc.org/sqlite" @@ -64,11 +65,11 @@ func main() { // Setup swagger docs.SwaggerInfo.Title = "ACM CSUF API" - docs.SwaggerInfo.Description = "This is a documentation of current API available." docs.SwaggerInfo.Version = "1.0" docs.SwaggerInfo.Host = "localhost:8080" docs.SwaggerInfo.BasePath = "/" docs.SwaggerInfo.Schemes = []string{"http", "https"} + docs.SwaggerInfo.Description = utils.SwaggerDescription router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler)) port := os.Getenv("PORT") diff --git a/utils/swagger_helper.go b/utils/swagger_helper.go new file mode 100644 index 0000000..0254a80 --- /dev/null +++ b/utils/swagger_helper.go @@ -0,0 +1,109 @@ +package utils + +// giant bara description, and by bara I mean capybara + +// Description for swagger documentation. +var SwaggerDescription string = "This is a documentation of the **acmcsuf API**.\n\n" + + "---\n" + + "# **csuf-cli**\n" + + "The command line interface tools provide a quick and easy way to test out the currently implemented routes.\n\n" + + "## **csuf events [command]**\n" + + "Use this command to interact with event-related features.\n\n" + + "

Available Commands

\n" + + "\n\n" + + "

Flags

\n" + + "\n\n" + + "

Available Commands & Flags

\n" + + "\n" + + "

-h, --help – Show help for events

\n\n" + + "---\n" + + "

csuf announcements [command]

\n" + + "

Manage ACM CSUF's announcements through the CLI. Use csuf announcements [command] --help for more info on a specific command.

\n\n" + + "

Available Commands & Flags

\n" + + "\n" + + "

-h, --help – Show help for announcements

" From e01bb84688f038319d94c5fd1b1845c481da3335 Mon Sep 17 00:00:00 2001 From: Josh Holman Date: Mon, 1 Sep 2025 14:52:39 -0700 Subject: [PATCH 2/2] update name --- utils/swagger_helper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/swagger_helper.go b/utils/swagger_helper.go index 0254a80..e3ddb40 100644 --- a/utils/swagger_helper.go +++ b/utils/swagger_helper.go @@ -5,7 +5,7 @@ package utils // Description for swagger documentation. var SwaggerDescription string = "This is a documentation of the **acmcsuf API**.\n\n" + "---\n" + - "# **csuf-cli**\n" + + "# **acmcsuf-cli**\n" + "The command line interface tools provide a quick and easy way to test out the currently implemented routes.\n\n" + "## **csuf events [command]**\n" + "Use this command to interact with event-related features.\n\n" +