Repository: getkin/kin-openapi (go)

Issue:
Security Vulnerability CVE-2022-28948 (Medium) detected in github.com/go-yaml/yaml-v2.4.0
This relates to:

https://github.com/getkin/kin-openapi/blob/221a29220d72ba3384a380e316e38f262b97e99f/go.mod#L10

As per https://www.mend.io/vulnerability-database/CVE-2022-28948, would it be possible to upgrade this yaml package to v3.0.0?

Pull request description:
Fix for CVE-2022-28948
Fixes #551 

Patch:
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index 5cdecc9..6c192f9 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -142,3 +142,15 @@ jobs:
           T
           Tag
           XML
+
+  check-goimports:
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v2
+    - uses: actions/setup-go@v3
+      with:
+        go-version: '>=1.17.0'
+    - run: go install github.com/incu6us/goimports-reviser/v2@v2.5.1
+    - run: which goimports-reviser
+    - run: find . -type f -iname '*.go' ! -iname '*.pb.go' -exec goimports-reviser -file-path {} \;
+    - run: git --no-pager diff --exit-code
diff --git a/go.mod b/go.mod
index df32d6a..50aba58 100644
--- a/go.mod
+++ b/go.mod
@@ -3,9 +3,10 @@ module github.com/getkin/kin-openapi
 go 1.16
 
 require (
-	github.com/ghodss/yaml v1.0.0
 	github.com/go-openapi/jsonpointer v0.19.5
 	github.com/gorilla/mux v1.8.0
+	github.com/invopop/yaml v0.1.0
 	github.com/stretchr/testify v1.5.1
-	gopkg.in/yaml.v2 v2.3.0
+	gopkg.in/yaml.v2 v2.4.0 // indirect
+	gopkg.in/yaml.v3 v3.0.1
 )
diff --git a/go.sum b/go.sum
index 2b289d7..a123aaf 100644
--- a/go.sum
+++ b/go.sum
@@ -1,14 +1,14 @@
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
 github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
-github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
 github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY=
 github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
 github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY=
 github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
 github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
 github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
+github.com/invopop/yaml v0.1.0 h1:YW3WGUoJEXYfzWBjn00zIlrw7brGVD0fUKRYDPAPhrc=
+github.com/invopop/yaml v0.1.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q=
 github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
 github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
 github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
@@ -27,5 +27,8 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
-gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
+gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
+gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/openapi3/example.go b/openapi3/example.go
index 080845c..ee40d9e 100644
--- a/openapi3/example.go
+++ b/openapi3/example.go
@@ -4,8 +4,9 @@ import (
 	"context"
 	"fmt"
 
-	"github.com/getkin/kin-openapi/jsoninfo"
 	"github.com/go-openapi/jsonpointer"
+
+	"github.com/getkin/kin-openapi/jsoninfo"
 )
 
 type Examples map[string]*ExampleRef
diff --git a/openapi3/header.go b/openapi3/header.go
index 84ffd88..75e5dd1 100644
--- a/openapi3/header.go
+++ b/openapi3/header.go
@@ -5,8 +5,9 @@ import (
 	"errors"
 	"fmt"
 
-	"github.com/getkin/kin-openapi/jsoninfo"
 	"github.com/go-openapi/jsonpointer"
+
+	"github.com/getkin/kin-openapi/jsoninfo"
 )
 
 type Headers map[string]*HeaderRef
diff --git a/openapi3/link.go b/openapi3/link.go
index 2f0bc57..7f0c49d 100644
--- a/openapi3/link.go
+++ b/openapi3/link.go
@@ -5,8 +5,9 @@ import (
 	"errors"
 	"fmt"
 
-	"github.com/getkin/kin-openapi/jsoninfo"
 	"github.com/go-openapi/jsonpointer"
+
+	"github.com/getkin/kin-openapi/jsoninfo"
 )
 
 type Links map[string]*LinkRef
diff --git a/openapi3/loader.go b/openapi3/loader.go
index 8af733c..e2f131e 100644
--- a/openapi3/loader.go
+++ b/openapi3/loader.go
@@ -12,7 +12,7 @@ import (
 	"strconv"
 	"strings"
 
-	"github.com/ghodss/yaml"
+	"github.com/invopop/yaml"
 )
 
 func foundUnresolvedRef(ref string) error {
diff --git a/openapi3/media_type.go b/openapi3/media_type.go
index dd33b99..fc95244 100644
--- a/openapi3/media_type.go
+++ b/openapi3/media_type.go
@@ -3,8 +3,9 @@ package openapi3
 import (
 	"context"
 
-	"github.com/getkin/kin-openapi/jsoninfo"
 	"github.com/go-openapi/jsonpointer"
+
+	"github.com/getkin/kin-openapi/jsoninfo"
 )
 
 // MediaType is specified by OpenAPI/Swagger 3.0 standard.
diff --git a/openapi3/operation.go b/openapi3/operation.go
index cb9644a..58750ff 100644
--- a/openapi3/operation.go
+++ b/openapi3/operation.go
@@ -6,8 +6,9 @@ import (
 	"fmt"
 	"strconv"
 
-	"github.com/getkin/kin-openapi/jsoninfo"
 	"github.com/go-openapi/jsonpointer"
+
+	"github.com/getkin/kin-openapi/jsoninfo"
 )
 
 // Operation represents "operation" specified by" OpenAPI/Swagger 3.0 standard.
diff --git a/openapi3/parameter.go b/openapi3/parameter.go
index b32898c..7783484 100644
--- a/openapi3/parameter.go
+++ b/openapi3/parameter.go
@@ -6,8 +6,9 @@ import (
 	"fmt"
 	"strconv"
 
-	"github.com/getkin/kin-openapi/jsoninfo"
 	"github.com/go-openapi/jsonpointer"
+
+	"github.com/getkin/kin-openapi/jsoninfo"
 )
 
 type ParametersMap map[string]*ParameterRef
diff --git a/openapi3/refs.go b/openapi3/refs.go
index a706834..0bf737f 100644
--- a/openapi3/refs.go
+++ b/openapi3/refs.go
@@ -3,8 +3,9 @@ package openapi3
 import (
 	"context"
 
-	"github.com/getkin/kin-openapi/jsoninfo"
 	"github.com/go-openapi/jsonpointer"
+
+	"github.com/getkin/kin-openapi/jsoninfo"
 )
 
 // Ref is specified by OpenAPI/Swagger 3.0 standard.
diff --git a/openapi3/request_body.go b/openapi3/request_body.go
index 559eb71..c97563a 100644
--- a/openapi3/request_body.go
+++ b/openapi3/request_body.go
@@ -5,8 +5,9 @@ import (
 	"errors"
 	"fmt"
 
-	"github.com/getkin/kin-openapi/jsoninfo"
 	"github.com/go-openapi/jsonpointer"
+
+	"github.com/getkin/kin-openapi/jsoninfo"
 )
 
 type RequestBodies map[string]*RequestBodyRef
diff --git a/openapi3/response.go b/openapi3/response.go
index 23e2f44..31ea257 100644
--- a/openapi3/response.go
+++ b/openapi3/response.go
@@ -6,8 +6,9 @@ import (
 	"fmt"
 	"strconv"
 
-	"github.com/getkin/kin-openapi/jsoninfo"
 	"github.com/go-openapi/jsonpointer"
+
+	"github.com/getkin/kin-openapi/jsoninfo"
 )
 
 // Responses is specified by OpenAPI/Swagger 3.0 standard.
diff --git a/openapi3/schema.go b/openapi3/schema.go
index 214f4f6..4c8df1c 100644
--- a/openapi3/schema.go
+++ b/openapi3/schema.go
@@ -12,8 +12,9 @@ import (
 	"strconv"
 	"unicode/utf16"
 
-	"github.com/getkin/kin-openapi/jsoninfo"
 	"github.com/go-openapi/jsonpointer"
+
+	"github.com/getkin/kin-openapi/jsoninfo"
 )
 
 const (
diff --git a/openapi3/security_scheme.go b/openapi3/security_scheme.go
index 10057de..52c3ef2 100644
--- a/openapi3/security_scheme.go
+++ b/openapi3/security_scheme.go
@@ -5,8 +5,9 @@ import (
 	"errors"
 	"fmt"
 
-	"github.com/getkin/kin-openapi/jsoninfo"
 	"github.com/go-openapi/jsonpointer"
+
+	"github.com/getkin/kin-openapi/jsoninfo"
 )
 
 type SecuritySchemes map[string]*SecuritySchemeRef
diff --git a/openapi3filter/req_resp_decoder.go b/openapi3filter/req_resp_decoder.go
index 1b5f0c5..a54b3bb 100644
--- a/openapi3filter/req_resp_decoder.go
+++ b/openapi3filter/req_resp_decoder.go
@@ -14,7 +14,7 @@ import (
 	"strconv"
 	"strings"
 
-	"gopkg.in/yaml.v2"
+	"gopkg.in/yaml.v3"
 
 	"github.com/getkin/kin-openapi/openapi3"
 )
diff --git a/routers/gorillamux/router.go b/routers/gorillamux/router.go
index 83bbf82..67be474 100644
--- a/routers/gorillamux/router.go
+++ b/routers/gorillamux/router.go
@@ -12,9 +12,10 @@ import (
 	"sort"
 	"strings"
 
+	"github.com/gorilla/mux"
+
 	"github.com/getkin/kin-openapi/openapi3"
 	"github.com/getkin/kin-openapi/routers"
-	"github.com/gorilla/mux"
 )
 
 var _ routers.Router = &Router{}


Test patch:
diff --git a/openapi2/openapi2_test.go b/openapi2/openapi2_test.go
index 8d3efdf..65e92d6 100644
--- a/openapi2/openapi2_test.go
+++ b/openapi2/openapi2_test.go
@@ -6,8 +6,9 @@ import (
 	"io/ioutil"
 	"reflect"
 
+	"github.com/invopop/yaml"
+
 	"github.com/getkin/kin-openapi/openapi2"
-	"github.com/ghodss/yaml"
 )
 
 func Example() {
diff --git a/openapi2conv/issue187_test.go b/openapi2conv/issue187_test.go
index a701689..93914d9 100644
--- a/openapi2conv/issue187_test.go
+++ b/openapi2conv/issue187_test.go
@@ -5,10 +5,11 @@ import (
 	"encoding/json"
 	"testing"
 
+	"github.com/invopop/yaml"
+	"github.com/stretchr/testify/require"
+
 	"github.com/getkin/kin-openapi/openapi2"
 	"github.com/getkin/kin-openapi/openapi3"
-	"github.com/ghodss/yaml"
-	"github.com/stretchr/testify/require"
 )
 
 func v2v3JSON(spec2 []byte) (doc3 *openapi3.T, err error) {
@@ -162,7 +163,7 @@ paths:
         "200":
           description: description
 `
-	require.Equal(t, string(spec3), expected)
+	require.YAMLEq(t, string(spec3), expected)
 
 	err = doc3.Validate(context.Background())
 	require.NoError(t, err)
diff --git a/openapi2conv/issue440_test.go b/openapi2conv/issue440_test.go
index 24f7a29..2478384 100644
--- a/openapi2conv/issue440_test.go
+++ b/openapi2conv/issue440_test.go
@@ -6,9 +6,10 @@ import (
 	"os"
 	"testing"
 
+	"github.com/stretchr/testify/require"
+
 	"github.com/getkin/kin-openapi/openapi2"
 	"github.com/getkin/kin-openapi/openapi3"
-	"github.com/stretchr/testify/require"
 )
 
 func TestIssue440(t *testing.T) {
diff --git a/openapi3/extension_test.go b/openapi3/extension_test.go
index 9d00902..a995378 100644
--- a/openapi3/extension_test.go
+++ b/openapi3/extension_test.go
@@ -5,8 +5,9 @@ import (
 	"fmt"
 	"testing"
 
-	"github.com/getkin/kin-openapi/jsoninfo"
 	"github.com/stretchr/testify/require"
+
+	"github.com/getkin/kin-openapi/jsoninfo"
 )
 
 func ExampleExtensionProps_DecodeWith() {
diff --git a/openapi3/openapi3_test.go b/openapi3/openapi3_test.go
index 69a2f95..7736310 100644
--- a/openapi3/openapi3_test.go
+++ b/openapi3/openapi3_test.go
@@ -6,7 +6,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/ghodss/yaml"
+	"github.com/invopop/yaml"
 	"github.com/stretchr/testify/require"
 )
 
diff --git a/openapi3/race_test.go b/openapi3/race_test.go
index 4ac31c3..c617cfe 100644
--- a/openapi3/race_test.go
+++ b/openapi3/race_test.go
@@ -4,8 +4,9 @@ import (
 	"context"
 	"testing"
 
-	"github.com/getkin/kin-openapi/openapi3"
 	"github.com/stretchr/testify/require"
+
+	"github.com/getkin/kin-openapi/openapi3"
 )
 
 func TestRaceyPatternSchema(t *testing.T) {
diff --git a/openapi3/unique_items_checker_test.go b/openapi3/unique_items_checker_test.go
index 85147c6..270b797 100644
--- a/openapi3/unique_items_checker_test.go
+++ b/openapi3/unique_items_checker_test.go
@@ -4,8 +4,9 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/getkin/kin-openapi/openapi3"
 	"github.com/stretchr/testify/require"
+
+	"github.com/getkin/kin-openapi/openapi3"
 )
 
 func TestRegisterArrayUniqueItemsChecker(t *testing.T) {
diff --git a/openapi3filter/req_resp_decoder_test.go b/openapi3filter/req_resp_decoder_test.go
index c733bd0..8bd62b1 100644
--- a/openapi3filter/req_resp_decoder_test.go
+++ b/openapi3filter/req_resp_decoder_test.go
@@ -15,9 +15,10 @@ import (
 	"strings"
 	"testing"
 
+	"github.com/stretchr/testify/require"
+
 	"github.com/getkin/kin-openapi/openapi3"
 	legacyrouter "github.com/getkin/kin-openapi/routers/legacy"
-	"github.com/stretchr/testify/require"
 )
 
 func TestDecodeParameter(t *testing.T) {
diff --git a/openapi3filter/validate_readonly_test.go b/openapi3filter/validate_readonly_test.go
index 454a927..1152ec8 100644
--- a/openapi3filter/validate_readonly_test.go
+++ b/openapi3filter/validate_readonly_test.go
@@ -6,9 +6,10 @@ import (
 	"net/http"
 	"testing"
 
+	"github.com/stretchr/testify/require"
+
 	"github.com/getkin/kin-openapi/openapi3"
 	legacyrouter "github.com/getkin/kin-openapi/routers/legacy"
-	"github.com/stretchr/testify/require"
 )
 
 func TestValidatingRequestBodyWithReadOnlyProperty(t *testing.T) {
diff --git a/openapi3filter/validate_request_test.go b/openapi3filter/validate_request_test.go
index b43f6c8..957b692 100644
--- a/openapi3filter/validate_request_test.go
+++ b/openapi3filter/validate_request_test.go
@@ -10,11 +10,12 @@ import (
 	"net/http"
 	"testing"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+
 	"github.com/getkin/kin-openapi/openapi3"
 	"github.com/getkin/kin-openapi/routers"
 	"github.com/getkin/kin-openapi/routers/gorillamux"
-	"github.com/stretchr/testify/assert"
-	"github.com/stretchr/testify/require"
 )
 
 func setupTestRouter(t *testing.T, spec string) routers.Router {
diff --git a/openapi3filter/validate_set_default_test.go b/openapi3filter/validate_set_default_test.go
index bacffe5..4071405 100644
--- a/openapi3filter/validate_set_default_test.go
+++ b/openapi3filter/validate_set_default_test.go
@@ -8,9 +8,10 @@ import (
 	"net/url"
 	"testing"
 
+	"github.com/stretchr/testify/require"
+
 	"github.com/getkin/kin-openapi/openapi3"
 	legacyrouter "github.com/getkin/kin-openapi/routers/legacy"
-	"github.com/stretchr/testify/require"
 )
 
 func TestValidatingRequestParameterAndSetDefault(t *testing.T) {
diff --git a/openapi3filter/validation_discriminator_test.go b/openapi3filter/validation_discriminator_test.go
index c7d6144..adabf40 100644
--- a/openapi3filter/validation_discriminator_test.go
+++ b/openapi3filter/validation_discriminator_test.go
@@ -5,9 +5,10 @@ import (
 	"net/http"
 	"testing"
 
+	"github.com/stretchr/testify/require"
+
 	"github.com/getkin/kin-openapi/openapi3"
 	legacyrouter "github.com/getkin/kin-openapi/routers/legacy"
-	"github.com/stretchr/testify/require"
 )
 
 func TestValidationWithDiscriminatorSelection(t *testing.T) {
diff --git a/openapi3filter/validation_error_test.go b/openapi3filter/validation_error_test.go
index 10d46f8..b9151b8 100644
--- a/openapi3filter/validation_error_test.go
+++ b/openapi3filter/validation_error_test.go
@@ -10,9 +10,10 @@ import (
 	"net/http/httptest"
 	"testing"
 
+	"github.com/stretchr/testify/require"
+
 	"github.com/getkin/kin-openapi/openapi3"
 	"github.com/getkin/kin-openapi/routers"
-	"github.com/stretchr/testify/require"
 )
 
 func newPetstoreRequest(t *testing.T, method, path string, body io.Reader) *http.Request {
diff --git a/openapi3filter/validation_test.go b/openapi3filter/validation_test.go
index 2f7cf80..cd1fa89 100644
--- a/openapi3filter/validation_test.go
+++ b/openapi3filter/validation_test.go
@@ -14,9 +14,10 @@ import (
 	"strings"
 	"testing"
 
+	"github.com/stretchr/testify/require"
+
 	"github.com/getkin/kin-openapi/openapi3"
 	legacyrouter "github.com/getkin/kin-openapi/routers/legacy"
-	"github.com/stretchr/testify/require"
 )
 
 type ExampleRequest struct {
diff --git a/openapi3gen/openapi3gen_test.go b/openapi3gen/openapi3gen_test.go
index a85f5da..a4c2d52 100644
--- a/openapi3gen/openapi3gen_test.go
+++ b/openapi3gen/openapi3gen_test.go
@@ -10,9 +10,10 @@ import (
 	"testing"
 	"time"
 
+	"github.com/stretchr/testify/require"
+
 	"github.com/getkin/kin-openapi/openapi3"
 	"github.com/getkin/kin-openapi/openapi3gen"
-	"github.com/stretchr/testify/require"
 )
 
 func ExampleGenerator_SchemaRefs() {
diff --git a/routers/gorillamux/router_test.go b/routers/gorillamux/router_test.go
index 90f5c3d..31bf416 100644
--- a/routers/gorillamux/router_test.go
+++ b/routers/gorillamux/router_test.go
@@ -6,9 +6,10 @@ import (
 	"sort"
 	"testing"
 
+	"github.com/stretchr/testify/require"
+
 	"github.com/getkin/kin-openapi/openapi3"
 	"github.com/getkin/kin-openapi/routers"
-	"github.com/stretchr/testify/require"
 )
 
 func TestRouter(t *testing.T) {
diff --git a/routers/issue356_test.go b/routers/issue356_test.go
index 307e52a..3e4b9fa 100644
--- a/routers/issue356_test.go
+++ b/routers/issue356_test.go
@@ -8,12 +8,13 @@ import (
 	"strings"
 	"testing"
 
+	"github.com/stretchr/testify/require"
+
 	"github.com/getkin/kin-openapi/openapi3"
 	"github.com/getkin/kin-openapi/openapi3filter"
 	"github.com/getkin/kin-openapi/routers"
 	"github.com/getkin/kin-openapi/routers/gorillamux"
 	"github.com/getkin/kin-openapi/routers/legacy"
-	"github.com/stretchr/testify/require"
 )
 
 func TestIssue356(t *testing.T) {
diff --git a/routers/legacy/issue444_test.go b/routers/legacy/issue444_test.go
index 222ecbb..c1e9b14 100644
--- a/routers/legacy/issue444_test.go
+++ b/routers/legacy/issue444_test.go
@@ -6,10 +6,11 @@ import (
 	"net/http/httptest"
 	"testing"
 
+	"github.com/stretchr/testify/require"
+
 	"github.com/getkin/kin-openapi/openapi3"
 	"github.com/getkin/kin-openapi/openapi3filter"
 	legacyrouter "github.com/getkin/kin-openapi/routers/legacy"
-	"github.com/stretchr/testify/require"
 )
 
 func TestIssue444(t *testing.T) {
diff --git a/routers/legacy/router_test.go b/routers/legacy/router_test.go
index bfc7e11..d4779f5 100644
--- a/routers/legacy/router_test.go
+++ b/routers/legacy/router_test.go
@@ -6,9 +6,10 @@ import (
 	"sort"
 	"testing"
 
+	"github.com/stretchr/testify/require"
+
 	"github.com/getkin/kin-openapi/openapi3"
 	"github.com/getkin/kin-openapi/routers"
-	"github.com/stretchr/testify/require"
 )
 
 func TestRouter(t *testing.T) {