-
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.
- Loading branch information
1 parent
36ae7af
commit 65ab05e
Showing
6 changed files
with
390 additions
and
1 deletion.
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,19 @@ | ||
package api | ||
|
||
import ( | ||
"net/http" | ||
) | ||
|
||
// @Summary Add a new pet to the store | ||
// @Description get string by ID | ||
// @Accept json | ||
// @Produce json | ||
// @Param post_id path int true "Some ID" Format(int64) | ||
// @Success 200 {object} web.GenericResponse[web.Post] | ||
// @Success 222 {object} web.GenericResponseMulti[web.Post, web.Post] | ||
// @Failure 400 {object} web.APIError "We need ID!!" | ||
// @Failure 404 {object} web.APIError "Can not find ID" | ||
// @Router /posts/{post_id} [get] | ||
func GetPost(w http.ResponseWriter, r *http.Request) { | ||
//write your code | ||
} |
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,17 @@ | ||
package main | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/swaggo/swag/testdata/generics_basic/api" | ||
) | ||
|
||
// @title Swagger Example API | ||
// @version 1.0 | ||
// @description This is a sample server Petstore server. | ||
// @host localhost:4000 | ||
// @basePath /api | ||
func main() { | ||
http.HandleFunc("/posts/", api.GetPost) | ||
http.ListenAndServe(":8080", nil) | ||
} |
Oops, something went wrong.