Repository: deepmap/oapi-codegen
Pull request #1345 (2023-10-31 19:50:17)

Bump to v2
Ahead of release, we need to update to the v2 package structure, which requires quite a few changes across packages.



Patch:
diff --git a/README.md b/README.md
index b9e6dda..5a467e4 100644
--- a/README.md
+++ b/README.md
@@ -67,7 +67,7 @@ write a lot of boilerplate code to perform all the marshaling and unmarshaling
 into objects which match the OpenAPI 3.0 definition. The code generator in this
 directory does a lot of that for you. You would run it like so:
 
-    go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@latest
+    go install github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen@latest
     oapi-codegen -package petstore petstore-expanded.yaml > petstore.gen.go
 
 Let's go through that `petstore.gen.go` file to show you everything which was
diff --git a/cmd/oapi-codegen/oapi-codegen.go b/cmd/oapi-codegen/oapi-codegen.go
index 9bf3203..95ce915 100644
--- a/cmd/oapi-codegen/oapi-codegen.go
+++ b/cmd/oapi-codegen/oapi-codegen.go
@@ -25,8 +25,8 @@ import (
 
 	"gopkg.in/yaml.v2"
 
-	"github.com/deepmap/oapi-codegen/pkg/codegen"
-	"github.com/deepmap/oapi-codegen/pkg/util"
+	"github.com/deepmap/oapi-codegen/v2/pkg/codegen"
+	"github.com/deepmap/oapi-codegen/v2/pkg/util"
 )
 
 func errExit(format string, args ...interface{}) {
diff --git a/examples/authenticated-api/echo/api/api.gen.go b/examples/authenticated-api/echo/api/api.gen.go
index 13dc44b..bca4d64 100644
--- a/examples/authenticated-api/echo/api/api.gen.go
+++ b/examples/authenticated-api/echo/api/api.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 import (
diff --git a/examples/authenticated-api/echo/api/doc.go b/examples/authenticated-api/echo/api/doc.go
index 51a3a82..d49f353 100644
--- a/examples/authenticated-api/echo/api/doc.go
+++ b/examples/authenticated-api/echo/api/doc.go
@@ -1,3 +1,3 @@
 package api
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml ../../api.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml ../../api.yaml
diff --git a/examples/authenticated-api/echo/main.go b/examples/authenticated-api/echo/main.go
index d28c288..2d1ace8 100644
--- a/examples/authenticated-api/echo/main.go
+++ b/examples/authenticated-api/echo/main.go
@@ -5,8 +5,8 @@ import (
 	"log"
 	"net"
 
-	"github.com/deepmap/oapi-codegen/examples/authenticated-api/echo/api"
-	"github.com/deepmap/oapi-codegen/examples/authenticated-api/echo/server"
+	"github.com/deepmap/oapi-codegen/v2/examples/authenticated-api/echo/api"
+	"github.com/deepmap/oapi-codegen/v2/examples/authenticated-api/echo/server"
 	"github.com/labstack/echo/v4"
 	"github.com/labstack/echo/v4/middleware"
 )
diff --git a/examples/authenticated-api/echo/server/fake_jws.go b/examples/authenticated-api/echo/server/fake_jws.go
index 0cf44e0..46532af 100644
--- a/examples/authenticated-api/echo/server/fake_jws.go
+++ b/examples/authenticated-api/echo/server/fake_jws.go
@@ -4,7 +4,7 @@ import (
 	"crypto/ecdsa"
 	"fmt"
 
-	"github.com/deepmap/oapi-codegen/pkg/ecdsafile"
+	"github.com/deepmap/oapi-codegen/v2/pkg/ecdsafile"
 	"github.com/lestrrat-go/jwx/jwa"
 	"github.com/lestrrat-go/jwx/jwk"
 	"github.com/lestrrat-go/jwx/jws"
diff --git a/examples/authenticated-api/echo/server/server.go b/examples/authenticated-api/echo/server/server.go
index caa87e8..dedb2cb 100644
--- a/examples/authenticated-api/echo/server/server.go
+++ b/examples/authenticated-api/echo/server/server.go
@@ -6,7 +6,7 @@ import (
 	"sort"
 	"sync"
 
-	"github.com/deepmap/oapi-codegen/examples/authenticated-api/echo/api"
+	"github.com/deepmap/oapi-codegen/v2/examples/authenticated-api/echo/api"
 	"github.com/getkin/kin-openapi/openapi3filter"
 	"github.com/labstack/echo/v4"
 	middleware "github.com/oapi-codegen/echo-middleware"
diff --git a/examples/custom-client-type/custom-client-type.gen.go b/examples/custom-client-type/custom-client-type.gen.go
index 0b73a09..79bab48 100644
--- a/examples/custom-client-type/custom-client-type.gen.go
+++ b/examples/custom-client-type/custom-client-type.gen.go
@@ -1,6 +1,6 @@
 // Package customclienttype provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package customclienttype
 
 import (
diff --git a/examples/custom-client-type/doc.go b/examples/custom-client-type/doc.go
index b718ac2..540715b 100644
--- a/examples/custom-client-type/doc.go
+++ b/examples/custom-client-type/doc.go
@@ -3,4 +3,4 @@ package customclienttype
 // This is an example of how to add a prefix to the name of the generated Client struct
 // See https://github.com/deepmap/oapi-codegen/issues/785 for why this might be necessary
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen -config cfg.yaml api.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen -config cfg.yaml api.yaml
diff --git a/examples/go.mod b/examples/go.mod
index c8eadb8..59c7370 100644
--- a/examples/go.mod
+++ b/examples/go.mod
@@ -1,11 +1,11 @@
-module github.com/deepmap/oapi-codegen/examples
+module github.com/deepmap/oapi-codegen/v2/examples
 
 go 1.20
 
-replace github.com/deepmap/oapi-codegen => ../
+replace github.com/deepmap/oapi-codegen/v2 => ../
 
 require (
-	github.com/deepmap/oapi-codegen v0.0.0-00010101000000-000000000000
+	github.com/deepmap/oapi-codegen/v2 v2.0.0-00010101000000-000000000000
 	github.com/getkin/kin-openapi v0.118.0
 	github.com/gin-gonic/gin v1.9.1
 	github.com/go-chi/chi/v5 v5.0.10
diff --git a/examples/no-vcs-version-override/echo/api/api.gen.go b/examples/no-vcs-version-override/echo/api/api.gen.go
index 421870c..6ce0064 100644
--- a/examples/no-vcs-version-override/echo/api/api.gen.go
+++ b/examples/no-vcs-version-override/echo/api/api.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v123.456.789 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v123.456.789 DO NOT EDIT.
 package api
 
 import (
diff --git a/examples/no-vcs-version-override/echo/api/doc.go b/examples/no-vcs-version-override/echo/api/doc.go
index 991e3e6..82d3898 100644
--- a/examples/no-vcs-version-override/echo/api/doc.go
+++ b/examples/no-vcs-version-override/echo/api/doc.go
@@ -1,3 +1,3 @@
 package api
 
-//go:generate go run -ldflags "-X main.noVCSVersionOverride=v123.456.789" github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml ../../api.yaml
+//go:generate go run -ldflags "-X main.noVCSVersionOverride=v123.456.789" github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml ../../api.yaml
diff --git a/examples/petstore-expanded/chi/api/petstore.gen.go b/examples/petstore-expanded/chi/api/petstore.gen.go
index 73c7552..9873123 100644
--- a/examples/petstore-expanded/chi/api/petstore.gen.go
+++ b/examples/petstore-expanded/chi/api/petstore.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 import (
diff --git a/examples/petstore-expanded/chi/api/petstore.go b/examples/petstore-expanded/chi/api/petstore.go
index cc5298c..888d16f 100644
--- a/examples/petstore-expanded/chi/api/petstore.go
+++ b/examples/petstore-expanded/chi/api/petstore.go
@@ -1,4 +1,4 @@
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=cfg.yaml ../../petstore-expanded.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=cfg.yaml ../../petstore-expanded.yaml
 
 package api
 
diff --git a/examples/petstore-expanded/chi/petstore.go b/examples/petstore-expanded/chi/petstore.go
index d714eea..20b1f5c 100644
--- a/examples/petstore-expanded/chi/petstore.go
+++ b/examples/petstore-expanded/chi/petstore.go
@@ -12,7 +12,7 @@ import (
 	"net/http"
 	"os"
 
-	"github.com/deepmap/oapi-codegen/examples/petstore-expanded/chi/api"
+	"github.com/deepmap/oapi-codegen/v2/examples/petstore-expanded/chi/api"
 	middleware "github.com/oapi-codegen/nethttp-middleware"
 	"github.com/go-chi/chi/v5"
 )
diff --git a/examples/petstore-expanded/echo/api/models/models.gen.go b/examples/petstore-expanded/echo/api/models/models.gen.go
index 4be509a..61880b8 100644
--- a/examples/petstore-expanded/echo/api/models/models.gen.go
+++ b/examples/petstore-expanded/echo/api/models/models.gen.go
@@ -1,6 +1,6 @@
 // Package models provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package models
 
 // Error defines model for Error.
diff --git a/examples/petstore-expanded/echo/api/petstore-server.gen.go b/examples/petstore-expanded/echo/api/petstore-server.gen.go
index 8314a77..ddc3a9e 100644
--- a/examples/petstore-expanded/echo/api/petstore-server.gen.go
+++ b/examples/petstore-expanded/echo/api/petstore-server.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 import (
@@ -13,7 +13,7 @@ import (
 	"path"
 	"strings"
 
-	. "github.com/deepmap/oapi-codegen/examples/petstore-expanded/echo/api/models"
+	. "github.com/deepmap/oapi-codegen/v2/examples/petstore-expanded/echo/api/models"
 	"github.com/getkin/kin-openapi/openapi3"
 	"github.com/labstack/echo/v4"
 	"github.com/oapi-codegen/runtime"
diff --git a/examples/petstore-expanded/echo/api/petstore.go b/examples/petstore-expanded/echo/api/petstore.go
index a95997c..4c3f412 100644
--- a/examples/petstore-expanded/echo/api/petstore.go
+++ b/examples/petstore-expanded/echo/api/petstore.go
@@ -12,8 +12,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=models.cfg.yaml ../../petstore-expanded.yaml
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=server.cfg.yaml ../../petstore-expanded.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=models.cfg.yaml ../../petstore-expanded.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=server.cfg.yaml ../../petstore-expanded.yaml
 
 package api
 
@@ -22,7 +22,7 @@ import (
 	"net/http"
 	"sync"
 
-	"github.com/deepmap/oapi-codegen/examples/petstore-expanded/echo/api/models"
+	"github.com/deepmap/oapi-codegen/v2/examples/petstore-expanded/echo/api/models"
 	"github.com/labstack/echo/v4"
 )
 
diff --git a/examples/petstore-expanded/echo/api/server.cfg.yaml b/examples/petstore-expanded/echo/api/server.cfg.yaml
index 3c93576..813270f 100644
--- a/examples/petstore-expanded/echo/api/server.cfg.yaml
+++ b/examples/petstore-expanded/echo/api/server.cfg.yaml
@@ -1,7 +1,7 @@
 package: api
 output: petstore-server.gen.go
 additional-imports:
-  - package: github.com/deepmap/oapi-codegen/examples/petstore-expanded/echo/api/models
+  - package: github.com/deepmap/oapi-codegen/v2/examples/petstore-expanded/echo/api/models
     alias: .
 generate:
   echo-server: true
diff --git a/examples/petstore-expanded/echo/petstore.go b/examples/petstore-expanded/echo/petstore.go
index bbba8e5..ea13d71 100644
--- a/examples/petstore-expanded/echo/petstore.go
+++ b/examples/petstore-expanded/echo/petstore.go
@@ -11,7 +11,7 @@ import (
 	"net"
 	"os"
 
-	"github.com/deepmap/oapi-codegen/examples/petstore-expanded/echo/api"
+	"github.com/deepmap/oapi-codegen/v2/examples/petstore-expanded/echo/api"
 	"github.com/labstack/echo/v4"
 	echomiddleware "github.com/labstack/echo/v4/middleware"
 	middleware "github.com/oapi-codegen/echo-middleware"
diff --git a/examples/petstore-expanded/fiber/api/petstore-server.gen.go b/examples/petstore-expanded/fiber/api/petstore-server.gen.go
index d887232..ffae3e8 100644
--- a/examples/petstore-expanded/fiber/api/petstore-server.gen.go
+++ b/examples/petstore-expanded/fiber/api/petstore-server.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 import (
diff --git a/examples/petstore-expanded/fiber/api/petstore-types.gen.go b/examples/petstore-expanded/fiber/api/petstore-types.gen.go
index 551af8d..3d8ce11 100644
--- a/examples/petstore-expanded/fiber/api/petstore-types.gen.go
+++ b/examples/petstore-expanded/fiber/api/petstore-types.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 // Error defines model for Error.
diff --git a/examples/petstore-expanded/fiber/api/petstore.go b/examples/petstore-expanded/fiber/api/petstore.go
index f69566b..df03e51 100644
--- a/examples/petstore-expanded/fiber/api/petstore.go
+++ b/examples/petstore-expanded/fiber/api/petstore.go
@@ -1,5 +1,5 @@
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=types.cfg.yaml ../../petstore-expanded.yaml
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=server.cfg.yaml ../../petstore-expanded.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=types.cfg.yaml ../../petstore-expanded.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=server.cfg.yaml ../../petstore-expanded.yaml
 
 package api
 
diff --git a/examples/petstore-expanded/fiber/petstore.go b/examples/petstore-expanded/fiber/petstore.go
index 7374cbe..7ea71ed 100644
--- a/examples/petstore-expanded/fiber/petstore.go
+++ b/examples/petstore-expanded/fiber/petstore.go
@@ -13,7 +13,7 @@ import (
 
 	"github.com/gofiber/fiber/v2"
 
-	"github.com/deepmap/oapi-codegen/examples/petstore-expanded/fiber/api"
+	"github.com/deepmap/oapi-codegen/v2/examples/petstore-expanded/fiber/api"
 	middleware "github.com/oapi-codegen/fiber-middleware"
 )
 
diff --git a/examples/petstore-expanded/gin/api/petstore-server.gen.go b/examples/petstore-expanded/gin/api/petstore-server.gen.go
index b96d513..06098b2 100644
--- a/examples/petstore-expanded/gin/api/petstore-server.gen.go
+++ b/examples/petstore-expanded/gin/api/petstore-server.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 import (
diff --git a/examples/petstore-expanded/gin/api/petstore-types.gen.go b/examples/petstore-expanded/gin/api/petstore-types.gen.go
index 551af8d..3d8ce11 100644
--- a/examples/petstore-expanded/gin/api/petstore-types.gen.go
+++ b/examples/petstore-expanded/gin/api/petstore-types.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 // Error defines model for Error.
diff --git a/examples/petstore-expanded/gin/api/petstore.go b/examples/petstore-expanded/gin/api/petstore.go
index c2c8ffa..09c37db 100644
--- a/examples/petstore-expanded/gin/api/petstore.go
+++ b/examples/petstore-expanded/gin/api/petstore.go
@@ -12,8 +12,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=types.cfg.yaml ../../petstore-expanded.yaml
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=server.cfg.yaml ../../petstore-expanded.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=types.cfg.yaml ../../petstore-expanded.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=server.cfg.yaml ../../petstore-expanded.yaml
 
 package api
 
diff --git a/examples/petstore-expanded/gin/petstore.go b/examples/petstore-expanded/gin/petstore.go
index 70028ad..04031e6 100644
--- a/examples/petstore-expanded/gin/petstore.go
+++ b/examples/petstore-expanded/gin/petstore.go
@@ -14,7 +14,7 @@ import (
 
 	"github.com/gin-gonic/gin"
 
-	"github.com/deepmap/oapi-codegen/examples/petstore-expanded/gin/api"
+	"github.com/deepmap/oapi-codegen/v2/examples/petstore-expanded/gin/api"
 	middleware "github.com/oapi-codegen/gin-middleware"
 )
 
diff --git a/examples/petstore-expanded/gorilla/api/petstore.gen.go b/examples/petstore-expanded/gorilla/api/petstore.gen.go
index f5b07ba..f5eb348 100644
--- a/examples/petstore-expanded/gorilla/api/petstore.gen.go
+++ b/examples/petstore-expanded/gorilla/api/petstore.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 import (
diff --git a/examples/petstore-expanded/gorilla/api/petstore.go b/examples/petstore-expanded/gorilla/api/petstore.go
index cc5298c..888d16f 100644
--- a/examples/petstore-expanded/gorilla/api/petstore.go
+++ b/examples/petstore-expanded/gorilla/api/petstore.go
@@ -1,4 +1,4 @@
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=cfg.yaml ../../petstore-expanded.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=cfg.yaml ../../petstore-expanded.yaml
 
 package api
 
diff --git a/examples/petstore-expanded/gorilla/petstore.go b/examples/petstore-expanded/gorilla/petstore.go
index f413c85..d974efd 100644
--- a/examples/petstore-expanded/gorilla/petstore.go
+++ b/examples/petstore-expanded/gorilla/petstore.go
@@ -12,7 +12,7 @@ import (
 	"net/http"
 	"os"
 
-	"github.com/deepmap/oapi-codegen/examples/petstore-expanded/gorilla/api"
+	"github.com/deepmap/oapi-codegen/v2/examples/petstore-expanded/gorilla/api"
 	middleware "github.com/oapi-codegen/nethttp-middleware"
 	"github.com/gorilla/mux"
 )
diff --git a/examples/petstore-expanded/internal/doc.go b/examples/petstore-expanded/internal/doc.go
index b255193..bfd0405 100644
--- a/examples/petstore-expanded/internal/doc.go
+++ b/examples/petstore-expanded/internal/doc.go
@@ -17,4 +17,4 @@ package internal
 // server. The file petstore.gen.go is automatically generated from the schema
 
 // Run oapi-codegen to regenerate the petstore boilerplate
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml ../petstore-expanded.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml ../petstore-expanded.yaml
diff --git a/examples/petstore-expanded/iris/api/petstore-server.gen.go b/examples/petstore-expanded/iris/api/petstore-server.gen.go
index d9394a6..2ff7618 100644
--- a/examples/petstore-expanded/iris/api/petstore-server.gen.go
+++ b/examples/petstore-expanded/iris/api/petstore-server.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 import (
diff --git a/examples/petstore-expanded/iris/api/petstore-types.gen.go b/examples/petstore-expanded/iris/api/petstore-types.gen.go
index 551af8d..3d8ce11 100644
--- a/examples/petstore-expanded/iris/api/petstore-types.gen.go
+++ b/examples/petstore-expanded/iris/api/petstore-types.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 // Error defines model for Error.
diff --git a/examples/petstore-expanded/iris/api/petstore.go b/examples/petstore-expanded/iris/api/petstore.go
index 29d44ad..ab6491d 100644
--- a/examples/petstore-expanded/iris/api/petstore.go
+++ b/examples/petstore-expanded/iris/api/petstore.go
@@ -12,8 +12,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=types.cfg.yaml ../../petstore-expanded.yaml
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=server.cfg.yaml ../../petstore-expanded.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=types.cfg.yaml ../../petstore-expanded.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=server.cfg.yaml ../../petstore-expanded.yaml
 
 package api
 
diff --git a/examples/petstore-expanded/iris/petstore.go b/examples/petstore-expanded/iris/petstore.go
index 9d3829a..feebfcc 100644
--- a/examples/petstore-expanded/iris/petstore.go
+++ b/examples/petstore-expanded/iris/petstore.go
@@ -11,7 +11,7 @@ import (
 	"log"
 	"os"
 
-	"github.com/deepmap/oapi-codegen/examples/petstore-expanded/iris/api"
+	"github.com/deepmap/oapi-codegen/v2/examples/petstore-expanded/iris/api"
 	middleware "github.com/oapi-codegen/iris-middleware"
 	"github.com/kataras/iris/v12"
 )
diff --git a/examples/petstore-expanded/petstore-client.gen.go b/examples/petstore-expanded/petstore-client.gen.go
index 3a16837..e97ccf6 100644
--- a/examples/petstore-expanded/petstore-client.gen.go
+++ b/examples/petstore-expanded/petstore-client.gen.go
@@ -1,6 +1,6 @@
 // Package petstore provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package petstore
 
 import (
diff --git a/examples/petstore-expanded/strict/api/petstore-server.gen.go b/examples/petstore-expanded/strict/api/petstore-server.gen.go
index 86bb165..5a2180a 100644
--- a/examples/petstore-expanded/strict/api/petstore-server.gen.go
+++ b/examples/petstore-expanded/strict/api/petstore-server.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 import (
diff --git a/examples/petstore-expanded/strict/api/petstore-types.gen.go b/examples/petstore-expanded/strict/api/petstore-types.gen.go
index 551af8d..3d8ce11 100644
--- a/examples/petstore-expanded/strict/api/petstore-types.gen.go
+++ b/examples/petstore-expanded/strict/api/petstore-types.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 // Error defines model for Error.
diff --git a/examples/petstore-expanded/strict/api/petstore.go b/examples/petstore-expanded/strict/api/petstore.go
index 29b7bd2..96ecc6a 100644
--- a/examples/petstore-expanded/strict/api/petstore.go
+++ b/examples/petstore-expanded/strict/api/petstore.go
@@ -1,5 +1,5 @@
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=types.cfg.yaml ../../petstore-expanded.yaml
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=server.cfg.yaml ../../petstore-expanded.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=types.cfg.yaml ../../petstore-expanded.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=server.cfg.yaml ../../petstore-expanded.yaml
 
 package api
 
diff --git a/examples/petstore-expanded/strict/petstore.go b/examples/petstore-expanded/strict/petstore.go
index 1ab30c4..f0acac4 100644
--- a/examples/petstore-expanded/strict/petstore.go
+++ b/examples/petstore-expanded/strict/petstore.go
@@ -12,7 +12,7 @@ import (
 	"net/http"
 	"os"
 
-	"github.com/deepmap/oapi-codegen/examples/petstore-expanded/strict/api"
+	"github.com/deepmap/oapi-codegen/v2/examples/petstore-expanded/strict/api"
 	middleware "github.com/oapi-codegen/nethttp-middleware"
 	"github.com/go-chi/chi/v5"
 )
diff --git a/examples/tools.go b/examples/tools.go
index f584776..67a500f 100644
--- a/examples/tools.go
+++ b/examples/tools.go
@@ -4,5 +4,5 @@
 package tools
 
 import (
-	_ "github.com/deepmap/oapi-codegen/cmd/oapi-codegen"
+	_ "github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen"
 )
diff --git a/go.mod b/go.mod
index b1ebb7d..0ac6709 100644
--- a/go.mod
+++ b/go.mod
@@ -1,4 +1,4 @@
-module github.com/deepmap/oapi-codegen
+module github.com/deepmap/oapi-codegen/v2
 
 go 1.20
 
diff --git a/pkg/codegen/codegen.go b/pkg/codegen/codegen.go
index e292cfe..09bf083 100644
--- a/pkg/codegen/codegen.go
+++ b/pkg/codegen/codegen.go
@@ -30,7 +30,7 @@ import (
 	"text/template"
 	"time"
 
-	"github.com/deepmap/oapi-codegen/pkg/util"
+	"github.com/deepmap/oapi-codegen/v2/pkg/util"
 	"github.com/getkin/kin-openapi/openapi3"
 	"golang.org/x/tools/imports"
 )
diff --git a/pkg/codegen/operations.go b/pkg/codegen/operations.go
index c66fa31..dd287bc 100644
--- a/pkg/codegen/operations.go
+++ b/pkg/codegen/operations.go
@@ -23,7 +23,7 @@ import (
 	"text/template"
 	"unicode"
 
-	"github.com/deepmap/oapi-codegen/pkg/util"
+	"github.com/deepmap/oapi-codegen/v2/pkg/util"
 	"github.com/getkin/kin-openapi/openapi3"
 )
 
diff --git a/pkg/codegen/template_helpers.go b/pkg/codegen/template_helpers.go
index 9ca697e..87394c8 100644
--- a/pkg/codegen/template_helpers.go
+++ b/pkg/codegen/template_helpers.go
@@ -20,7 +20,7 @@ import (
 	"strings"
 	"text/template"
 
-	"github.com/deepmap/oapi-codegen/pkg/util"
+	"github.com/deepmap/oapi-codegen/v2/pkg/util"
 	"golang.org/x/text/cases"
 	"golang.org/x/text/language"
 )


Test patch:
diff --git a/cmd/oapi-codegen/oapi-codegen_test.go b/cmd/oapi-codegen/oapi-codegen_test.go
index 06992d9..689a8e9 100644
--- a/cmd/oapi-codegen/oapi-codegen_test.go
+++ b/cmd/oapi-codegen/oapi-codegen_test.go
@@ -3,7 +3,7 @@ package main
 import (
 	"testing"
 
-	"github.com/deepmap/oapi-codegen/pkg/util"
+	"github.com/deepmap/oapi-codegen/v2/pkg/util"
 )
 
 func TestLoader(t *testing.T) {
diff --git a/examples/authenticated-api/echo/server/server_test.go b/examples/authenticated-api/echo/server/server_test.go
index ac58e39..22ee030 100644
--- a/examples/authenticated-api/echo/server/server_test.go
+++ b/examples/authenticated-api/echo/server/server_test.go
@@ -4,7 +4,7 @@ import (
 	"net/http"
 	"testing"
 
-	"github.com/deepmap/oapi-codegen/examples/authenticated-api/echo/api"
+	"github.com/deepmap/oapi-codegen/v2/examples/authenticated-api/echo/api"
 	"github.com/oapi-codegen/testutil"
 	"github.com/labstack/echo/v4"
 	"github.com/stretchr/testify/assert"
diff --git a/examples/petstore-expanded/chi/petstore_test.go b/examples/petstore-expanded/chi/petstore_test.go
index afc3045..aa2380e 100644
--- a/examples/petstore-expanded/chi/petstore_test.go
+++ b/examples/petstore-expanded/chi/petstore_test.go
@@ -7,7 +7,7 @@ import (
 	"net/http/httptest"
 	"testing"
 
-	"github.com/deepmap/oapi-codegen/examples/petstore-expanded/chi/api"
+	"github.com/deepmap/oapi-codegen/v2/examples/petstore-expanded/chi/api"
 	middleware "github.com/oapi-codegen/nethttp-middleware"
 	"github.com/oapi-codegen/testutil"
 	"github.com/go-chi/chi/v5"
diff --git a/examples/petstore-expanded/echo/petstore_test.go b/examples/petstore-expanded/echo/petstore_test.go
index 3018b19..0628125 100644
--- a/examples/petstore-expanded/echo/petstore_test.go
+++ b/examples/petstore-expanded/echo/petstore_test.go
@@ -19,8 +19,8 @@ import (
 	"net/http"
 	"testing"
 
-	"github.com/deepmap/oapi-codegen/examples/petstore-expanded/echo/api"
-	"github.com/deepmap/oapi-codegen/examples/petstore-expanded/echo/api/models"
+	"github.com/deepmap/oapi-codegen/v2/examples/petstore-expanded/echo/api"
+	"github.com/deepmap/oapi-codegen/v2/examples/petstore-expanded/echo/api/models"
 	"github.com/oapi-codegen/testutil"
 	"github.com/labstack/echo/v4"
 	echoMiddleware "github.com/labstack/echo/v4/middleware"
diff --git a/examples/petstore-expanded/echo/pkg_codegen_petstore_test.go b/examples/petstore-expanded/echo/pkg_codegen_petstore_test.go
index 4ced8b4..a6696c2 100644
--- a/examples/petstore-expanded/echo/pkg_codegen_petstore_test.go
+++ b/examples/petstore-expanded/echo/pkg_codegen_petstore_test.go
@@ -9,9 +9,9 @@ import (
 	"net/http/httptest"
 	"testing"
 
-	examplePetstoreClient "github.com/deepmap/oapi-codegen/examples/petstore-expanded"
-	examplePetstore "github.com/deepmap/oapi-codegen/examples/petstore-expanded/echo/api"
-	"github.com/deepmap/oapi-codegen/pkg/codegen"
+	examplePetstoreClient "github.com/deepmap/oapi-codegen/v2/examples/petstore-expanded"
+	examplePetstore "github.com/deepmap/oapi-codegen/v2/examples/petstore-expanded/echo/api"
+	"github.com/deepmap/oapi-codegen/v2/pkg/codegen"
 	"github.com/stretchr/testify/assert"
 	"golang.org/x/lint"
 )
diff --git a/examples/petstore-expanded/fiber/petstore_test.go b/examples/petstore-expanded/fiber/petstore_test.go
index e6a103a..4de3751 100644
--- a/examples/petstore-expanded/fiber/petstore_test.go
+++ b/examples/petstore-expanded/fiber/petstore_test.go
@@ -12,7 +12,7 @@ import (
 	"github.com/gofiber/fiber/v2"
 	"github.com/stretchr/testify/assert"
 
-	"github.com/deepmap/oapi-codegen/examples/petstore-expanded/fiber/api"
+	"github.com/deepmap/oapi-codegen/v2/examples/petstore-expanded/fiber/api"
 )
 
 func doGet(t *testing.T, app *fiber.App, rawURL string) (*http.Response, error) {
diff --git a/examples/petstore-expanded/gin/petstore_test.go b/examples/petstore-expanded/gin/petstore_test.go
index 33ad71a..ad95154 100644
--- a/examples/petstore-expanded/gin/petstore_test.go
+++ b/examples/petstore-expanded/gin/petstore_test.go
@@ -7,7 +7,7 @@ import (
 	"net/http/httptest"
 	"testing"
 
-	"github.com/deepmap/oapi-codegen/examples/petstore-expanded/gin/api"
+	"github.com/deepmap/oapi-codegen/v2/examples/petstore-expanded/gin/api"
 	"github.com/oapi-codegen/testutil"
 	"github.com/stretchr/testify/assert"
 )
diff --git a/examples/petstore-expanded/gorilla/petstore_test.go b/examples/petstore-expanded/gorilla/petstore_test.go
index 5799684..a63dd53 100644
--- a/examples/petstore-expanded/gorilla/petstore_test.go
+++ b/examples/petstore-expanded/gorilla/petstore_test.go
@@ -7,7 +7,7 @@ import (
 	"net/http/httptest"
 	"testing"
 
-	"github.com/deepmap/oapi-codegen/examples/petstore-expanded/gorilla/api"
+	"github.com/deepmap/oapi-codegen/v2/examples/petstore-expanded/gorilla/api"
 	middleware "github.com/oapi-codegen/nethttp-middleware"
 	"github.com/oapi-codegen/testutil"
 	"github.com/gorilla/mux"
diff --git a/examples/petstore-expanded/iris/petstore_test.go b/examples/petstore-expanded/iris/petstore_test.go
index 3bc618a..facb9f2 100644
--- a/examples/petstore-expanded/iris/petstore_test.go
+++ b/examples/petstore-expanded/iris/petstore_test.go
@@ -21,7 +21,7 @@ import (
 	"net/http/httptest"
 	"testing"
 
-	"github.com/deepmap/oapi-codegen/examples/petstore-expanded/iris/api"
+	"github.com/deepmap/oapi-codegen/v2/examples/petstore-expanded/iris/api"
 	"github.com/oapi-codegen/testutil"
 	"github.com/stretchr/testify/assert"
 )
diff --git a/examples/petstore-expanded/strict/petstore_test.go b/examples/petstore-expanded/strict/petstore_test.go
index 404ef45..848c32e 100644
--- a/examples/petstore-expanded/strict/petstore_test.go
+++ b/examples/petstore-expanded/strict/petstore_test.go
@@ -7,7 +7,7 @@ import (
 	"net/http/httptest"
 	"testing"
 
-	"github.com/deepmap/oapi-codegen/examples/petstore-expanded/strict/api"
+	"github.com/deepmap/oapi-codegen/v2/examples/petstore-expanded/strict/api"
 	middleware "github.com/oapi-codegen/nethttp-middleware"
 	"github.com/oapi-codegen/testutil"
 	"github.com/go-chi/chi/v5"
diff --git a/internal/test/all_of/doc.go b/internal/test/all_of/doc.go
index 0388e17..a3284a6 100644
--- a/internal/test/all_of/doc.go
+++ b/internal/test/all_of/doc.go
@@ -1,4 +1,4 @@
 package allof
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config1.yaml openapi.yaml
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config2.yaml openapi.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config1.yaml openapi.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config2.yaml openapi.yaml
diff --git a/internal/test/all_of/v1/openapi.gen.go b/internal/test/all_of/v1/openapi.gen.go
index fbb1146..0b65e40 100644
--- a/internal/test/all_of/v1/openapi.gen.go
+++ b/internal/test/all_of/v1/openapi.gen.go
@@ -1,6 +1,6 @@
 // Package v1 provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package v1
 
 import (
diff --git a/internal/test/all_of/v2/openapi.gen.go b/internal/test/all_of/v2/openapi.gen.go
index 0facf14..f00a14f 100644
--- a/internal/test/all_of/v2/openapi.gen.go
+++ b/internal/test/all_of/v2/openapi.gen.go
@@ -1,6 +1,6 @@
 // Package v2 provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package v2
 
 import (
diff --git a/internal/test/any_of/param/doc.go b/internal/test/any_of/param/doc.go
index 63ff223..71113bd 100644
--- a/internal/test/any_of/param/doc.go
+++ b/internal/test/any_of/param/doc.go
@@ -1,3 +1,3 @@
 package param
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml spec.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml spec.yaml
diff --git a/internal/test/any_of/param/param.gen.go b/internal/test/any_of/param/param.gen.go
index 6c0c55a..b2e3108 100644
--- a/internal/test/any_of/param/param.gen.go
+++ b/internal/test/any_of/param/param.gen.go
@@ -1,6 +1,6 @@
 // Package param provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package param
 
 import (
diff --git a/internal/test/any_of/param/param_test.go b/internal/test/any_of/param/param_test.go
index 748ebc5..9ae6edd 100644
--- a/internal/test/any_of/param/param_test.go
+++ b/internal/test/any_of/param/param_test.go
@@ -3,7 +3,7 @@ package param_test
 import (
 	"testing"
 
-	"github.com/deepmap/oapi-codegen/internal/test/any_of/param"
+	"github.com/deepmap/oapi-codegen/v2/internal/test/any_of/param"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/internal/test/client/client.gen.go b/internal/test/client/client.gen.go
index 3820fe9..64c0ca2 100644
--- a/internal/test/client/client.gen.go
+++ b/internal/test/client/client.gen.go
@@ -1,6 +1,6 @@
 // Package client provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package client
 
 import (
diff --git a/internal/test/client/client_test.go b/internal/test/client/client_test.go
index 473bc37..dd08ae2 100644
--- a/internal/test/client/client_test.go
+++ b/internal/test/client/client_test.go
@@ -3,7 +3,7 @@ package client
 import (
 	"testing"
 
-	"github.com/deepmap/oapi-codegen/pkg/securityprovider"
+	"github.com/deepmap/oapi-codegen/v2/pkg/securityprovider"
 	"github.com/stretchr/testify/assert"
 )
 
diff --git a/internal/test/client/doc.go b/internal/test/client/doc.go
index e7a3a10..a97d93a 100644
--- a/internal/test/client/doc.go
+++ b/internal/test/client/doc.go
@@ -1,3 +1,3 @@
 package client
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --package=client --generate=client,types -o client.gen.go client.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --package=client --generate=client,types -o client.gen.go client.yaml
diff --git a/internal/test/components/components.gen.go b/internal/test/components/components.gen.go
index 3160275..3c3cd98 100644
--- a/internal/test/components/components.gen.go
+++ b/internal/test/components/components.gen.go
@@ -1,6 +1,6 @@
 // Package components provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package components
 
 import (
diff --git a/internal/test/components/doc.go b/internal/test/components/doc.go
index b70ba3d..7d5021b 100644
--- a/internal/test/components/doc.go
+++ b/internal/test/components/doc.go
@@ -1,3 +1,3 @@
 package components
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml components.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml components.yaml
diff --git a/internal/test/externalref/doc.go b/internal/test/externalref/doc.go
index ea1d5f5..805be73 100644
--- a/internal/test/externalref/doc.go
+++ b/internal/test/externalref/doc.go
@@ -1,3 +1,3 @@
 package externalref
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=externalref.cfg.yaml spec.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=externalref.cfg.yaml spec.yaml
diff --git a/internal/test/externalref/externalref.cfg.yaml b/internal/test/externalref/externalref.cfg.yaml
index cc772e9..ceb30d7 100644
--- a/internal/test/externalref/externalref.cfg.yaml
+++ b/internal/test/externalref/externalref.cfg.yaml
@@ -3,8 +3,8 @@ generate:
   models: true
   embedded-spec: true
 import-mapping:
-  ./packageA/spec.yaml: github.com/deepmap/oapi-codegen/internal/test/externalref/packageA
-  ./packageB/spec.yaml: github.com/deepmap/oapi-codegen/internal/test/externalref/packageB
+  ./packageA/spec.yaml: github.com/deepmap/oapi-codegen/v2/internal/test/externalref/packageA
+  ./packageB/spec.yaml: github.com/deepmap/oapi-codegen/v2/internal/test/externalref/packageB
 output: externalref.gen.go
 output-options:
   skip-prune: true
diff --git a/internal/test/externalref/externalref.gen.go b/internal/test/externalref/externalref.gen.go
index 5d2ddd9..c8cf697 100644
--- a/internal/test/externalref/externalref.gen.go
+++ b/internal/test/externalref/externalref.gen.go
@@ -1,6 +1,6 @@
 // Package externalref provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package externalref
 
 import (
@@ -12,8 +12,8 @@ import (
 	"path"
 	"strings"
 
-	externalRef0 "github.com/deepmap/oapi-codegen/internal/test/externalref/packageA"
-	externalRef1 "github.com/deepmap/oapi-codegen/internal/test/externalref/packageB"
+	externalRef0 "github.com/deepmap/oapi-codegen/v2/internal/test/externalref/packageA"
+	externalRef1 "github.com/deepmap/oapi-codegen/v2/internal/test/externalref/packageB"
 	"github.com/getkin/kin-openapi/openapi3"
 )
 
diff --git a/internal/test/externalref/imports_test.go b/internal/test/externalref/imports_test.go
index 607def3..d5296d8 100644
--- a/internal/test/externalref/imports_test.go
+++ b/internal/test/externalref/imports_test.go
@@ -3,8 +3,8 @@ package externalref
 import (
 	"testing"
 
-	packageA "github.com/deepmap/oapi-codegen/internal/test/externalref/packageA"
-	packageB "github.com/deepmap/oapi-codegen/internal/test/externalref/packageB"
+	packageA "github.com/deepmap/oapi-codegen/v2/internal/test/externalref/packageA"
+	packageB "github.com/deepmap/oapi-codegen/v2/internal/test/externalref/packageB"
 	"github.com/stretchr/testify/require"
 )
 
diff --git a/internal/test/externalref/packageA/config.yaml b/internal/test/externalref/packageA/config.yaml
index 03240de..fbff1a6 100644
--- a/internal/test/externalref/packageA/config.yaml
+++ b/internal/test/externalref/packageA/config.yaml
@@ -5,5 +5,5 @@ generate:
 output-options:
   skip-prune: true
 import-mapping:
-  ../packageB/spec.yaml: github.com/deepmap/oapi-codegen/internal/test/externalref/packageB
+  ../packageB/spec.yaml: github.com/deepmap/oapi-codegen/v2/internal/test/externalref/packageB
 output: externalref.gen.go
diff --git a/internal/test/externalref/packageA/doc.go b/internal/test/externalref/packageA/doc.go
index 8a7bb68..6d11f4b 100644
--- a/internal/test/externalref/packageA/doc.go
+++ b/internal/test/externalref/packageA/doc.go
@@ -1,3 +1,3 @@
 package packagea
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml spec.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml spec.yaml
diff --git a/internal/test/externalref/packageA/externalref.gen.go b/internal/test/externalref/packageA/externalref.gen.go
index a890da2..6f569bf 100644
--- a/internal/test/externalref/packageA/externalref.gen.go
+++ b/internal/test/externalref/packageA/externalref.gen.go
@@ -1,6 +1,6 @@
 // Package packagea provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package packagea
 
 import (
@@ -12,7 +12,7 @@ import (
 	"path"
 	"strings"
 
-	externalRef0 "github.com/deepmap/oapi-codegen/internal/test/externalref/packageB"
+	externalRef0 "github.com/deepmap/oapi-codegen/v2/internal/test/externalref/packageB"
 	"github.com/getkin/kin-openapi/openapi3"
 )
 
diff --git a/internal/test/externalref/packageB/doc.go b/internal/test/externalref/packageB/doc.go
index 73641da..2aba2cd 100644
--- a/internal/test/externalref/packageB/doc.go
+++ b/internal/test/externalref/packageB/doc.go
@@ -1,3 +1,3 @@
 package packageb
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml spec.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml spec.yaml
diff --git a/internal/test/externalref/packageB/externalref.gen.go b/internal/test/externalref/packageB/externalref.gen.go
index 6214b1d..e81242e 100644
--- a/internal/test/externalref/packageB/externalref.gen.go
+++ b/internal/test/externalref/packageB/externalref.gen.go
@@ -1,6 +1,6 @@
 // Package packageb provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package packageb
 
 import (
diff --git a/internal/test/go.mod b/internal/test/go.mod
index d8af070..2f09088 100644
--- a/internal/test/go.mod
+++ b/internal/test/go.mod
@@ -1,11 +1,11 @@
-module github.com/deepmap/oapi-codegen/internal/test
+module github.com/deepmap/oapi-codegen/v2/internal/test
 
 go 1.20
 
-replace github.com/deepmap/oapi-codegen => ../../
+replace github.com/deepmap/oapi-codegen/v2 => ../../
 
 require (
-	github.com/deepmap/oapi-codegen v0.0.0-00010101000000-000000000000
+	github.com/deepmap/oapi-codegen/v2 v2.0.0-00010101000000-000000000000
 	github.com/getkin/kin-openapi v0.118.0
 	github.com/gin-gonic/gin v1.9.1
 	github.com/go-chi/chi/v5 v5.0.10
diff --git a/internal/test/issues/issue-1087/api.gen.go b/internal/test/issues/issue-1087/api.gen.go
index d39ab91..7881065 100644
--- a/internal/test/issues/issue-1087/api.gen.go
+++ b/internal/test/issues/issue-1087/api.gen.go
@@ -1,6 +1,6 @@
 // Package issue1087 provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package issue1087
 
 import (
@@ -12,7 +12,7 @@ import (
 	"net/url"
 	"strings"
 
-	externalRef0 "github.com/deepmap/oapi-codegen/internal/test/issues/issue-1087/deps"
+	externalRef0 "github.com/deepmap/oapi-codegen/v2/internal/test/issues/issue-1087/deps"
 	"github.com/go-chi/chi/v5"
 )
 
diff --git a/internal/test/issues/issue-1087/deps/deps.gen.go b/internal/test/issues/issue-1087/deps/deps.gen.go
index c20ce82..91289e9 100644
--- a/internal/test/issues/issue-1087/deps/deps.gen.go
+++ b/internal/test/issues/issue-1087/deps/deps.gen.go
@@ -1,6 +1,6 @@
 // Package deps provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package deps
 
 import (
diff --git a/internal/test/issues/issue-1087/deps/doc.go b/internal/test/issues/issue-1087/deps/doc.go
index 5f2295d..e03a365 100644
--- a/internal/test/issues/issue-1087/deps/doc.go
+++ b/internal/test/issues/issue-1087/deps/doc.go
@@ -1,3 +1,3 @@
 package deps
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml my-deps.json
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml my-deps.json
diff --git a/internal/test/issues/issue-1087/doc.go b/internal/test/issues/issue-1087/doc.go
index 521fd0f..324ca09 100644
--- a/internal/test/issues/issue-1087/doc.go
+++ b/internal/test/issues/issue-1087/doc.go
@@ -1,3 +1,3 @@
 package issue1087
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=server.config.yaml spec.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=server.config.yaml spec.yaml
diff --git a/internal/test/issues/issue-1087/server.config.yaml b/internal/test/issues/issue-1087/server.config.yaml
index 8275b35..cfab0d7 100644
--- a/internal/test/issues/issue-1087/server.config.yaml
+++ b/internal/test/issues/issue-1087/server.config.yaml
@@ -7,4 +7,4 @@ generate:
   embedded-spec: false
   client: true
 import-mapping:
-  ./deps/my-deps.json: github.com/deepmap/oapi-codegen/internal/test/issues/issue-1087/deps
+  ./deps/my-deps.json: github.com/deepmap/oapi-codegen/v2/internal/test/issues/issue-1087/deps
diff --git a/internal/test/issues/issue-1093/api/child/child.gen.go b/internal/test/issues/issue-1093/api/child/child.gen.go
index a5fc316..5de595a 100644
--- a/internal/test/issues/issue-1093/api/child/child.gen.go
+++ b/internal/test/issues/issue-1093/api/child/child.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 import (
@@ -15,7 +15,7 @@ import (
 	"path"
 	"strings"
 
-	externalRef0 "github.com/deepmap/oapi-codegen/internal/test/issues/issue-1093/api/parent"
+	externalRef0 "github.com/deepmap/oapi-codegen/v2/internal/test/issues/issue-1093/api/parent"
 	"github.com/getkin/kin-openapi/openapi3"
 	"github.com/gin-gonic/gin"
 	strictgin "github.com/oapi-codegen/runtime/strictmiddleware/gin"
diff --git a/internal/test/issues/issue-1093/api/parent/parent.gen.go b/internal/test/issues/issue-1093/api/parent/parent.gen.go
index e1ebfa4..e590303 100644
--- a/internal/test/issues/issue-1093/api/parent/parent.gen.go
+++ b/internal/test/issues/issue-1093/api/parent/parent.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 import (
diff --git a/internal/test/issues/issue-1093/child.cfg.yaml b/internal/test/issues/issue-1093/child.cfg.yaml
index 1ebaf78..8c28d43 100644
--- a/internal/test/issues/issue-1093/child.cfg.yaml
+++ b/internal/test/issues/issue-1093/child.cfg.yaml
@@ -6,5 +6,5 @@ generate:
   strict-server: true
   models: true
 import-mapping:
-  parent.api.yaml: github.com/deepmap/oapi-codegen/internal/test/issues/issue-1093/api/parent
+  parent.api.yaml: github.com/deepmap/oapi-codegen/v2/internal/test/issues/issue-1093/api/parent
 output: api/child/child.gen.go
\ No newline at end of file
diff --git a/internal/test/issues/issue-1093/doc.go b/internal/test/issues/issue-1093/doc.go
index b80f0e5..0487fc8 100644
--- a/internal/test/issues/issue-1093/doc.go
+++ b/internal/test/issues/issue-1093/doc.go
@@ -2,5 +2,5 @@
 // See https://github.com/deepmap/oapi-codegen/issues/1093
 package issue1093
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config parent.cfg.yaml parent.api.yaml
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config child.cfg.yaml child.api.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config parent.cfg.yaml parent.api.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config child.cfg.yaml child.api.yaml
diff --git a/internal/test/issues/issue-1093/issue_test.go b/internal/test/issues/issue-1093/issue_test.go
index 277e746..db72344 100644
--- a/internal/test/issues/issue-1093/issue_test.go
+++ b/internal/test/issues/issue-1093/issue_test.go
@@ -7,7 +7,7 @@ import (
 	"github.com/getkin/kin-openapi/openapi3"
 	"github.com/stretchr/testify/require"
 
-	"github.com/deepmap/oapi-codegen/pkg/codegen"
+	"github.com/deepmap/oapi-codegen/v2/pkg/codegen"
 )
 
 //go:embed child.api.yaml
@@ -29,7 +29,7 @@ func TestIssue(t *testing.T) {
 			EmbeddedSpec: true,
 		},
 		ImportMapping: map[string]string{
-			"parent.api.yaml": "github.com/deepmap/oapi-codegen/internal/test/issues/issue-1093/api/parent",
+			"parent.api.yaml": "github.com/deepmap/oapi-codegen/v2/internal/test/issues/issue-1093/api/parent",
 		},
 	}
 
diff --git a/internal/test/issues/issue-1127/api.gen.go b/internal/test/issues/issue-1127/api.gen.go
index cc8412e..02e87eb 100644
--- a/internal/test/issues/issue-1127/api.gen.go
+++ b/internal/test/issues/issue-1127/api.gen.go
@@ -1,6 +1,6 @@
 // Package issue1127 provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package issue1127
 
 // Whatever defines model for Whatever.
diff --git a/internal/test/issues/issue-1127/doc.go b/internal/test/issues/issue-1127/doc.go
index 78bc2ef..9f60b28 100644
--- a/internal/test/issues/issue-1127/doc.go
+++ b/internal/test/issues/issue-1127/doc.go
@@ -1,3 +1,3 @@
 package issue1127
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=server.config.yaml spec.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=server.config.yaml spec.yaml
diff --git a/internal/test/issues/issue-1168/api.gen.go b/internal/test/issues/issue-1168/api.gen.go
index c520f21..1f44dc4 100644
--- a/internal/test/issues/issue-1168/api.gen.go
+++ b/internal/test/issues/issue-1168/api.gen.go
@@ -1,6 +1,6 @@
 // Package issue1168 provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package issue1168
 
 import (
diff --git a/internal/test/issues/issue-1168/doc.go b/internal/test/issues/issue-1168/doc.go
index 9916b7b..3d20397 100644
--- a/internal/test/issues/issue-1168/doc.go
+++ b/internal/test/issues/issue-1168/doc.go
@@ -1,3 +1,3 @@
 package issue1168
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=server.config.yaml spec.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=server.config.yaml spec.yaml
diff --git a/internal/test/issues/issue-1180/doc.go b/internal/test/issues/issue-1180/doc.go
index b195cec..5b4cdf7 100644
--- a/internal/test/issues/issue-1180/doc.go
+++ b/internal/test/issues/issue-1180/doc.go
@@ -1,3 +1,3 @@
 package issue1180
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml issue.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml issue.yaml
diff --git a/internal/test/issues/issue-1180/issue.gen.go b/internal/test/issues/issue-1180/issue.gen.go
index a9da529..17a9f00 100644
--- a/internal/test/issues/issue-1180/issue.gen.go
+++ b/internal/test/issues/issue-1180/issue.gen.go
@@ -1,6 +1,6 @@
 // Package issue1180 provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package issue1180
 
 import (
diff --git a/internal/test/issues/issue-1182/pkg1/config.yaml b/internal/test/issues/issue-1182/pkg1/config.yaml
index 3bdf594..a1e9af4 100644
--- a/internal/test/issues/issue-1182/pkg1/config.yaml
+++ b/internal/test/issues/issue-1182/pkg1/config.yaml
@@ -7,4 +7,4 @@ generate:
   strict-server: true
 output: pkg1.gen.go
 import-mapping:
-  pkg2.yaml: github.com/deepmap/oapi-codegen/internal/test/issues/issue-1182/pkg2
+  pkg2.yaml: github.com/deepmap/oapi-codegen/v2/internal/test/issues/issue-1182/pkg2
diff --git a/internal/test/issues/issue-1182/pkg1/doc.go b/internal/test/issues/issue-1182/pkg1/doc.go
index 9b814a9..060f762 100644
--- a/internal/test/issues/issue-1182/pkg1/doc.go
+++ b/internal/test/issues/issue-1182/pkg1/doc.go
@@ -1,3 +1,3 @@
 package pkg1
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml ../pkg1.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml ../pkg1.yaml
diff --git a/internal/test/issues/issue-1182/pkg1/pkg1.gen.go b/internal/test/issues/issue-1182/pkg1/pkg1.gen.go
index ecb258d..ce8632b 100644
--- a/internal/test/issues/issue-1182/pkg1/pkg1.gen.go
+++ b/internal/test/issues/issue-1182/pkg1/pkg1.gen.go
@@ -1,6 +1,6 @@
 // Package pkg1 provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package pkg1
 
 import (
@@ -15,7 +15,7 @@ import (
 	"path"
 	"strings"
 
-	externalRef0 "github.com/deepmap/oapi-codegen/internal/test/issues/issue-1182/pkg2"
+	externalRef0 "github.com/deepmap/oapi-codegen/v2/internal/test/issues/issue-1182/pkg2"
 	"github.com/getkin/kin-openapi/openapi3"
 	"github.com/labstack/echo/v4"
 	strictecho "github.com/oapi-codegen/runtime/strictmiddleware/echo"
diff --git a/internal/test/issues/issue-1182/pkg2/doc.go b/internal/test/issues/issue-1182/pkg2/doc.go
index 5acb190..fcb267c 100644
--- a/internal/test/issues/issue-1182/pkg2/doc.go
+++ b/internal/test/issues/issue-1182/pkg2/doc.go
@@ -1,3 +1,3 @@
 package pkg2
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml ../pkg2.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml ../pkg2.yaml
diff --git a/internal/test/issues/issue-1182/pkg2/pkg2.gen.go b/internal/test/issues/issue-1182/pkg2/pkg2.gen.go
index f64a4d2..682bec3 100644
--- a/internal/test/issues/issue-1182/pkg2/pkg2.gen.go
+++ b/internal/test/issues/issue-1182/pkg2/pkg2.gen.go
@@ -1,6 +1,6 @@
 // Package pkg2 provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package pkg2
 
 import (
diff --git a/internal/test/issues/issue-1189/doc.go b/internal/test/issues/issue-1189/doc.go
index b804515..c5c647f 100644
--- a/internal/test/issues/issue-1189/doc.go
+++ b/internal/test/issues/issue-1189/doc.go
@@ -1,3 +1,3 @@
 package param
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml issue1189.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml issue1189.yaml
diff --git a/internal/test/issues/issue-1189/issue1189.gen.go b/internal/test/issues/issue-1189/issue1189.gen.go
index c48fa86..415ffd0 100644
--- a/internal/test/issues/issue-1189/issue1189.gen.go
+++ b/internal/test/issues/issue-1189/issue1189.gen.go
@@ -1,6 +1,6 @@
 // Package param provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package param
 
 import (
diff --git a/internal/test/issues/issue-1208-1209/doc.go b/internal/test/issues/issue-1208-1209/doc.go
index 13c8dd5..bd18f83 100644
--- a/internal/test/issues/issue-1208-1209/doc.go
+++ b/internal/test/issues/issue-1208-1209/doc.go
@@ -1,3 +1,3 @@
 package multijson
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml issue-multi-json.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml issue-multi-json.yaml
diff --git a/internal/test/issues/issue-1208-1209/issue-multi-json.gen.go b/internal/test/issues/issue-1208-1209/issue-multi-json.gen.go
index af31dc2..dc43f33 100644
--- a/internal/test/issues/issue-1208-1209/issue-multi-json.gen.go
+++ b/internal/test/issues/issue-1208-1209/issue-multi-json.gen.go
@@ -1,6 +1,6 @@
 // Package multijson provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package multijson
 
 import (
diff --git a/internal/test/issues/issue-1208-1209/issue-multi-json_test.go b/internal/test/issues/issue-1208-1209/issue-multi-json_test.go
index f97041e..825a990 100644
--- a/internal/test/issues/issue-1208-1209/issue-multi-json_test.go
+++ b/internal/test/issues/issue-1208-1209/issue-multi-json_test.go
@@ -6,7 +6,7 @@ import (
 	"net/http"
 	"testing"
 
-	multijson "github.com/deepmap/oapi-codegen/internal/test/issues/issue-1208-1209"
+	multijson "github.com/deepmap/oapi-codegen/v2/internal/test/issues/issue-1208-1209"
 	"github.com/stretchr/testify/assert"
 )
 
diff --git a/internal/test/issues/issue-1212/pkg1/config.yaml b/internal/test/issues/issue-1212/pkg1/config.yaml
index d88ef6a..9a0498e 100644
--- a/internal/test/issues/issue-1212/pkg1/config.yaml
+++ b/internal/test/issues/issue-1212/pkg1/config.yaml
@@ -7,4 +7,4 @@ generate:
   strict-server: true
 output: pkg1.gen.go
 import-mapping:
-  pkg2.yaml: github.com/deepmap/oapi-codegen/internal/test/issues/issue-1212/pkg2
+  pkg2.yaml: github.com/deepmap/oapi-codegen/v2/internal/test/issues/issue-1212/pkg2
diff --git a/internal/test/issues/issue-1212/pkg1/doc.go b/internal/test/issues/issue-1212/pkg1/doc.go
index 9b814a9..060f762 100644
--- a/internal/test/issues/issue-1212/pkg1/doc.go
+++ b/internal/test/issues/issue-1212/pkg1/doc.go
@@ -1,3 +1,3 @@
 package pkg1
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml ../pkg1.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml ../pkg1.yaml
diff --git a/internal/test/issues/issue-1212/pkg1/pkg1.gen.go b/internal/test/issues/issue-1212/pkg1/pkg1.gen.go
index 4f5f743..d7a20ec 100644
--- a/internal/test/issues/issue-1212/pkg1/pkg1.gen.go
+++ b/internal/test/issues/issue-1212/pkg1/pkg1.gen.go
@@ -1,6 +1,6 @@
 // Package pkg1 provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package pkg1
 
 import (
@@ -16,7 +16,7 @@ import (
 	"path"
 	"strings"
 
-	externalRef0 "github.com/deepmap/oapi-codegen/internal/test/issues/issue-1212/pkg2"
+	externalRef0 "github.com/deepmap/oapi-codegen/v2/internal/test/issues/issue-1212/pkg2"
 	"github.com/getkin/kin-openapi/openapi3"
 	"github.com/gin-gonic/gin"
 	strictgin "github.com/oapi-codegen/runtime/strictmiddleware/gin"
diff --git a/internal/test/issues/issue-1212/pkg2/doc.go b/internal/test/issues/issue-1212/pkg2/doc.go
index 5acb190..fcb267c 100644
--- a/internal/test/issues/issue-1212/pkg2/doc.go
+++ b/internal/test/issues/issue-1212/pkg2/doc.go
@@ -1,3 +1,3 @@
 package pkg2
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml ../pkg2.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml ../pkg2.yaml
diff --git a/internal/test/issues/issue-1212/pkg2/pkg2.gen.go b/internal/test/issues/issue-1212/pkg2/pkg2.gen.go
index ecd8309..fa8d50f 100644
--- a/internal/test/issues/issue-1212/pkg2/pkg2.gen.go
+++ b/internal/test/issues/issue-1212/pkg2/pkg2.gen.go
@@ -1,6 +1,6 @@
 // Package pkg2 provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package pkg2
 
 import (
diff --git a/internal/test/issues/issue-1219/doc.go b/internal/test/issues/issue-1219/doc.go
index bc616c1..6976b42 100644
--- a/internal/test/issues/issue-1219/doc.go
+++ b/internal/test/issues/issue-1219/doc.go
@@ -1,3 +1,3 @@
 package issue1219
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml issue.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml issue.yaml
diff --git a/internal/test/issues/issue-1219/issue.gen.go b/internal/test/issues/issue-1219/issue.gen.go
index dd4d3dc..d0935ec 100644
--- a/internal/test/issues/issue-1219/issue.gen.go
+++ b/internal/test/issues/issue-1219/issue.gen.go
@@ -1,6 +1,6 @@
 // Package issue1219 provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package issue1219
 
 import (
diff --git a/internal/test/issues/issue-1219/issue_test.go b/internal/test/issues/issue-1219/issue_test.go
index 0c5472d..4896759 100644
--- a/internal/test/issues/issue-1219/issue_test.go
+++ b/internal/test/issues/issue-1219/issue_test.go
@@ -4,7 +4,7 @@ import (
 	"reflect"
 	"testing"
 
-	issue1219 "github.com/deepmap/oapi-codegen/internal/test/issues/issue-1219"
+	issue1219 "github.com/deepmap/oapi-codegen/v2/internal/test/issues/issue-1219"
 	"github.com/stretchr/testify/assert"
 )
 
diff --git a/internal/test/issues/issue-312/doc.go b/internal/test/issues/issue-312/doc.go
index 8eb982d..475c1b4 100644
--- a/internal/test/issues/issue-312/doc.go
+++ b/internal/test/issues/issue-312/doc.go
@@ -1,3 +1,3 @@
 package issue312
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml spec.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml spec.yaml
diff --git a/internal/test/issues/issue-312/issue.gen.go b/internal/test/issues/issue-312/issue.gen.go
index 4320c8d..8f857d8 100644
--- a/internal/test/issues/issue-312/issue.gen.go
+++ b/internal/test/issues/issue-312/issue.gen.go
@@ -1,6 +1,6 @@
 // Package issue312 provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package issue312
 
 import (
diff --git a/internal/test/issues/issue-52/doc.go b/internal/test/issues/issue-52/doc.go
index f29e0e9..aa9f977 100644
--- a/internal/test/issues/issue-52/doc.go
+++ b/internal/test/issues/issue-52/doc.go
@@ -1,3 +1,3 @@
 package issue52
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml spec.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml spec.yaml
diff --git a/internal/test/issues/issue-52/issue.gen.go b/internal/test/issues/issue-52/issue.gen.go
index 031c507..4664ce6 100644
--- a/internal/test/issues/issue-52/issue.gen.go
+++ b/internal/test/issues/issue-52/issue.gen.go
@@ -1,6 +1,6 @@
 // Package issue52 provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package issue52
 
 import (
diff --git a/internal/test/issues/issue-52/issue_test.go b/internal/test/issues/issue-52/issue_test.go
index 0d90bf6..09cadd8 100644
--- a/internal/test/issues/issue-52/issue_test.go
+++ b/internal/test/issues/issue-52/issue_test.go
@@ -4,7 +4,7 @@ import (
 	_ "embed"
 	"testing"
 
-	"github.com/deepmap/oapi-codegen/pkg/codegen"
+	"github.com/deepmap/oapi-codegen/v2/pkg/codegen"
 	"github.com/getkin/kin-openapi/openapi3"
 	"github.com/stretchr/testify/require"
 )
diff --git a/internal/test/issues/issue-579/gen.go b/internal/test/issues/issue-579/gen.go
index d34774f..c77dc73 100644
--- a/internal/test/issues/issue-579/gen.go
+++ b/internal/test/issues/issue-579/gen.go
@@ -1,3 +1,3 @@
 package issue579
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --package=issue579 --generate=types,skip-prune --alias-types -o issue.gen.go spec.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --package=issue579 --generate=types,skip-prune --alias-types -o issue.gen.go spec.yaml
diff --git a/internal/test/issues/issue-579/issue.gen.go b/internal/test/issues/issue-579/issue.gen.go
index d46a029..3bb1dc8 100644
--- a/internal/test/issues/issue-579/issue.gen.go
+++ b/internal/test/issues/issue-579/issue.gen.go
@@ -1,6 +1,6 @@
 // Package issue579 provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package issue579
 
 import (
diff --git a/internal/test/issues/issue-832/generate.go b/internal/test/issues/issue-832/generate.go
index 877007a..5fdb5aa 100644
--- a/internal/test/issues/issue-832/generate.go
+++ b/internal/test/issues/issue-832/generate.go
@@ -1,3 +1,3 @@
 package issue_832
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml spec.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml spec.yaml
diff --git a/internal/test/issues/issue-832/issue.gen.go b/internal/test/issues/issue-832/issue.gen.go
index b950e3e..fc7a529 100644
--- a/internal/test/issues/issue-832/issue.gen.go
+++ b/internal/test/issues/issue-832/issue.gen.go
@@ -1,6 +1,6 @@
 // Package issue_832 provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package issue_832
 
 import (
diff --git a/internal/test/issues/issue-936/api.gen.go b/internal/test/issues/issue-936/api.gen.go
index 806140d..83f47f5 100644
--- a/internal/test/issues/issue-936/api.gen.go
+++ b/internal/test/issues/issue-936/api.gen.go
@@ -1,6 +1,6 @@
 // Package issue936 provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package issue936
 
 import (
diff --git a/internal/test/issues/issue-936/gen.go b/internal/test/issues/issue-936/gen.go
index e21b050..a84cbac 100644
--- a/internal/test/issues/issue-936/gen.go
+++ b/internal/test/issues/issue-936/gen.go
@@ -1,3 +1,3 @@
 package issue936
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=server.config.yaml spec.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=server.config.yaml spec.yaml
diff --git a/internal/test/issues/issue-grab_import_names/doc.go b/internal/test/issues/issue-grab_import_names/doc.go
index 5c73385..ebdbdfc 100644
--- a/internal/test/issues/issue-grab_import_names/doc.go
+++ b/internal/test/issues/issue-grab_import_names/doc.go
@@ -1,3 +1,3 @@
 package grabimportnames
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml spec.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml spec.yaml
diff --git a/internal/test/issues/issue-grab_import_names/issue.gen.go b/internal/test/issues/issue-grab_import_names/issue.gen.go
index b6ceeaa..02f6fb0 100644
--- a/internal/test/issues/issue-grab_import_names/issue.gen.go
+++ b/internal/test/issues/issue-grab_import_names/issue.gen.go
@@ -1,6 +1,6 @@
 // Package grabimportnames provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package grabimportnames
 
 import (
diff --git a/internal/test/issues/issue-grab_import_names/issue_test.go b/internal/test/issues/issue-grab_import_names/issue_test.go
index 8dffcd2..c954d65 100644
--- a/internal/test/issues/issue-grab_import_names/issue_test.go
+++ b/internal/test/issues/issue-grab_import_names/issue_test.go
@@ -3,7 +3,7 @@ package grabimportnames
 import (
 	"testing"
 
-	"github.com/deepmap/oapi-codegen/pkg/codegen"
+	"github.com/deepmap/oapi-codegen/v2/pkg/codegen"
 	"github.com/getkin/kin-openapi/openapi3"
 	"github.com/stretchr/testify/require"
 )
diff --git a/internal/test/issues/issue-head-digit-of-httpheader/doc.go b/internal/test/issues/issue-head-digit-of-httpheader/doc.go
index 0c4cfc1..69cb64a 100644
--- a/internal/test/issues/issue-head-digit-of-httpheader/doc.go
+++ b/internal/test/issues/issue-head-digit-of-httpheader/doc.go
@@ -1,3 +1,3 @@
 package headdigitofhttpheader
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml spec.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml spec.yaml
diff --git a/internal/test/issues/issue-head-digit-of-httpheader/issue.gen.go b/internal/test/issues/issue-head-digit-of-httpheader/issue.gen.go
index 5b070c6..14688ab 100644
--- a/internal/test/issues/issue-head-digit-of-httpheader/issue.gen.go
+++ b/internal/test/issues/issue-head-digit-of-httpheader/issue.gen.go
@@ -1,6 +1,6 @@
 // Package headdigitofhttpheader provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package headdigitofhttpheader
 
 type N200ResponseHeaders struct {
diff --git a/internal/test/issues/issue-head-digit-of-operation-id/doc.go b/internal/test/issues/issue-head-digit-of-operation-id/doc.go
index 6faae82..2399997 100644
--- a/internal/test/issues/issue-head-digit-of-operation-id/doc.go
+++ b/internal/test/issues/issue-head-digit-of-operation-id/doc.go
@@ -1,3 +1,3 @@
 package head_digit_of_operation_id
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml spec.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml spec.yaml
diff --git a/internal/test/issues/issue-head-digit-of-operation-id/issue.gen.go b/internal/test/issues/issue-head-digit-of-operation-id/issue.gen.go
index 7bc67aa..1d2b6b0 100644
--- a/internal/test/issues/issue-head-digit-of-operation-id/issue.gen.go
+++ b/internal/test/issues/issue-head-digit-of-operation-id/issue.gen.go
@@ -1,4 +1,4 @@
 // Package head_digit_of_operation_id provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package head_digit_of_operation_id
diff --git a/internal/test/issues/issue-illegal_enum_names/doc.go b/internal/test/issues/issue-illegal_enum_names/doc.go
index de0c23f..6249ddd 100644
--- a/internal/test/issues/issue-illegal_enum_names/doc.go
+++ b/internal/test/issues/issue-illegal_enum_names/doc.go
@@ -1,3 +1,3 @@
 package illegalenumnames
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml spec.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml spec.yaml
diff --git a/internal/test/issues/issue-illegal_enum_names/issue.gen.go b/internal/test/issues/issue-illegal_enum_names/issue.gen.go
index b34b1d7..395c171 100644
--- a/internal/test/issues/issue-illegal_enum_names/issue.gen.go
+++ b/internal/test/issues/issue-illegal_enum_names/issue.gen.go
@@ -1,6 +1,6 @@
 // Package illegalenumnames provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package illegalenumnames
 
 import (
diff --git a/internal/test/issues/issue-illegal_enum_names/issue_test.go b/internal/test/issues/issue-illegal_enum_names/issue_test.go
index 3df57c8..2fdfb86 100644
--- a/internal/test/issues/issue-illegal_enum_names/issue_test.go
+++ b/internal/test/issues/issue-illegal_enum_names/issue_test.go
@@ -6,7 +6,7 @@ import (
 	"go/token"
 	"testing"
 
-	"github.com/deepmap/oapi-codegen/pkg/codegen"
+	"github.com/deepmap/oapi-codegen/v2/pkg/codegen"
 	"github.com/getkin/kin-openapi/openapi3"
 	"github.com/stretchr/testify/require"
 )
diff --git a/internal/test/issues/issue-removed-external-ref/config.base.yaml b/internal/test/issues/issue-removed-external-ref/config.base.yaml
index 17d4d2f..2a0c84b 100644
--- a/internal/test/issues/issue-removed-external-ref/config.base.yaml
+++ b/internal/test/issues/issue-removed-external-ref/config.base.yaml
@@ -5,7 +5,7 @@ generate:
   strict-server: true
   models: true
 import-mapping:
-  spec-ext.yaml: "github.com/deepmap/oapi-codegen/internal/test/issues/issue-removed-external-ref/gen/spec_ext"
+  spec-ext.yaml: "github.com/deepmap/oapi-codegen/v2/internal/test/issues/issue-removed-external-ref/gen/spec_ext"
 output: gen/spec_base/issue.gen.go
 output-options:
   skip-prune: true
diff --git a/internal/test/issues/issue-removed-external-ref/doc.go b/internal/test/issues/issue-removed-external-ref/doc.go
index 7cb5ab0..9f222d4 100644
--- a/internal/test/issues/issue-removed-external-ref/doc.go
+++ b/internal/test/issues/issue-removed-external-ref/doc.go
@@ -1,4 +1,4 @@
 package head_digit_of_httpheader
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.ext.yaml spec-ext.yaml
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.base.yaml spec-base.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.ext.yaml spec-ext.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.base.yaml spec-base.yaml
diff --git a/internal/test/issues/issue-removed-external-ref/gen/spec_base/issue.gen.go b/internal/test/issues/issue-removed-external-ref/gen/spec_base/issue.gen.go
index 85d296d..1a32801 100644
--- a/internal/test/issues/issue-removed-external-ref/gen/spec_base/issue.gen.go
+++ b/internal/test/issues/issue-removed-external-ref/gen/spec_base/issue.gen.go
@@ -1,6 +1,6 @@
 // Package spec_base provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package spec_base
 
 import (
@@ -9,7 +9,7 @@ import (
 	"fmt"
 	"net/http"
 
-	externalRef0 "github.com/deepmap/oapi-codegen/internal/test/issues/issue-removed-external-ref/gen/spec_ext"
+	externalRef0 "github.com/deepmap/oapi-codegen/v2/internal/test/issues/issue-removed-external-ref/gen/spec_ext"
 	"github.com/go-chi/chi/v5"
 	strictnethttp "github.com/oapi-codegen/runtime/strictmiddleware/nethttp"
 )
diff --git a/internal/test/issues/issue-removed-external-ref/gen/spec_ext/issue.gen.go b/internal/test/issues/issue-removed-external-ref/gen/spec_ext/issue.gen.go
index d19736a..002c88d 100644
--- a/internal/test/issues/issue-removed-external-ref/gen/spec_ext/issue.gen.go
+++ b/internal/test/issues/issue-removed-external-ref/gen/spec_ext/issue.gen.go
@@ -1,6 +1,6 @@
 // Package spec_ext provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package spec_ext
 
 import (
diff --git a/internal/test/parameters/doc.go b/internal/test/parameters/doc.go
index 7868d53..25168f6 100644
--- a/internal/test/parameters/doc.go
+++ b/internal/test/parameters/doc.go
@@ -1,3 +1,3 @@
 package parameters
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml parameters.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml parameters.yaml
diff --git a/internal/test/parameters/parameters.gen.go b/internal/test/parameters/parameters.gen.go
index c0e6fee..964e376 100644
--- a/internal/test/parameters/parameters.gen.go
+++ b/internal/test/parameters/parameters.gen.go
@@ -1,6 +1,6 @@
 // Package parameters provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package parameters
 
 import (
diff --git a/internal/test/schemas/doc.go b/internal/test/schemas/doc.go
index b3a7d25..f743377 100644
--- a/internal/test/schemas/doc.go
+++ b/internal/test/schemas/doc.go
@@ -1,3 +1,3 @@
 package schemas
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml schemas.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml schemas.yaml
diff --git a/internal/test/schemas/schemas.gen.go b/internal/test/schemas/schemas.gen.go
index 883074d..91c4e61 100644
--- a/internal/test/schemas/schemas.gen.go
+++ b/internal/test/schemas/schemas.gen.go
@@ -1,6 +1,6 @@
 // Package schemas provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package schemas
 
 import (
diff --git a/internal/test/server/doc.go b/internal/test/server/doc.go
index ca7633a..a766b30 100644
--- a/internal/test/server/doc.go
+++ b/internal/test/server/doc.go
@@ -1,3 +1,3 @@
 package server
 
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=config.yaml ../test-schema.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml ../test-schema.yaml
diff --git a/internal/test/server/server.gen.go b/internal/test/server/server.gen.go
index 3b44fe7..f14cead 100644
--- a/internal/test/server/server.gen.go
+++ b/internal/test/server/server.gen.go
@@ -1,6 +1,6 @@
 // Package server provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package server
 
 import (
diff --git a/internal/test/strict-server/chi/server.gen.go b/internal/test/strict-server/chi/server.gen.go
index 90fa582..275717b 100644
--- a/internal/test/strict-server/chi/server.gen.go
+++ b/internal/test/strict-server/chi/server.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 import (
diff --git a/internal/test/strict-server/chi/server.go b/internal/test/strict-server/chi/server.go
index 669d4da..83eb503 100644
--- a/internal/test/strict-server/chi/server.go
+++ b/internal/test/strict-server/chi/server.go
@@ -1,5 +1,5 @@
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=server.cfg.yaml ../strict-schema.yaml
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=types.cfg.yaml ../strict-schema.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=server.cfg.yaml ../strict-schema.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=types.cfg.yaml ../strict-schema.yaml
 
 package api
 
diff --git a/internal/test/strict-server/chi/types.gen.go b/internal/test/strict-server/chi/types.gen.go
index 6a0de0c..56eec5c 100644
--- a/internal/test/strict-server/chi/types.gen.go
+++ b/internal/test/strict-server/chi/types.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 // Example defines model for example.
diff --git a/internal/test/strict-server/client/client.gen.go b/internal/test/strict-server/client/client.gen.go
index 6301015..dcf521d 100644
--- a/internal/test/strict-server/client/client.gen.go
+++ b/internal/test/strict-server/client/client.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 import (
diff --git a/internal/test/strict-server/client/client.go b/internal/test/strict-server/client/client.go
index 3b37a17..5121413 100644
--- a/internal/test/strict-server/client/client.go
+++ b/internal/test/strict-server/client/client.go
@@ -1,3 +1,3 @@
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=client.cfg.yaml ../strict-schema.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=client.cfg.yaml ../strict-schema.yaml
 
 package api
diff --git a/internal/test/strict-server/echo/server.gen.go b/internal/test/strict-server/echo/server.gen.go
index 3a03e11..eebb218 100644
--- a/internal/test/strict-server/echo/server.gen.go
+++ b/internal/test/strict-server/echo/server.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 import (
diff --git a/internal/test/strict-server/echo/server.go b/internal/test/strict-server/echo/server.go
index 669d4da..83eb503 100644
--- a/internal/test/strict-server/echo/server.go
+++ b/internal/test/strict-server/echo/server.go
@@ -1,5 +1,5 @@
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=server.cfg.yaml ../strict-schema.yaml
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=types.cfg.yaml ../strict-schema.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=server.cfg.yaml ../strict-schema.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=types.cfg.yaml ../strict-schema.yaml
 
 package api
 
diff --git a/internal/test/strict-server/echo/types.gen.go b/internal/test/strict-server/echo/types.gen.go
index 6a0de0c..56eec5c 100644
--- a/internal/test/strict-server/echo/types.gen.go
+++ b/internal/test/strict-server/echo/types.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 // Example defines model for example.
diff --git a/internal/test/strict-server/fiber/server.gen.go b/internal/test/strict-server/fiber/server.gen.go
index bf34ef0..76b2e1e 100644
--- a/internal/test/strict-server/fiber/server.gen.go
+++ b/internal/test/strict-server/fiber/server.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 import (
diff --git a/internal/test/strict-server/fiber/server.go b/internal/test/strict-server/fiber/server.go
index 669d4da..83eb503 100644
--- a/internal/test/strict-server/fiber/server.go
+++ b/internal/test/strict-server/fiber/server.go
@@ -1,5 +1,5 @@
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=server.cfg.yaml ../strict-schema.yaml
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=types.cfg.yaml ../strict-schema.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=server.cfg.yaml ../strict-schema.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=types.cfg.yaml ../strict-schema.yaml
 
 package api
 
diff --git a/internal/test/strict-server/fiber/types.gen.go b/internal/test/strict-server/fiber/types.gen.go
index 6a0de0c..56eec5c 100644
--- a/internal/test/strict-server/fiber/types.gen.go
+++ b/internal/test/strict-server/fiber/types.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 // Example defines model for example.
diff --git a/internal/test/strict-server/gin/server.gen.go b/internal/test/strict-server/gin/server.gen.go
index 9c54408..4504814 100644
--- a/internal/test/strict-server/gin/server.gen.go
+++ b/internal/test/strict-server/gin/server.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 import (
diff --git a/internal/test/strict-server/gin/server.go b/internal/test/strict-server/gin/server.go
index 669d4da..83eb503 100644
--- a/internal/test/strict-server/gin/server.go
+++ b/internal/test/strict-server/gin/server.go
@@ -1,5 +1,5 @@
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=server.cfg.yaml ../strict-schema.yaml
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=types.cfg.yaml ../strict-schema.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=server.cfg.yaml ../strict-schema.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=types.cfg.yaml ../strict-schema.yaml
 
 package api
 
diff --git a/internal/test/strict-server/gin/types.gen.go b/internal/test/strict-server/gin/types.gen.go
index 6a0de0c..56eec5c 100644
--- a/internal/test/strict-server/gin/types.gen.go
+++ b/internal/test/strict-server/gin/types.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 // Example defines model for example.
diff --git a/internal/test/strict-server/gorilla/server.gen.go b/internal/test/strict-server/gorilla/server.gen.go
index 234089f..d8d3246 100644
--- a/internal/test/strict-server/gorilla/server.gen.go
+++ b/internal/test/strict-server/gorilla/server.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 import (
diff --git a/internal/test/strict-server/gorilla/server.go b/internal/test/strict-server/gorilla/server.go
index 669d4da..83eb503 100644
--- a/internal/test/strict-server/gorilla/server.go
+++ b/internal/test/strict-server/gorilla/server.go
@@ -1,5 +1,5 @@
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=server.cfg.yaml ../strict-schema.yaml
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=types.cfg.yaml ../strict-schema.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=server.cfg.yaml ../strict-schema.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=types.cfg.yaml ../strict-schema.yaml
 
 package api
 
diff --git a/internal/test/strict-server/gorilla/types.gen.go b/internal/test/strict-server/gorilla/types.gen.go
index 6a0de0c..56eec5c 100644
--- a/internal/test/strict-server/gorilla/types.gen.go
+++ b/internal/test/strict-server/gorilla/types.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 // Example defines model for example.
diff --git a/internal/test/strict-server/iris/server.gen.go b/internal/test/strict-server/iris/server.gen.go
index fd67694..8494e42 100644
--- a/internal/test/strict-server/iris/server.gen.go
+++ b/internal/test/strict-server/iris/server.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 import (
diff --git a/internal/test/strict-server/iris/server.go b/internal/test/strict-server/iris/server.go
index c59b796..ea94095 100644
--- a/internal/test/strict-server/iris/server.go
+++ b/internal/test/strict-server/iris/server.go
@@ -1,5 +1,5 @@
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=server.cfg.yaml ../strict-schema.yaml
-//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen --config=types.cfg.yaml ../strict-schema.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=server.cfg.yaml ../strict-schema.yaml
+//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=types.cfg.yaml ../strict-schema.yaml
 
 package api
 
diff --git a/internal/test/strict-server/iris/types.gen.go b/internal/test/strict-server/iris/types.gen.go
index 6a0de0c..56eec5c 100644
--- a/internal/test/strict-server/iris/types.gen.go
+++ b/internal/test/strict-server/iris/types.gen.go
@@ -1,6 +1,6 @@
 // Package api provides primitives to interact with the openapi HTTP API.
 //
-// Code generated by github.com/deepmap/oapi-codegen version v0.0.0-00010101000000-000000000000 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT.
 package api
 
 // Example defines model for example.
diff --git a/internal/test/strict-server/strict_test.go b/internal/test/strict-server/strict_test.go
index a719896..32d2d89 100644
--- a/internal/test/strict-server/strict_test.go
+++ b/internal/test/strict-server/strict_test.go
@@ -19,12 +19,12 @@ import (
 	"github.com/labstack/echo/v4"
 	"github.com/stretchr/testify/assert"
 
-	chiAPI "github.com/deepmap/oapi-codegen/internal/test/strict-server/chi"
-	clientAPI "github.com/deepmap/oapi-codegen/internal/test/strict-server/client"
-	echoAPI "github.com/deepmap/oapi-codegen/internal/test/strict-server/echo"
-	fiberAPI "github.com/deepmap/oapi-codegen/internal/test/strict-server/fiber"
-	ginAPI "github.com/deepmap/oapi-codegen/internal/test/strict-server/gin"
-	irisAPI "github.com/deepmap/oapi-codegen/internal/test/strict-server/iris"
+	chiAPI "github.com/deepmap/oapi-codegen/v2/internal/test/strict-server/chi"
+	clientAPI "github.com/deepmap/oapi-codegen/v2/internal/test/strict-server/client"
+	echoAPI "github.com/deepmap/oapi-codegen/v2/internal/test/strict-server/echo"
+	fiberAPI "github.com/deepmap/oapi-codegen/v2/internal/test/strict-server/fiber"
+	ginAPI "github.com/deepmap/oapi-codegen/v2/internal/test/strict-server/gin"
+	irisAPI "github.com/deepmap/oapi-codegen/v2/internal/test/strict-server/iris"
 
 	"github.com/oapi-codegen/runtime"
 	"github.com/oapi-codegen/testutil"
diff --git a/pkg/codegen/codegen_test.go b/pkg/codegen/codegen_test.go
index 0cc7c66..b44bf42 100644
--- a/pkg/codegen/codegen_test.go
+++ b/pkg/codegen/codegen_test.go
@@ -10,13 +10,13 @@ import (
 	"github.com/stretchr/testify/require"
 	"golang.org/x/lint"
 
-	"github.com/deepmap/oapi-codegen/pkg/util"
+	"github.com/deepmap/oapi-codegen/v2/pkg/util"
 )
 
 const (
 	remoteRefFile = `https://raw.githubusercontent.com/deepmap/oapi-codegen/master/examples/petstore-expanded` +
 		`/petstore-expanded.yaml`
-	remoteRefImport = `github.com/deepmap/oapi-codegen/examples/petstore-expanded`
+	remoteRefImport = `github.com/deepmap/oapi-codegen/v2/examples/petstore-expanded`
 )
 
 func checkLint(t *testing.T, filename string, code []byte) {
@@ -213,7 +213,7 @@ func TestRemoteExternalReference(t *testing.T) {
 	assert.Contains(t, code, "package api")
 
 	// Check import
-	assert.Contains(t, code, `externalRef0 "github.com/deepmap/oapi-codegen/examples/petstore-expanded"`)
+	assert.Contains(t, code, `externalRef0 "github.com/deepmap/oapi-codegen/v2/examples/petstore-expanded"`)
 
 	// Check generated oneOf structure:
 	assert.Contains(t, code, `