Skip to content

Commit 1d4e937

Browse files
committed
Create new package structure for runtime
As part of oapi-codegen/oapi-codegen#1142 we can start to reduce our transitive dependencies by refactoring the `pkg/runtime` as it exists in deepmap/oapi-codegen. This allows us to introduce a breaking change (tweaking the structure of this package, including moving the `strictmiddleware` concepts) by creating a fresh package, By moving `runtime` to a separate package, we can allow more frequent updates to the runtime-specific code, without tying it directly to the version of the code generator in use. This also uses package structure to allow reducing the transitive dependencies introduced by `strictmiddleware.go`, where Go will prune the tree if it's unused.
1 parent eed52c6 commit 1d4e937

19 files changed

+198
-30
lines changed

runtime/bind.go renamed to bind.go

File renamed without changes.

runtime/bindform.go renamed to bindform.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"strconv"
1111
"strings"
1212

13-
"github.com/deepmap/oapi-codegen/pkg/types"
13+
"github.com/oapi-codegen/runtime/types"
1414
)
1515

1616
const tagName = "json"

runtime/bindform_test.go renamed to bindform_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"net/url"
77
"testing"
88

9-
"github.com/deepmap/oapi-codegen/pkg/types"
9+
"github.com/oapi-codegen/runtime/types"
1010
"github.com/stretchr/testify/assert"
1111
)
1212

runtime/bindparam.go renamed to bindparam.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"strings"
2424
"time"
2525

26-
"github.com/deepmap/oapi-codegen/pkg/types"
26+
"github.com/oapi-codegen/runtime/types"
2727
)
2828

2929
// BindStyledParameter binds a parameter as described in the Path Parameters

runtime/bindparam_test.go renamed to bindparam_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"testing"
2222
"time"
2323

24-
"github.com/deepmap/oapi-codegen/pkg/types"
24+
"github.com/oapi-codegen/runtime/types"
2525
"github.com/stretchr/testify/assert"
2626
"github.com/stretchr/testify/require"
2727
)

runtime/bindstring.go renamed to bindstring.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"strconv"
2222
"time"
2323

24-
"github.com/deepmap/oapi-codegen/pkg/types"
24+
"github.com/oapi-codegen/runtime/types"
2525
)
2626

2727
// BindStringToObject takes a string, and attempts to assign it to the destination

runtime/bindstring_test.go renamed to bindstring_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"testing"
2020
"time"
2121

22-
"github.com/deepmap/oapi-codegen/pkg/types"
22+
"github.com/oapi-codegen/runtime/types"
2323
"github.com/stretchr/testify/assert"
2424
)
2525

runtime/deepobject.go renamed to deepobject.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"strings"
1212
"time"
1313

14-
"github.com/deepmap/oapi-codegen/pkg/types"
14+
"github.com/oapi-codegen/runtime/types"
1515
)
1616

1717
func marshalDeepObject(in interface{}, path []string) ([]string, error) {
File renamed without changes.

go.mod

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
module github.com/oapi-codegen/runtime
2+
3+
go 1.20
4+
5+
require (
6+
github.com/apapsch/go-jsonmerge/v2 v2.0.0
7+
github.com/gin-gonic/gin v1.9.1
8+
github.com/google/uuid v1.3.1
9+
github.com/labstack/echo/v4 v4.11.1
10+
github.com/stretchr/testify v1.8.4
11+
)
12+
13+
require (
14+
github.com/bytedance/sonic v1.10.0-rc3 // indirect
15+
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
16+
github.com/chenzhuoyu/iasm v0.9.0 // indirect
17+
github.com/davecgh/go-spew v1.1.1 // indirect
18+
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
19+
github.com/gin-contrib/sse v0.1.0 // indirect
20+
github.com/go-playground/locales v0.14.1 // indirect
21+
github.com/go-playground/universal-translator v0.18.1 // indirect
22+
github.com/go-playground/validator/v10 v10.14.1 // indirect
23+
github.com/goccy/go-json v0.10.2 // indirect
24+
github.com/json-iterator/go v1.1.12 // indirect
25+
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
26+
github.com/labstack/gommon v0.4.0 // indirect
27+
github.com/leodido/go-urn v1.2.4 // indirect
28+
github.com/mattn/go-colorable v0.1.13 // indirect
29+
github.com/mattn/go-isatty v0.0.19 // indirect
30+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
31+
github.com/modern-go/reflect2 v1.0.2 // indirect
32+
github.com/pelletier/go-toml/v2 v2.0.9 // indirect
33+
github.com/pmezard/go-difflib v1.0.0 // indirect
34+
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
35+
github.com/ugorji/go/codec v1.2.11 // indirect
36+
github.com/valyala/bytebufferpool v1.0.0 // indirect
37+
github.com/valyala/fasttemplate v1.2.2 // indirect
38+
golang.org/x/arch v0.4.0 // indirect
39+
golang.org/x/crypto v0.11.0 // indirect
40+
golang.org/x/net v0.12.0 // indirect
41+
golang.org/x/sys v0.10.0 // indirect
42+
golang.org/x/text v0.11.0 // indirect
43+
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f // indirect
44+
google.golang.org/protobuf v1.31.0 // indirect
45+
gopkg.in/yaml.v3 v3.0.1 // indirect
46+
)

0 commit comments

Comments
 (0)