-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix template delims * go mod tidy * Add basic implementation of the servers object --------- Co-authored-by: Tobias Theel <tt@fino.digital>
- Loading branch information
Showing
4 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package main | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/swaggo/swag/v2/testdata/v3/simple/api" | ||
) | ||
|
||
// @title Swagger Example API | ||
// @version 1.0 | ||
// @description This is a sample server Petstore server. | ||
// @termsOfService http://swagger.io/terms/ | ||
|
||
// @contact.name API Support | ||
// @contact.url http://www.swagger.io/support | ||
// @contact.email support@swagger.io | ||
|
||
// @license.name Apache 2.0 | ||
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html | ||
|
||
// @servers.url https://test.petstore.com/v3 | ||
// @servers.description Test Petstore server. | ||
|
||
// @servers.url https://petstore.com/v3 | ||
// @servers.description Production Petstore server. | ||
func main() { | ||
http.HandleFunc("/testapi/get-string-by-int/", api.GetStringByInt) | ||
http.HandleFunc("/testapi/get-struct-array-by-string/", api.GetStructArrayByString) | ||
http.HandleFunc("/testapi/upload", api.Upload) | ||
|
||
http.ListenAndServe(":8080", nil) | ||
} |