Adds missing OpenAPI configuration file
Also locks the tools versions and launches them from the packages installed by the go mod. Otherwise, they would have to be manually installed beforehand.
This commit is contained in:
parent
e382609c9b
commit
59f4546a81
6
internal/api/api.cfg.yaml
Normal file
6
internal/api/api.cfg.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
package: api
|
||||
generate:
|
||||
echo-server: true
|
||||
models: true
|
||||
embedded-spec: true
|
||||
output: server.gen.go
|
||||
@ -8,7 +8,7 @@ import (
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
//go:generate oapi-codegen --config=api.cfg.yaml ../../docs/openapi.yaml
|
||||
//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen@v2.1.0 --config=api.cfg.yaml ../../docs/openapi.yaml
|
||||
|
||||
type ServerImpl struct {
|
||||
Dal dal.DAL
|
||||
|
||||
@ -9,4 +9,4 @@ type DAL interface {
|
||||
Banks() (entity.Banks, error)
|
||||
}
|
||||
|
||||
//go:generate mockgen -destination=../mock/mock_dal.gen.go -package=mock . DAL
|
||||
//go:generate go run go.uber.org/mock/mockgen@latest -destination=../mock/mock_dal.gen.go -package=mock . DAL
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user