Skip to content

Commit f3ac71f

Browse files
committed
Fixed Swagger documentation generation errors
- Removed commented LeftDelim and RightDelim fields in docs.go that were causing compilation errors - Changed license reference to MIT to match project's actual license - Improved documentation title for clarity These are minimal fixes to make the Swagger integration work correctly while maintaining the original implementation structure. - Updated API description to be more specific to the project
1 parent ec23d50 commit f3ac71f

5 files changed

Lines changed: 20 additions & 21 deletions

File tree

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## RUN APPLICATION
2-
run:
2+
run:
33
@echo -e "🚀 Running the application..."
44
@go run *.go
55

@@ -9,7 +9,7 @@ test:
99
@go test -v ./tests/*
1010

1111
## INSTALL SWAG CLI TOOL & PACKAGES
12-
install_swag:
12+
install_swag:
1313
@echo -e "📥 Installing Swag CLI and dependencies..."
1414
@which swag >/dev/null 2>&1 || (echo -e "❌ Swag CLI not found! Installing now..." && go install github.com/swaggo/swag/cmd/swag@latest)
1515
@echo -e "🔄 Updating project dependencies for Swag..."
@@ -18,7 +18,7 @@ install_swag:
1818
@echo -e "✅ Swag installation complete!"
1919

2020
## GENERATE API DOCUMENTATION
21-
generate_docs: install_swag
21+
generate_docs: install_swag
2222
@echo -e "📜 Generating API documentation using Swag..."
2323
@swag init
2424
@echo -e "✅ API documentation generated successfully!"

docs/docs.go

Lines changed: 4 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/swagger.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"swagger": "2.0",
33
"info": {
4-
"description": "This is a sample server celler server.",
5-
"title": "Golang GIN Boilerplate",
4+
"description": "A RESTful API boilerplate with Gin Framework, PostgreSQL, Redis and JWT authentication",
5+
"title": "Golang Gin Boilerplate",
66
"termsOfService": "http://swagger.io/terms/",
77
"contact": {
88
"name": "API Support",
99
"url": "http://www.swagger.io/support",
1010
"email": "support@swagger.io"
1111
},
1212
"license": {
13-
"name": "Apache 2.0",
14-
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
13+
"name": "MIT License",
14+
"url": "https://github.com/Massad/gin-boilerplate/blob/master/LICENSE"
1515
},
1616
"version": "1.0"
1717
},

docs/swagger.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,13 @@ info:
147147
email: support@swagger.io
148148
name: API Support
149149
url: http://www.swagger.io/support
150-
description: This is a sample server celler server.
150+
description: A RESTful API boilerplate with Gin Framework, PostgreSQL, Redis and
151+
JWT authentication
151152
license:
152-
name: Apache 2.0
153-
url: http://www.apache.org/licenses/LICENSE-2.0.html
153+
name: MIT License
154+
url: https://github.com/Massad/gin-boilerplate/blob/master/LICENSE
154155
termsOfService: http://swagger.io/terms/
155-
title: Golang GIN Boilerplate
156+
title: Golang Gin Boilerplate
156157
version: "1.0"
157158
paths:
158159
/article:

main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,17 @@ func TokenAuthMiddleware() gin.HandlerFunc {
6161
}
6262
}
6363

64-
// @title Golang GIN Boilerplate
64+
// @title Golang Gin Boilerplate
6565
// @version 1.0
66-
// @description This is a sample server celler server.
66+
// @description A RESTful API boilerplate with Gin Framework, PostgreSQL, Redis and JWT authentication
6767
// @termsOfService http://swagger.io/terms/
6868

6969
// @contact.name API Support
7070
// @contact.url http://www.swagger.io/support
7171
// @contact.email support@swagger.io
7272

73-
// @license.name Apache 2.0
74-
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
73+
// @license.name MIT License
74+
// @license.url https://github.com/Massad/gin-boilerplate/blob/master/LICENSE
7575

7676
// @host localhost:9000
7777
// @BasePath /v1

0 commit comments

Comments
 (0)