@@ -9,31 +9,173 @@ const docTemplate = `{
9
9
"info": {
10
10
"description": "{{escape .Description}}",
11
11
"title": "{{.Title}}",
12
- "termsOfService": "https://tos.santoshk.dev",
13
12
"contact": {
14
- "name": "Santosh Kumar",
15
- "url": "https://twitter.com/sntshk",
16
- "email": "sntshkmr60@gmail.com"
17
- },
18
- "license": {
19
- "name": "Apache 2.0",
20
- "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
13
+ "name": "vinod",
14
+ "url": "http://www.swagger.io/support",
15
+ "email": "support@swagger.io"
21
16
},
22
17
"version": "{{.Version}}"
23
18
},
24
19
"host": "{{.Host}}",
25
20
"basePath": "{{.BasePath}}",
26
- "paths": {}
21
+ "paths": {
22
+ "/": {
23
+ "get": {
24
+ "description": "Hello",
25
+ "consumes": [
26
+ "application/json"
27
+ ],
28
+ "produces": [
29
+ "application/json"
30
+ ],
31
+ "tags": [
32
+ "example"
33
+ ],
34
+ "summary": "hellow example",
35
+ "responses": {
36
+ "200": {
37
+ "description": "OK",
38
+ "schema": {
39
+ "type": "string"
40
+ }
41
+ }
42
+ }
43
+ }
44
+ },
45
+ "/about": {
46
+ "get": {
47
+ "description": "about",
48
+ "consumes": [
49
+ "application/json"
50
+ ],
51
+ "produces": [
52
+ "application/json"
53
+ ],
54
+ "tags": [
55
+ "about"
56
+ ],
57
+ "summary": "about routes",
58
+ "responses": {
59
+ "200": {
60
+ "description": "OK",
61
+ "schema": {
62
+ "type": "string"
63
+ }
64
+ }
65
+ }
66
+ }
67
+ },
68
+ "/user": {
69
+ "get": {
70
+ "description": "users list",
71
+ "consumes": [
72
+ "application/json"
73
+ ],
74
+ "produces": [
75
+ "application/json"
76
+ ],
77
+ "summary": "users list",
78
+ "responses": {
79
+ "200": {
80
+ "description": "OK"
81
+ },
82
+ "400": {
83
+ "description": "Bad Request"
84
+ },
85
+ "404": {
86
+ "description": "Not Found"
87
+ },
88
+ "500": {
89
+ "description": "Internal Server Error"
90
+ }
91
+ }
92
+ }
93
+ },
94
+ "/user/{id}": {
95
+ "get": {
96
+ "description": "user get by id",
97
+ "consumes": [
98
+ "application/json"
99
+ ],
100
+ "produces": [
101
+ "application/json"
102
+ ],
103
+ "summary": "get user id",
104
+ "operationId": "get-string-by-int",
105
+ "parameters": [
106
+ {
107
+ "type": "integer",
108
+ "description": "userid ID",
109
+ "name": "id",
110
+ "in": "path",
111
+ "required": true
112
+ }
113
+ ],
114
+ "responses": {
115
+ "200": {
116
+ "description": "OK"
117
+ },
118
+ "400": {
119
+ "description": "Bad Request"
120
+ },
121
+ "404": {
122
+ "description": "Not Found"
123
+ },
124
+ "500": {
125
+ "description": "Internal Server Error"
126
+ }
127
+ }
128
+ }
129
+ },
130
+ "/user/{name}": {
131
+ "get": {
132
+ "consumes": [
133
+ "application/json"
134
+ ],
135
+ "produces": [
136
+ "application/json"
137
+ ],
138
+ "summary": "get user name",
139
+ "parameters": [
140
+ {
141
+ "type": "string",
142
+ "description": "usernmae",
143
+ "name": "name",
144
+ "in": "path",
145
+ "required": true
146
+ }
147
+ ],
148
+ "responses": {
149
+ "200": {
150
+ "description": "OK"
151
+ },
152
+ "400": {
153
+ "description": "Bad Request"
154
+ },
155
+ "404": {
156
+ "description": "Not Found"
157
+ },
158
+ "500": {
159
+ "description": "Internal Server Error"
160
+ }
161
+ }
162
+ }
163
+ }
164
+ },
165
+ "externalDocs": {
166
+ "description": "OpenAPI",
167
+ "url": "https://swagger.io/resources/open-api/"
168
+ }
27
169
}`
28
170
29
171
// SwaggerInfo holds exported Swagger Info so clients can modify it
30
172
var SwaggerInfo = & swag.Spec {
31
173
Version : "1.0" ,
32
174
Host : "localhost:3001" ,
33
- BasePath : "" ,
175
+ BasePath : "/ " ,
34
176
Schemes : []string {},
35
- Title : "Gin Book Service " ,
36
- Description : "A book management service API in Go using Gin framework. " ,
177
+ Title : "Swagger Example API " ,
178
+ Description : "This is a sample gin web server " ,
37
179
InfoInstanceName : "swagger" ,
38
180
SwaggerTemplate : docTemplate ,
39
181
LeftDelim : "{{" ,
0 commit comments