Skip to content

Commit

Permalink
Merge pull request #13 from kastenhq/oapi-codegen/v2
Browse files Browse the repository at this point in the history
Switch to oapi-codegen/v2
  • Loading branch information
TimonOmsk authored Dec 22, 2023
2 parents fb69c02 + 79146f9 commit 26dffd7
Show file tree
Hide file tree
Showing 7 changed files with 2,693 additions and 2,203 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ cleanup:

generate: cleanup
@echo "Generating types..."
oapi-codegen -generate types -o ./pkg/client/types.go -package client ${golang_spec}
go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen -generate types -o ./pkg/client/types.go -package client ${golang_spec}
@echo "Generating client..."
oapi-codegen -generate client -o ./pkg/client/client.go -package client ${golang_spec}
go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen -generate client -o ./pkg/client/client.go -package client ${golang_spec}

convert:
@echo "Converting spec..."
cd tools/oapifixer && go build
./tools/oapifixer/oapifixer -input ${vbr_spec} -output ${golang_spec}
./tools/oapifixer/oapifixer -input ${vbr_spec} -output ${golang_spec}
15 changes: 15 additions & 0 deletions build_tools.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//go:build build_tools

// While it's typically not valid to import a "main" package, it's being done
// here in a file that's never compiled (note the "build_tools" build tag above)
// in order to prevent `go mod tidy` from removing the module from the go.mod
// and go.sum files.
//
// This is to ensure that when the Makefile generates the client, the generator
// used is from the version of the module that is referenced by go.mod.

package main

import (
_ "github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen"
)
52 changes: 17 additions & 35 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,29 @@ module github.com/veeamhub/veeam-vbr-sdk-go/v2
go 1.20

require (
github.com/deepmap/oapi-codegen v1.13.0
github.com/labstack/gommon v0.4.0
github.com/deepmap/oapi-codegen/v2 v2.0.0
github.com/oapi-codegen/runtime v1.1.0
github.com/pb33f/libopenapi v0.9.1
)

require (
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/bytedance/sonic v1.9.1 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/gin-gonic/gin v1.9.1 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.14.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/labstack/echo/v4 v4.10.2 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
github.com/getkin/kin-openapi v0.118.0 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/swag v0.21.1 // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/invopop/yaml v0.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/perimeterx/marshmallow v1.1.4 // indirect
github.com/vmware-labs/yaml-jsonpath v0.3.2 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/tools v0.12.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 26dffd7

Please sign in to comment.