forked from loafle/openapi-generator-original
Generate API files as interfaces for go-gin server (#17784)
* add feature to generate only interface files * generate sample * add workflow file foe go gin service * add workflow file foe go gin service * add workflow file foe go gin service * update samples
This commit is contained in:
committed by
GitHub
parent
95377cded4
commit
48565ae5be
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
// WARNING!
|
||||
// Pass --git-repo-id and --git-user-id properties when generating the code
|
||||
//
|
||||
sw "github.com/GIT_USER_ID/GIT_REPO_ID/go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
routes := sw.ApiHandleFunctions{}
|
||||
|
||||
log.Printf("Server started")
|
||||
|
||||
router := sw.NewRouter(routes)
|
||||
|
||||
log.Fatal(router.Run(":8080"))
|
||||
}
|
||||
Reference in New Issue
Block a user