You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
}
`
I thought I must write my business code in those generated *.go files. Once I change the source "api.swagger.yaml" file, I regenerated the api_file.go, and I lost all code I wrote. Is there any mistake I made?
Or, how can I separate the go-server business code from generated stubs code?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, guys, I used this shell to generate go-server stub code.
java -jar ./swagger-codegen-cli-3.0.36.jar generate \ -i ../swagger/data/api.swagger.yaml \ -l go-server \ -o ../dist/go_svr
I found that the generated api_file.go code looks like this:
`
func FilesLs(w http.ResponseWriter, r *http.Request) {
}
`
I thought I must write my business code in those generated *.go files. Once I change the source "api.swagger.yaml" file, I regenerated the api_file.go, and I lost all code I wrote. Is there any mistake I made?
Or, how can I separate the go-server business code from generated stubs code?
Beta Was this translation helpful? Give feedback.
All reactions