Repository: swaggest/rest
Pull request #28 (2021-03-01 10:01:18)

Upgrade to chi-v5

github-actions[bot]: ### Unit Test Coverage
total:	(statements)	81.2%
<details><summary>Coverage diff with base branch</summary>

```diff
92c92
< github.com/swaggest/rest/request/decoder.go	formDataToURLValues	66.7%
---
> github.com/swaggest/rest/request/decoder.go	formDataToURLValues	77.8%
```
</details>
<!-- Sticky Pull Request Commentunit-test -->
codecov[bot]: # [Codecov](https://codecov.io/gh/swaggest/rest/pull/28?src=pr&el=h1) Report
> Merging [#28](https://codecov.io/gh/swaggest/rest/pull/28?src=pr&el=desc) (a3205cb) into [master](https://codecov.io/gh/swaggest/rest/commit/6f71d148d557a88342ec22b72d1219738b807840?el=desc) (6f71d14) will **decrease** coverage by `0.01%`.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/swaggest/rest/pull/28/graphs/tree.svg?width=650&height=150&src=pr&token=OpLHxxPdmn)](https://codecov.io/gh/swaggest/rest/pull/28?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master      #28      +/-   ##
==========================================
- Coverage   73.47%   73.45%   -0.02%     
==========================================
  Files          26       26              
  Lines        1508     1507       -1     
==========================================
- Hits         1108     1107       -1     
  Misses        253      253              
  Partials      147      147              
```

| Flag | Coverage Δ | |
|---|---|---|
| unittests | `73.45% <100.00%> (-0.02%)` | :arrow_down: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Impacted Files](https://codecov.io/gh/swaggest/rest/pull/28?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [chirouter/path\_decoder.go](https://codecov.io/gh/swaggest/rest/pull/28/diff?src=pr&el=tree#diff-Y2hpcm91dGVyL3BhdGhfZGVjb2Rlci5nbw==) | `62.50% <ø> (ø)` | |
| [chirouter/wrapper.go](https://codecov.io/gh/swaggest/rest/pull/28/diff?src=pr&el=tree#diff-Y2hpcm91dGVyL3dyYXBwZXIuZ28=) | `100.00% <ø> (ø)` | |
| [response/gzip/middleware.go](https://codecov.io/gh/swaggest/rest/pull/28/diff?src=pr&el=tree#diff-cmVzcG9uc2UvZ3ppcC9taWRkbGV3YXJlLmdv) | `78.40% <100.00%> (-0.25%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/swaggest/rest/pull/28?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/swaggest/rest/pull/28?src=pr&el=footer). Last update [6f71d14...9336a91](https://codecov.io/gh/swaggest/rest/pull/28?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

github-actions[bot]: ### Examples Benchmark Result
<details><summary>Benchmark diff with base branch</summary>

```
name                    old time/op    new time/op    delta
pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64
_directGzip-2             26.4µs ± 1%    26.2µs ± 0%     ~     (p=0.222 n=5+5)
_directGzipHead-2         26.3µs ± 2%    26.3µs ± 1%     ~     (p=1.000 n=5+5)
_noDirectGzip-2            150µs ± 1%     150µs ± 1%     ~     (p=0.548 n=5+5)
_directGzip_decode-2       594µs ± 4%     558µs ± 2%   -6.08%  (p=0.008 n=5+5)
_noDirectGzip_decode-2     154µs ± 2%     149µs ± 1%   -3.07%  (p=0.008 n=5+5)
_jsonBody-2               48.6µs ± 2%    48.7µs ± 2%     ~     (p=0.690 n=5+5)
_jsonBodyValidation-2     58.5µs ± 1%    60.9µs ± 1%   +4.13%  (p=0.008 n=5+5)
_outputHeaders-2          25.9µs ± 2%    25.5µs ± 2%     ~     (p=0.151 n=5+5)
_validation-2             52.0µs ± 1%    54.8µs ± 2%   +5.31%  (p=0.008 n=5+5)
pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64
_notFoundSrv-2            30.5µs ± 3%    29.8µs ± 2%     ~     (p=0.151 n=5+5)
_ok-2                     31.8µs ± 2%    31.4µs ± 1%     ~     (p=0.095 n=5+5)
_invalidBody-2            46.5µs ± 2%    46.0µs ± 2%     ~     (p=0.222 n=5+5)

name                    old B:rcvd/op  new B:rcvd/op  delta
pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64
_directGzip-2                639 ± 0%       639 ± 0%     ~     (all equal)
_directGzipHead-2            183 ± 0%       183 ± 0%     ~     (all equal)
_noDirectGzip-2            1.04k ± 0%     1.04k ± 0%     ~     (all equal)
_directGzip_decode-2         639 ± 0%       639 ± 0%     ~     (all equal)
_noDirectGzip_decode-2     1.04k ± 0%     1.04k ± 0%     ~     (all equal)
_jsonBody-2                  208 ± 0%       208 ± 0%     ~     (all equal)
_jsonBodyValidation-2        194 ± 0%       194 ± 0%     ~     (all equal)
_outputHeaders-2             155 ± 0%       155 ± 0%     ~     (all equal)
_validation-2                177 ± 0%       177 ± 0%     ~     (all equal)
pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64
_notFoundSrv-2               337 ± 0%       337 ± 0%     ~     (all equal)
_ok-2                        359 ± 0%       359 ± 0%     ~     (all equal)
_invalidBody-2               435 ± 0%       435 ± 0%     ~     (all equal)

name                    old B:sent/op  new B:sent/op  delta
pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64
_directGzip-2                103 ± 0%       103 ± 0%     ~     (all equal)
_directGzipHead-2            104 ± 0%       104 ± 0%     ~     (all equal)
_noDirectGzip-2              117 ± 0%       117 ± 0%     ~     (all equal)
_directGzip_decode-2         116 ± 0%       116 ± 0%     ~     (all equal)
_noDirectGzip_decode-2       130 ± 0%       130 ± 0%     ~     (all equal)
_jsonBody-2                  188 ± 0%       188 ± 0%     ~     (all equal)
_jsonBodyValidation-2        192 ± 0%       192 ± 0%     ~     (all equal)
_outputHeaders-2            77.0 ± 0%      77.0 ± 0%     ~     (all equal)
_validation-2                170 ± 0%       170 ± 0%     ~     (all equal)
pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64
_notFoundSrv-2              74.0 ± 0%      74.0 ± 0%     ~     (all equal)
_ok-2                       74.0 ± 0%      74.0 ± 0%     ~     (all equal)
_invalidBody-2               137 ± 0%       137 ± 0%     ~     (all equal)

name                    old rps        new rps        delta
pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64
_directGzip-2              37.9k ± 1%     38.2k ± 0%     ~     (p=0.222 n=5+5)
_directGzipHead-2          38.1k ± 2%     38.1k ± 1%     ~     (p=0.841 n=5+5)
_noDirectGzip-2            6.67k ± 1%     6.69k ± 1%     ~     (p=0.500 n=5+5)
_directGzip_decode-2       1.69k ± 4%     1.79k ± 2%   +6.41%  (p=0.008 n=5+5)
_noDirectGzip_decode-2     6.50k ± 2%     6.70k ± 1%   +3.17%  (p=0.008 n=5+5)
_jsonBody-2                20.6k ± 2%     20.5k ± 2%     ~     (p=0.690 n=5+5)
_jsonBodyValidation-2      17.1k ± 1%     16.4k ± 1%   -3.97%  (p=0.008 n=5+5)
_outputHeaders-2           38.7k ± 2%     39.2k ± 2%     ~     (p=0.151 n=5+5)
_validation-2              19.2k ± 1%     18.2k ± 2%   -5.03%  (p=0.008 n=5+5)
pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64
_notFoundSrv-2             32.8k ± 3%     33.5k ± 2%     ~     (p=0.151 n=5+5)
_ok-2                      31.5k ± 2%     31.9k ± 1%     ~     (p=0.095 n=5+5)
_invalidBody-2             21.5k ± 2%     21.7k ± 2%     ~     (p=0.222 n=5+5)

name                    old alloc/op   new alloc/op   delta
pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64
_directGzip-2             3.86kB ± 0%    3.86kB ± 0%     ~     (p=0.421 n=5+5)
_directGzipHead-2         3.86kB ± 0%    3.86kB ± 0%     ~     (p=0.698 n=4+5)
_noDirectGzip-2           6.10kB ±18%    6.29kB ±16%     ~     (p=0.841 n=5+5)
_directGzip_decode-2       402kB ± 0%     402kB ± 0%     ~     (p=0.841 n=5+5)
_noDirectGzip_decode-2    5.34kB ± 6%    5.10kB ± 5%     ~     (p=0.095 n=5+5)
_jsonBody-2               11.7kB ± 0%    11.7kB ± 0%   -0.28%  (p=0.008 n=5+5)
_jsonBodyValidation-2     18.2kB ± 0%    19.0kB ± 0%   +4.60%  (p=0.008 n=5+5)
_outputHeaders-2          3.64kB ± 0%    3.64kB ± 0%     ~     (p=0.841 n=5+5)
_validation-2             16.2kB ± 0%    16.6kB ± 0%   +2.56%  (p=0.008 n=5+5)
pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64
_notFoundSrv-2            4.81kB ± 0%    4.81kB ± 0%     ~     (p=1.000 n=5+5)
_ok-2                     4.72kB ± 0%    4.72kB ± 0%     ~     (p=0.629 n=4+4)
_invalidBody-2            8.58kB ± 0%    8.58kB ± 0%     ~     (p=0.971 n=4+4)

name                    old allocs/op  new allocs/op  delta
pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64
_directGzip-2               40.0 ± 0%      40.0 ± 0%     ~     (all equal)
_directGzipHead-2           40.0 ± 0%      40.0 ± 0%     ~     (all equal)
_noDirectGzip-2             47.8 ± 4%      47.8 ± 4%     ~     (p=1.000 n=5+5)
_directGzip_decode-2         497 ± 0%       497 ± 0%     ~     (p=0.444 n=5+5)
_noDirectGzip_decode-2      48.0 ± 0%      48.0 ± 0%     ~     (all equal)
_jsonBody-2                  103 ± 0%       103 ± 0%     ~     (all equal)
_jsonBodyValidation-2        144 ± 0%       180 ± 0%  +25.00%  (p=0.008 n=5+5)
_outputHeaders-2            35.0 ± 0%      35.0 ± 0%     ~     (all equal)
_validation-2                131 ± 0%       149 ± 0%  +13.74%  (p=0.008 n=5+5)
pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64
_notFoundSrv-2              52.0 ± 0%      52.0 ± 0%     ~     (all equal)
_ok-2                       48.0 ± 0%      48.0 ± 0%     ~     (all equal)
_invalidBody-2              98.0 ± 0%      98.0 ± 0%     ~     (all equal)
```
</details>
<!-- Sticky Pull Request Commentbench-examples -->

Patch:
diff --git a/README.md b/README.md
index 10ad589..87fc916 100644
--- a/README.md
+++ b/README.md
@@ -266,8 +266,8 @@ import (
 	"net/http"
 	"time"
 
-	"github.com/go-chi/chi"
-	"github.com/go-chi/chi/middleware"
+	"github.com/go-chi/chi/v5"
+	"github.com/go-chi/chi/v5/middleware"
 	"github.com/swaggest/rest"
 	"github.com/swaggest/rest/chirouter"
 	"github.com/swaggest/rest/jsonschema"
@@ -372,4 +372,6 @@ func main() {
 This project adheres to [Semantic Versioning](https://semver.org/#semantic-versioning-200).
 
 Before version `1.0.0`, breaking changes are tagged with `MINOR` bump, features and fixes are tagged with `PATCH` bump.
-After version `1.0.0`, breaking changes are tagged with `MAJOR` bump.
\ No newline at end of file
+After version `1.0.0`, breaking changes are tagged with `MAJOR` bump.
+
+Breaking changes are described in [UPGRADE.md](./UPGRADE.md).
\ No newline at end of file
diff --git a/UPGRADE.md b/UPGRADE.md
new file mode 100644
index 0000000..25cac1e
--- /dev/null
+++ b/UPGRADE.md
@@ -0,0 +1,6 @@
+# Breaking Changes Guide
+
+## v0.2.0
+
+* Router dependency `github.com/go-chi/chi` upgraded to the latest module, please change relevant imports
+  to `github.com/go-chi/chi/v5`.
\ No newline at end of file
diff --git a/_examples/advanced/router.go b/_examples/advanced/router.go
index 25b8092..e3bc4ae 100644
--- a/_examples/advanced/router.go
+++ b/_examples/advanced/router.go
@@ -3,8 +3,8 @@ package main
 import (
 	"net/http"
 
-	"github.com/go-chi/chi"
-	"github.com/go-chi/chi/middleware"
+	"github.com/go-chi/chi/v5"
+	"github.com/go-chi/chi/v5/middleware"
 	"github.com/swaggest/openapi-go/openapi3"
 	"github.com/swaggest/rest"
 	"github.com/swaggest/rest/chirouter"
diff --git a/_examples/basic/main.go b/_examples/basic/main.go
index 3786c6e..5700bc4 100644
--- a/_examples/basic/main.go
+++ b/_examples/basic/main.go
@@ -8,8 +8,8 @@ import (
 	"net/http"
 	"time"
 
-	"github.com/go-chi/chi"
-	"github.com/go-chi/chi/middleware"
+	"github.com/go-chi/chi/v5"
+	"github.com/go-chi/chi/v5/middleware"
 	"github.com/swaggest/rest"
 	"github.com/swaggest/rest/chirouter"
 	"github.com/swaggest/rest/jsonschema"
diff --git a/_examples/go.mod b/_examples/go.mod
index c13bbf0..619ea23 100644
--- a/_examples/go.mod
+++ b/_examples/go.mod
@@ -7,15 +7,15 @@ replace github.com/swaggest/rest => ../
 require (
 	github.com/bool64/dev v0.1.24
 	github.com/bool64/httptestbench v0.1.1
-	github.com/go-chi/chi v1.5.2
+	github.com/go-chi/chi/v5 v5.0.1
 	github.com/kelseyhightower/envconfig v1.4.0
+	github.com/klauspost/compress v1.11.12 // indirect
 	github.com/stretchr/testify v1.7.0
 	github.com/swaggest/assertjson v1.6.3
 	github.com/swaggest/jsonschema-go v0.3.18
 	github.com/swaggest/openapi-go v0.2.9
 	github.com/swaggest/rest v0.1.17
-	github.com/swaggest/swgui v1.2.0
+	github.com/swaggest/swgui v1.2.1
 	github.com/swaggest/usecase v0.1.3
-	github.com/valyala/fasthttp v1.17.0
-	golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d // indirect
+	github.com/valyala/fasthttp v1.22.0
 )
diff --git a/_examples/go.sum b/_examples/go.sum
index 07b9dea..aad68a6 100644
--- a/_examples/go.sum
+++ b/_examples/go.sum
@@ -32,8 +32,8 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7
 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
 github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
 github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
-github.com/go-chi/chi v1.5.2 h1:YcLIBANL4OTaAOcTdp//sskGa0yGACQMCtbnr7YEn0Q=
-github.com/go-chi/chi v1.5.2/go.mod h1:REp24E+25iKvxgeTfHmdUoL5x15kBiDBlnIl5bCwe2k=
+github.com/go-chi/chi/v5 v5.0.1 h1:ALxjCrTf1aflOlkhMnCUP86MubbWFrzB3gkRPReLpTo=
+github.com/go-chi/chi/v5 v5.0.1/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
 github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
 github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
@@ -67,6 +67,10 @@ github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa
 github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
 github.com/klauspost/compress v1.11.3 h1:dB4Bn0tN3wdCzQxnS8r06kV74qN/TAfaIS0bVE8h3jc=
 github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
+github.com/klauspost/compress v1.11.8 h1:difgzQsp5mdAz9v8lm3P/I+EpDKMU/6uTMw1y1FObuo=
+github.com/klauspost/compress v1.11.8/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
+github.com/klauspost/compress v1.11.12 h1:famVnQVu7QwryBN4jNseQdUKES71ZAOnB6UQQJPZvqk=
+github.com/klauspost/compress v1.11.12/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
 github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
 github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
 github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
@@ -145,14 +149,16 @@ github.com/swaggest/swgen v0.6.20/go.mod h1:ipkZNfwztgRfbOWUllLZawfmxXprT8flqNJO
 github.com/swaggest/swgen v0.6.23/go.mod h1:gj2yCLONy3kosKjwRtQeT5O9qqlhUvXAiDnbVwBUNFM=
 github.com/swaggest/swgen v0.6.27 h1:bO3CtX4NvuetPuABMChEEp2N/bjsJraegaJpYZ72aoI=
 github.com/swaggest/swgen v0.6.27/go.mod h1:tQLsoQVLcvtAMzNbm26JbWXDHZM4BBRuI5nemk3gEDw=
-github.com/swaggest/swgui v1.2.0 h1:zZWybwcfeWUNgOJOa+/FkLtYi7xI7pvGXnJrPcwh8vY=
-github.com/swaggest/swgui v1.2.0/go.mod h1:gn/xO+5S+BDFhtZP05gPiB/P6cXurNPv6kAeDJYgT98=
+github.com/swaggest/swgui v1.2.1 h1:iXNmGf07MaPfbVFxEsh7ez8eNPtREan4vHxU8AQnwKg=
+github.com/swaggest/swgui v1.2.1/go.mod h1:hJoCC9hcPB55IPKWtTi5//gV+xn4AVyLoEHkm8mhcP4=
 github.com/swaggest/usecase v0.1.3 h1:rK/t7PR3pt6pDEVQuT9n/aXHbMtKNzulqniQ/GSOiCc=
 github.com/swaggest/usecase v0.1.3/go.mod h1:d94PwelVQeMv4RH0VsRMFqRNrk6ferEqg2AetDcjPWo=
 github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
 github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
 github.com/valyala/fasthttp v1.17.0 h1:P8/koH4aSnJ4xbd0cUUFEGQs3jQqIxoDDyRQrUiAkqg=
 github.com/valyala/fasthttp v1.17.0/go.mod h1:jjraHZVbKOXftJfsOYoAjaeygpj5hr8ermTRJNroD7A=
+github.com/valyala/fasthttp v1.22.0 h1:OpwH5KDOJ9cS2bq8fD+KfT4IrksK0llvkHf4MZx42jQ=
+github.com/valyala/fasthttp v1.22.0/go.mod h1:0mw2RjXGOzxf4NL2jni3gUQ7LfjjUSiG5sskOUUSEpU=
 github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio=
 github.com/vearutop/json5 v0.1.2 h1:AD+VTRiN8TZb4/ObzXXyYIY66AVNqdBn0O8ks/WqgH0=
 github.com/vearutop/json5 v0.1.2/go.mod h1:0EGfZGmwGu042tElaCn8+Song+vEMQOOgChj+mzD7OQ=
@@ -165,6 +171,7 @@ github.com/yudai/pp v2.0.1+incompatible h1:Q4//iY4pNF6yPLZIigmvcl7k/bPgrcTPIFIcm
 github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc=
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
 golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
 golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
@@ -184,8 +191,8 @@ golang.org/x/net v0.0.0-20201016165138-7b1cca2348c0/go.mod h1:sp8m0HH+o8qH0wwXwY
 golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
 golang.org/x/net v0.0.0-20201216054612-986b41b23924/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
 golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
-golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d h1:1aflnvSoWWLI2k/dMUAl5lvU1YO4Mb4hz0gh+1rjcxU=
-golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
+golang.org/x/net v0.0.0-20210226101413-39120d07d75e h1:jIQURUJ9mlLvYwTBtRHm9h58rYhSonLvRvgAnP8Nr7I=
+golang.org/x/net v0.0.0-20210226101413-39120d07d75e/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -198,6 +205,7 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
 golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -209,6 +217,9 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w
 golang.org/x/sys v0.0.0-20201218084310-7d0127a74742/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20210110051926-789bb1bd4061 h1:DQmQoKxQWtyybCtX/3dIuDBcAhFszqq8YiNeS6sNu1c=
 golang.org/x/sys v0.0.0-20210110051926-789bb1bd4061/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073 h1:8qxJSnu+7dRq6upnbntrmriWByIakBuct5OM/MdQC1M=
+golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
diff --git a/_examples/task-api/internal/infra/nethttp/router.go b/_examples/task-api/internal/infra/nethttp/router.go
index a6cc32d..59db387 100644
--- a/_examples/task-api/internal/infra/nethttp/router.go
+++ b/_examples/task-api/internal/infra/nethttp/router.go
@@ -4,8 +4,8 @@ import (
 	"net/http"
 	"time"
 
-	"github.com/go-chi/chi"
-	"github.com/go-chi/chi/middleware"
+	"github.com/go-chi/chi/v5"
+	"github.com/go-chi/chi/v5/middleware"
 	"github.com/swaggest/openapi-go/openapi3"
 	"github.com/swaggest/rest"
 	"github.com/swaggest/rest/_examples/task-api/internal/infra/log"
diff --git a/chirouter/path_decoder.go b/chirouter/path_decoder.go
index f80d1da..a7bb387 100644
--- a/chirouter/path_decoder.go
+++ b/chirouter/path_decoder.go
@@ -4,7 +4,7 @@ import (
 	"net/http"
 	"net/url"
 
-	"github.com/go-chi/chi"
+	"github.com/go-chi/chi/v5"
 )
 
 // PathToURLValues is a decoder function for parameters in path.
diff --git a/chirouter/wrapper.go b/chirouter/wrapper.go
index bb73eb9..75044e1 100644
--- a/chirouter/wrapper.go
+++ b/chirouter/wrapper.go
@@ -4,7 +4,7 @@ import (
 	"net/http"
 	"strings"
 
-	"github.com/go-chi/chi"
+	"github.com/go-chi/chi/v5"
 	"github.com/swaggest/rest/nethttp"
 )
 
diff --git a/go.mod b/go.mod
index 5971371..5844fb6 100644
--- a/go.mod
+++ b/go.mod
@@ -6,7 +6,7 @@ require (
 	github.com/bool64/dev v0.1.24
 	github.com/bool64/shared v0.1.2
 	github.com/cespare/xxhash/v2 v2.1.1
-	github.com/go-chi/chi v1.5.2
+	github.com/go-chi/chi/v5 v5.0.1
 	github.com/iancoleman/orderedmap v0.2.0 // indirect
 	github.com/santhosh-tekuri/jsonschema/v2 v2.2.0
 	github.com/stretchr/testify v1.7.0
diff --git a/go.sum b/go.sum
index 3b1edca..205ec19 100644
--- a/go.sum
+++ b/go.sum
@@ -26,8 +26,8 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7
 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
 github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
 github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
-github.com/go-chi/chi v1.5.2 h1:YcLIBANL4OTaAOcTdp//sskGa0yGACQMCtbnr7YEn0Q=
-github.com/go-chi/chi v1.5.2/go.mod h1:REp24E+25iKvxgeTfHmdUoL5x15kBiDBlnIl5bCwe2k=
+github.com/go-chi/chi/v5 v5.0.1 h1:ALxjCrTf1aflOlkhMnCUP86MubbWFrzB3gkRPReLpTo=
+github.com/go-chi/chi/v5 v5.0.1/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
 github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
 github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=


Test patch:
diff --git a/chirouter/wrapper_test.go b/chirouter/wrapper_test.go
index fa9b0c2..c2867fb 100644
--- a/chirouter/wrapper_test.go
+++ b/chirouter/wrapper_test.go
@@ -6,7 +6,7 @@ import (
 	"net/url"
 	"testing"
 
-	"github.com/go-chi/chi"
+	"github.com/go-chi/chi/v5"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 	"github.com/swaggest/rest/chirouter"
diff --git a/nethttp/example_test.go b/nethttp/example_test.go
index f522508..18e0328 100644
--- a/nethttp/example_test.go
+++ b/nethttp/example_test.go
@@ -4,7 +4,7 @@ import (
 	"context"
 	"net/http"
 
-	"github.com/go-chi/chi"
+	"github.com/go-chi/chi/v5"
 	"github.com/swaggest/openapi-go/openapi3"
 	"github.com/swaggest/rest/chirouter"
 	"github.com/swaggest/rest/nethttp"
diff --git a/request/file_test.go b/request/file_test.go
index a900674..68263ff 100644
--- a/request/file_test.go
+++ b/request/file_test.go
@@ -9,7 +9,7 @@ import (
 	"net/http/httptest"
 	"testing"
 
-	"github.com/go-chi/chi"
+	"github.com/go-chi/chi/v5"
 	"github.com/stretchr/testify/assert"
 	"github.com/swaggest/rest"
 	"github.com/swaggest/rest/chirouter"