Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
github.com/oapi-codegen/iris-middleware v1.0.5
github.com/oapi-codegen/nethttp-middleware v1.1.2
github.com/oapi-codegen/oapi-codegen/v2 v2.0.0-00010101000000-000000000000
github.com/oapi-codegen/runtime v1.4.0
github.com/oapi-codegen/runtime v1.4.1
github.com/oapi-codegen/testutil v1.1.0
github.com/stretchr/testify v1.11.1
golang.org/x/lint v0.0.0-20241112194109-818c5a804067
Expand Down
6 changes: 4 additions & 2 deletions examples/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,10 @@ github.com/oapi-codegen/iris-middleware v1.0.5 h1:eO33pCvapaf1Xa0esEP0PYcdqPZSeq
github.com/oapi-codegen/iris-middleware v1.0.5/go.mod h1:/ysgvbjWyhfDAouIeUOjzIv+zsXfaIXlAQrsOU9/Kyo=
github.com/oapi-codegen/nethttp-middleware v1.1.2 h1:TQwEU3WM6ifc7ObBEtiJgbRPaCe513tvJpiMJjypVPA=
github.com/oapi-codegen/nethttp-middleware v1.1.2/go.mod h1:5qzjxMSiI8HjLljiOEjvs4RdrWyMPKnExeFS2kr8om4=
github.com/oapi-codegen/runtime v1.4.0 h1:KLOSFOp7UzkbS7Cs1ms6NBEKYr0WmH2wZG0KKbd2er4=
github.com/oapi-codegen/runtime v1.4.0/go.mod h1:5sw5fxCDmnOzKNYmkVNF8d34kyUeejJEY8HNT2WaPec=
github.com/oapi-codegen/nullable v1.1.0 h1:eAh8JVc5430VtYVnq00Hrbpag9PFRGWLjxR1/3KntMs=
github.com/oapi-codegen/nullable v1.1.0/go.mod h1:KUZ3vUzkmEKY90ksAmit2+5juDIhIZhfDl+0PwOQlFY=
github.com/oapi-codegen/runtime v1.4.1 h1:9nwLoI+KrWxzbBcp0jO/R8uXqbik/HUyCvPeU68Y/qo=
github.com/oapi-codegen/runtime v1.4.1/go.mod h1:GwV7hC2hviaMzj+ITfHVRESK5J2W/GefVwIND/bMGvU=
github.com/oapi-codegen/testutil v1.1.0 h1:EufqpNg43acR3qzr3ObhXmWg3Sl2kwtRnUN5GYY4d5g=
github.com/oapi-codegen/testutil v1.1.0/go.mod h1:ttCaYbHvJtHuiyeBF0tPIX+4uhEPTeizXKx28okijLw=
github.com/oasdiff/yaml v0.0.9 h1:zQOvd2UKoozsSsAknnWoDJlSK4lC0mpmjfDsfqNwX48=
Expand Down
2 changes: 1 addition & 1 deletion internal/test/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/labstack/echo/v5 v5.1.0
github.com/oapi-codegen/nullable v1.1.0
github.com/oapi-codegen/oapi-codegen/v2 v2.0.0-00010101000000-000000000000
github.com/oapi-codegen/runtime v1.4.0
github.com/oapi-codegen/runtime v1.4.1
github.com/oapi-codegen/testutil v1.1.0
github.com/stretchr/testify v1.11.1
go.yaml.in/yaml/v3 v3.0.4
Expand Down
4 changes: 2 additions & 2 deletions internal/test/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY=
github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc=
github.com/oapi-codegen/nullable v1.1.0 h1:eAh8JVc5430VtYVnq00Hrbpag9PFRGWLjxR1/3KntMs=
github.com/oapi-codegen/nullable v1.1.0/go.mod h1:KUZ3vUzkmEKY90ksAmit2+5juDIhIZhfDl+0PwOQlFY=
github.com/oapi-codegen/runtime v1.4.0 h1:KLOSFOp7UzkbS7Cs1ms6NBEKYr0WmH2wZG0KKbd2er4=
github.com/oapi-codegen/runtime v1.4.0/go.mod h1:5sw5fxCDmnOzKNYmkVNF8d34kyUeejJEY8HNT2WaPec=
github.com/oapi-codegen/runtime v1.4.1 h1:9nwLoI+KrWxzbBcp0jO/R8uXqbik/HUyCvPeU68Y/qo=
github.com/oapi-codegen/runtime v1.4.1/go.mod h1:GwV7hC2hviaMzj+ITfHVRESK5J2W/GefVwIND/bMGvU=
github.com/oapi-codegen/testutil v1.1.0 h1:EufqpNg43acR3qzr3ObhXmWg3Sl2kwtRnUN5GYY4d5g=
github.com/oapi-codegen/testutil v1.1.0/go.mod h1:ttCaYbHvJtHuiyeBF0tPIX+4uhEPTeizXKx28okijLw=
github.com/oasdiff/yaml v0.0.9 h1:zQOvd2UKoozsSsAknnWoDJlSK4lC0mpmjfDsfqNwX48=
Expand Down
23 changes: 23 additions & 0 deletions internal/test/parameters/param_roundtrip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,29 @@ func testImpl(t *testing.T, handler http.Handler) {
assert.Equal(t, expectedComplexObject, got.DeepObj)
})

// Regression for oapi-codegen/runtime#131: with the v2.7.0 client
// no longer re-encoding query fragments, the runtime marshaller must
// percent-encode reserved URI characters and non-ASCII bytes inside
// deepObject values. Without the fix, '&' splits the value into two
// query params (silent corruption) and non-ASCII bytes produce
// invalid URIs that strict servers reject.
t.Run("deepObject with unicode and reserved chars", func(t *testing.T) {
adversarial := paramclient.ComplexObject{
Object: paramclient.Object{
FirstName: "filter&q=こんにちは",
Role: "admin role+with spaces",
},
Id: 12345,
IsAdmin: true,
}
params := paramclient.GetDeepObjectParams{DeepObj: adversarial}
req, err := paramclient.NewGetDeepObjectRequest(server, &params)
require.NoError(t, err)
var got paramclient.GetDeepObjectParams
doRoundTrip(t, req, &got)
assert.Equal(t, adversarial, got.DeepObj)
Comment on lines +401 to +415

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Echo v5 remains uncovered

This new regression only runs through the shared parameter round-trip suite. Echo v5 has its own separate internal/test/parameters/echov5/echov5_param_test.go suite with an ASCII-only deepObject case, while its generated client uses the same StyleParamWithOptions raw query fragment path. If unicode or reserved-character deepObject serialization regresses in that Echo v5 path, this test will still pass.

})

t.Run("spaceDelimited", func(t *testing.T) {
})

Expand Down