swaggest / rest

Web services with OpenAPI and JSON Schema done quick in Go
https://pkg.go.dev/github.com/swaggest/rest
MIT License
335 stars 17 forks source link

Fix handling of optional uploads #160

Closed vearutop closed 1 year ago

vearutop commented 1 year ago

Fixes a bug mentioned in https://github.com/swaggest/rest/discussions/159.

github-actions[bot] commented 1 year ago

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 106 7686 (+8) 5590 (+4) 504 1592 (+4) 948 186.4K (+46B)
Go (test) 48 5495 (+27) 4236 (+43) 187 1072 (-16) 180 (-2) 152.8K (+734B)
github-actions[bot] commented 1 year ago

Go API Changes

# summary
Inferred base version: v0.2.48
Suggested version: v0.2.49
github-actions[bot] commented 1 year ago

Unit Test Coverage

total: (statements) 83.6% changed lines: (statements) 80.0%, coverage is less than 90.0%, consider testing the changes more thoroughly

Coverage of changed lines | File | Function | Coverage | |-------------------------|---------------|----------| | Total | | 80.0% | | request/file.go | | 100.0% | | request/file.go:60 | setFile | 100.0% | | response/encoder.go | | 75.0% | | response/encoder.go:197 | successStatus | 100.0% |
Coverage diff with base branch | File | Function | Base Coverage | Current Coverage | |------------------------------------------|----------|---------------|------------------| | Total | | 83.5% | 83.6% (+0.1%) | | github.com/swaggest/rest/request/file.go | setFile | 78.6% | 86.2% (+7.6%) |
codecov[bot] commented 1 year ago

Codecov Report

Merging #160 (32d13ec) into master (dee7f9f) will increase coverage by 0.18%. The diff coverage is 66.66%.

@@            Coverage Diff             @@
##           master     #160      +/-   ##
==========================================
+ Coverage   77.79%   77.98%   +0.18%     
==========================================
  Files          28       28              
  Lines        1608     1608              
==========================================
+ Hits         1251     1254       +3     
+ Misses        235      233       -2     
+ Partials      122      121       -1     
Flag Coverage Δ
unittests 77.98% <66.66%> (+0.18%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
response/encoder.go 68.06% <50.00%> (+0.28%) :arrow_up:
request/file.go 70.45% <100.00%> (+5.33%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

github-actions[bot] commented 1 year ago

Benchmark Result

Benchmark diff with base branch ``` name old time/op new time/op delta pkg:github.com/swaggest/rest/jsonschema goos:linux goarch:amd64 RequestValidator_ValidateRequestData-2 1.66µs ± 8% 1.64µs ± 5% ~ (p=0.699 n=6+6) pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 832ns ± 1% 841ns ± 5% ~ (p=0.537 n=5+6) DecoderFunc_Decode-2 2.38µs ± 1% 2.38µs ± 0% ~ (p=0.802 n=5+5) Decoder_Decode_json-2 26.5µs ± 1% 26.0µs ± 1% -1.70% (p=0.002 n=6+6) Decoder_Decode_queryObject-2 5.87µs ± 1% 5.82µs ± 2% ~ (p=0.394 n=6+6) Decoder_Decode_jsonParam-2 2.12µs ± 1% 2.18µs ± 2% +3.00% (p=0.004 n=6+6) DecoderFactory_SetDecoderFunc-2 2.01µs ± 1% 1.99µs ± 2% ~ (p=0.288 n=6+6) pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 13.5µs ± 2% 13.4µs ± 3% ~ (p=0.394 n=6+6) Middleware_control-2 4.32µs ± 7% 4.34µs ± 3% ~ (p=0.937 n=6+6) name old alloc/op new alloc/op delta pkg:github.com/swaggest/rest/jsonschema goos:linux goarch:amd64 RequestValidator_ValidateRequestData-2 2.46kB ± 0% 2.46kB ± 0% ~ (all equal) pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 440B ± 0% 440B ± 0% ~ (all equal) DecoderFunc_Decode-2 1.51kB ± 0% 1.51kB ± 0% ~ (all equal) Decoder_Decode_json-2 12.2kB ± 0% 12.2kB ± 0% ~ (all equal) Decoder_Decode_queryObject-2 2.00kB ± 0% 2.00kB ± 0% ~ (all equal) Decoder_Decode_jsonParam-2 736B ± 0% 736B ± 0% ~ (all equal) DecoderFactory_SetDecoderFunc-2 1.02kB ± 0% 1.02kB ± 0% ~ (all equal) pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 1.17kB ± 6% 1.15kB ± 6% ~ (p=0.548 n=6+6) Middleware_control-2 11.2kB ± 0% 11.2kB ± 0% ~ (all equal) name old allocs/op new allocs/op delta pkg:github.com/swaggest/rest/jsonschema goos:linux goarch:amd64 RequestValidator_ValidateRequestData-2 8.00 ± 0% 8.00 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 4.00 ± 0% 4.00 ± 0% ~ (all equal) DecoderFunc_Decode-2 12.0 ± 0% 12.0 ± 0% ~ (all equal) Decoder_Decode_json-2 177 ± 0% 177 ± 0% ~ (all equal) Decoder_Decode_queryObject-2 36.0 ± 0% 36.0 ± 0% ~ (all equal) Decoder_Decode_jsonParam-2 13.0 ± 0% 13.0 ± 0% ~ (all equal) DecoderFactory_SetDecoderFunc-2 16.0 ± 0% 16.0 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 11.0 ± 0% 11.0 ± 0% ~ (all equal) Middleware_control-2 9.00 ± 0% 9.00 ± 0% ~ (all equal) ```
Benchmark result ``` name time/op pkg:github.com/swaggest/rest/jsonschema goos:linux goarch:amd64 RequestValidator_ValidateRequestData-2 1.64µs ± 5% pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 841ns ± 5% DecoderFunc_Decode-2 2.38µs ± 0% Decoder_Decode_json-2 26.0µs ± 1% Decoder_Decode_queryObject-2 5.82µs ± 2% Decoder_Decode_jsonParam-2 2.18µs ± 2% DecoderFactory_SetDecoderFunc-2 1.99µs ± 2% pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 13.4µs ± 3% Middleware_control-2 4.34µs ± 3% name alloc/op pkg:github.com/swaggest/rest/jsonschema goos:linux goarch:amd64 RequestValidator_ValidateRequestData-2 2.46kB ± 0% pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 440B ± 0% DecoderFunc_Decode-2 1.51kB ± 0% Decoder_Decode_json-2 12.2kB ± 0% Decoder_Decode_queryObject-2 2.00kB ± 0% Decoder_Decode_jsonParam-2 736B ± 0% DecoderFactory_SetDecoderFunc-2 1.02kB ± 0% pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 1.15kB ± 6% Middleware_control-2 11.2kB ± 0% name allocs/op pkg:github.com/swaggest/rest/jsonschema goos:linux goarch:amd64 RequestValidator_ValidateRequestData-2 8.00 ± 0% pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 4.00 ± 0% DecoderFunc_Decode-2 12.0 ± 0% Decoder_Decode_json-2 177 ± 0% Decoder_Decode_queryObject-2 36.0 ± 0% Decoder_Decode_jsonParam-2 13.0 ± 0% DecoderFactory_SetDecoderFunc-2 16.0 ± 0% pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 11.0 ± 0% Middleware_control-2 9.00 ± 0% ```
github-actions[bot] commented 1 year ago

Examples Benchmark Result

Benchmark diff with base branch ``` name old time/op new time/op delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-2 24.3µs ± 8% 23.6µs ± 1% ~ (p=0.063 n=5+4) _directGzipHead-2 23.3µs ± 1% 23.9µs ± 5% ~ (p=0.095 n=5+5) _noDirectGzip-2 126µs ± 1% 126µs ± 0% ~ (p=0.690 n=5+5) _directGzip_decode-2 467µs ± 2% 467µs ± 2% ~ (p=1.000 n=5+5) _noDirectGzip_decode-2 127µs ± 1% 128µs ± 2% ~ (p=0.222 n=5+5) _jsonBody-2 46.8µs ± 1% 47.8µs ± 2% ~ (p=0.056 n=5+5) _jsonBodyValidation-2 56.3µs ± 3% 56.6µs ± 2% ~ (p=0.690 n=5+5) _outputHeaders-2 24.3µs ± 1% 24.5µs ± 1% ~ (p=0.095 n=5+5) _requestResponseMapping-2 49.0µs ± 4% 49.7µs ± 1% ~ (p=0.310 n=5+5) _validation-2 52.8µs ± 3% 52.8µs ± 1% ~ (p=0.421 n=5+5) _noValidation-2 36.1µs ± 1% 36.2µs ± 3% ~ (p=0.841 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 24.4µs ±13% 23.6µs ± 1% ~ (p=1.000 n=5+5) _directGzipHead-2 23.8µs ± 3% 23.7µs ± 2% ~ (p=0.730 n=5+4) _noDirectGzip-2 132µs ± 1% 133µs ± 2% ~ (p=0.841 n=5+5) _directGzip_decode-2 480µs ± 1% 480µs ± 1% ~ (p=1.000 n=5+5) _noDirectGzip_decode-2 133µs ± 1% 134µs ± 2% ~ (p=0.690 n=5+5) _htmlResponse-2 40.8µs ± 2% 40.8µs ± 2% ~ (p=1.000 n=5+5) _jsonBodyManual-2 29.1µs ± 1% 29.4µs ± 1% +0.97% (p=0.016 n=5+5) _jsonBody-2 43.0µs ± 3% 43.9µs ± 2% ~ (p=0.095 n=5+5) _jsonBodyValidation-2 58.3µs ± 2% 58.8µs ± 2% ~ (p=0.310 n=5+5) _outputHeaders-2 41.9µs ± 7% 41.0µs ± 3% ~ (p=0.548 n=5+5) _requestResponseMapping-2 49.3µs ± 2% 49.3µs ± 1% ~ (p=0.690 n=5+5) _validation-2 52.5µs ± 2% 53.3µs ± 3% ~ (p=0.151 n=5+5) _noValidation-2 37.5µs ± 4% 37.7µs ± 2% ~ (p=0.421 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 26.3µs ± 1% 26.7µs ± 7% ~ (p=1.000 n=5+5) _ok-2 26.7µs ±13% 26.2µs ± 3% ~ (p=0.690 n=5+5) _invalidBody-2 38.5µs ± 2% 39.5µs ± 2% +2.58% (p=0.032 n=5+5) name old 50%:ms new 50%:ms delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-2 1.11 ± 2% 1.15 ± 7% ~ (p=0.206 n=5+5) _directGzipHead-2 1.10 ± 5% 1.14 ± 5% ~ (p=0.310 n=5+5) _noDirectGzip-2 6.15 ± 3% 6.20 ± 6% ~ (p=0.841 n=5+5) _directGzip_decode-2 17.9 ±10% 17.9 ± 8% ~ (p=1.000 n=5+5) _noDirectGzip_decode-2 6.13 ± 5% 6.28 ± 5% ~ (p=0.421 n=5+5) _jsonBody-2 2.13 ± 4% 2.14 ± 7% ~ (p=0.968 n=5+5) _jsonBodyValidation-2 2.62 ± 4% 2.70 ± 4% ~ (p=0.111 n=5+5) _outputHeaders-2 1.12 ± 2% 1.15 ± 6% ~ (p=0.310 n=5+5) _requestResponseMapping-2 2.10 ± 6% 2.14 ± 5% ~ (p=0.690 n=5+5) _validation-2 2.33 ± 3% 2.44 ± 4% ~ (p=0.056 n=5+5) _noValidation-2 1.59 ± 7% 1.60 ± 6% ~ (p=1.000 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 1.15 ± 7% 1.10 ± 6% ~ (p=0.151 n=5+5) _directGzipHead-2 1.14 ± 3% 1.11 ± 4% ~ (p=0.151 n=5+5) _noDirectGzip-2 6.43 ± 4% 6.50 ± 5% ~ (p=0.841 n=5+5) _directGzip_decode-2 18.6 ± 5% 18.7 ± 5% ~ (p=0.595 n=5+5) _noDirectGzip_decode-2 6.44 ± 4% 6.58 ± 5% ~ (p=0.548 n=5+5) _htmlResponse-2 1.83 ± 3% 1.84 ± 4% ~ (p=0.841 n=5+5) _jsonBodyManual-2 1.36 ± 5% 1.41 ± 6% ~ (p=0.310 n=5+5) _jsonBody-2 1.91 ± 6% 1.94 ± 6% ~ (p=0.841 n=5+5) _jsonBodyValidation-2 2.65 ± 9% 2.66 ± 6% ~ (p=0.690 n=5+5) _outputHeaders-2 1.82 ± 6% 1.80 ± 3% ~ (p=0.802 n=5+5) _requestResponseMapping-2 2.21 ± 6% 2.22 ± 5% ~ (p=1.000 n=5+5) _validation-2 2.29 ±10% 2.31 ± 6% ~ (p=0.421 n=5+5) _noValidation-2 1.64 ± 2% 1.63 ± 4% ~ (p=0.841 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 1.25 ± 4% 1.27 ± 5% ~ (p=0.222 n=5+5) _ok-2 1.27 ± 7% 1.24 ± 6% ~ (p=0.937 n=5+5) _invalidBody-2 1.74 ± 6% 1.69 ± 9% ~ (p=0.548 n=5+5) name old 90%:ms new 90%:ms delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-2 2.10 ± 6% 2.08 ±13% ~ (p=0.690 n=5+5) _directGzipHead-2 2.02 ± 4% 2.06 ± 4% ~ (p=0.421 n=5+5) _noDirectGzip-2 11.0 ± 2% 10.8 ± 3% ~ (p=0.103 n=5+5) _directGzip_decode-2 39.0 ± 5% 38.6 ± 4% ~ (p=0.548 n=5+5) _noDirectGzip_decode-2 11.0 ± 2% 10.9 ± 4% ~ (p=0.500 n=5+5) _jsonBody-2 4.19 ± 4% 4.35 ± 6% ~ (p=0.167 n=5+5) _jsonBodyValidation-2 5.00 ± 4% 5.01 ± 4% ~ (p=1.000 n=5+5) _outputHeaders-2 2.07 ± 4% 2.12 ± 4% ~ (p=0.310 n=5+5) _requestResponseMapping-2 4.38 ± 4% 4.36 ± 4% ~ (p=1.000 n=5+5) _validation-2 4.77 ± 4% 4.75 ± 5% ~ (p=0.802 n=5+5) _noValidation-2 3.37 ± 5% 3.44 ± 2% ~ (p=0.310 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 2.04 ± 7% 2.03 ± 3% ~ (p=1.000 n=5+5) _directGzipHead-2 2.02 ± 8% 2.10 ±11% ~ (p=0.278 n=5+5) _noDirectGzip-2 11.6 ± 5% 11.6 ± 4% ~ (p=0.690 n=5+5) _directGzip_decode-2 40.5 ± 7% 40.6 ± 7% ~ (p=1.000 n=5+5) _noDirectGzip_decode-2 11.7 ± 5% 11.4 ± 5% ~ (p=0.095 n=5+5) _htmlResponse-2 3.80 ± 1% 3.75 ± 6% ~ (p=0.690 n=5+5) _jsonBodyManual-2 2.49 ± 7% 2.46 ± 5% ~ (p=1.000 n=5+5) _jsonBody-2 4.04 ± 5% 4.09 ± 4% ~ (p=0.841 n=5+5) _jsonBodyValidation-2 5.10 ± 4% 5.24 ± 3% ~ (p=0.421 n=5+5) _outputHeaders-2 3.90 ± 9% 3.95 ± 5% ~ (p=0.690 n=5+5) _requestResponseMapping-2 4.54 ± 5% 4.53 ± 6% ~ (p=0.952 n=5+5) _validation-2 4.75 ± 4% 4.94 ± 3% ~ (p=0.095 n=5+5) _noValidation-2 3.61 ± 2% 3.63 ± 5% ~ (p=0.841 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 2.23 ± 4% 2.28 ± 1% ~ (p=0.421 n=5+5) _ok-2 2.24 ± 6% 2.21 ± 3% ~ (p=0.841 n=5+5) _invalidBody-2 3.69 ± 5% 3.85 ± 5% ~ (p=0.151 n=5+5) name old 99%:ms new 99%:ms delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-2 3.45 ± 5% 3.36 ± 6% ~ (p=0.686 n=4+4) _directGzipHead-2 3.33 ± 5% 3.69 ±33% ~ (p=0.548 n=5+5) _noDirectGzip-2 15.3 ± 5% 14.6 ± 4% ~ (p=0.095 n=5+5) _directGzip_decode-2 64.6 ± 7% 63.6 ± 6% ~ (p=0.548 n=5+5) _noDirectGzip_decode-2 15.1 ±10% 15.0 ± 8% ~ (p=1.000 n=5+5) _jsonBody-2 6.23 ± 9% 6.87 ± 8% ~ (p=0.095 n=5+5) _jsonBodyValidation-2 7.70 ±17% 7.62 ±15% ~ (p=0.841 n=5+5) _outputHeaders-2 4.06 ±18% 3.99 ± 6% ~ (p=1.000 n=5+5) _requestResponseMapping-2 8.48 ±18% 9.39 ±11% ~ (p=0.222 n=5+5) _validation-2 8.84 ±27% 9.07 ±16% ~ (p=0.841 n=5+5) _noValidation-2 5.53 ± 4% 5.59 ±20% ~ (p=0.690 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 3.39 ±12% 3.41 ± 6% ~ (p=0.556 n=4+5) _directGzipHead-2 3.91 ±27% 3.44 ± 3% -12.10% (p=0.032 n=5+4) _noDirectGzip-2 16.1 ± 7% 15.6 ± 5% ~ (p=0.222 n=5+5) _directGzip_decode-2 66.8 ± 8% 66.3 ± 5% ~ (p=1.000 n=5+5) _noDirectGzip_decode-2 15.6 ± 4% 15.3 ± 5% ~ (p=0.548 n=5+5) _htmlResponse-2 5.96 ±11% 6.06 ±23% ~ (p=0.841 n=5+5) _jsonBodyManual-2 4.73 ±12% 4.95 ± 8% ~ (p=0.222 n=5+5) _jsonBody-2 6.61 ± 6% 6.45 ±10% ~ (p=0.548 n=5+5) _jsonBodyValidation-2 8.78 ±32% 9.44 ±27% ~ (p=0.690 n=5+5) _outputHeaders-2 7.39 ±48% 6.53 ±12% ~ (p=1.000 n=5+5) _requestResponseMapping-2 7.09 ±19% 7.34 ±21% ~ (p=0.690 n=5+5) _validation-2 7.23 ±17% 7.32 ±12% ~ (p=0.690 n=5+5) _noValidation-2 6.33 ±24% 5.98 ±10% ~ (p=0.841 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 3.54 ± 5% 3.97 ±40% ~ (p=0.841 n=5+5) _ok-2 4.42 ±77% 3.62 ±14% ~ (p=0.548 n=5+5) _invalidBody-2 6.35 ±12% 6.93 ±26% ~ (p=0.548 n=5+5) name old 99.9%:ms new 99.9%:ms delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-2 8.13 ±65% 8.94 ±141% ~ (p=0.690 n=5+5) _directGzipHead-2 5.80 ±25% 7.13 ±60% ~ (p=0.421 n=5+5) _noDirectGzip-2 19.7 ±13% 18.1 ± 8% ~ (p=0.151 n=5+5) _directGzip_decode-2 87.8 ±27% 82.9 ± 8% ~ (p=1.000 n=5+5) _noDirectGzip_decode-2 20.2 ±23% 19.0 ±18% ~ (p=1.000 n=5+5) _jsonBody-2 10.1 ±63% 11.9 ±28% ~ (p=0.548 n=5+5) _jsonBodyValidation-2 13.0 ± 9% 12.3 ±25% ~ (p=0.841 n=5+5) _outputHeaders-2 9.20 ±34% 10.36 ±38% ~ (p=0.841 n=5+5) _requestResponseMapping-2 14.4 ±15% 14.1 ± 9% ~ (p=0.690 n=5+5) _validation-2 14.4 ±12% 14.6 ± 5% ~ (p=0.690 n=5+5) _noValidation-2 11.3 ±30% 9.2 ±37% ~ (p=0.222 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 7.97 ±101% 5.49 ± 7% ~ (p=0.190 n=5+4) _directGzipHead-2 7.61 ±53% 8.49 ±70% ~ (p=0.421 n=5+5) _noDirectGzip-2 19.7 ±12% 20.9 ±10% ~ (p=0.310 n=5+5) _directGzip_decode-2 92.9 ±11% 86.9 ±10% ~ (p=0.222 n=5+5) _noDirectGzip_decode-2 19.2 ±12% 19.1 ± 8% ~ (p=1.000 n=5+5) _htmlResponse-2 10.2 ±24% 12.3 ±43% ~ (p=0.421 n=5+5) _jsonBodyManual-2 11.0 ±24% 12.3 ±18% ~ (p=0.421 n=5+5) _jsonBody-2 10.5 ±19% 10.6 ±20% ~ (p=1.000 n=5+5) _jsonBodyValidation-2 14.4 ±20% 15.7 ±35% ~ (p=0.841 n=5+5) _outputHeaders-2 13.8 ±37% 13.1 ±37% ~ (p=0.690 n=5+5) _requestResponseMapping-2 12.9 ±14% 12.1 ±30% ~ (p=0.841 n=5+5) _validation-2 12.3 ±37% 12.1 ±23% ~ (p=1.000 n=5+5) _noValidation-2 11.1 ±38% 10.8 ±26% ~ (p=1.000 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 6.22 ±19% 10.03 ±63% ~ (p=0.151 n=5+5) _ok-2 7.89 ±89% 5.54 ±29% ~ (p=0.421 n=5+5) _invalidBody-2 11.0 ±34% 14.2 ±27% ~ (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 630 ± 0% 630 ± 0% ~ (all equal) _directGzipHead-2 174 ± 0% 174 ± 0% ~ (all equal) _noDirectGzip-2 1.03k ± 0% 1.03k ± 0% ~ (all equal) _directGzip_decode-2 630 ± 0% 630 ± 0% ~ (all equal) _noDirectGzip_decode-2 1.03k ± 0% 1.03k ± 0% ~ (all equal) _jsonBody-2 199 ± 0% 199 ± 0% ~ (all equal) _jsonBodyValidation-2 185 ± 0% 185 ± 0% ~ (all equal) _outputHeaders-2 146 ± 0% 146 ± 0% ~ (all equal) _requestResponseMapping-2 94.0 ± 0% 94.0 ± 0% ~ (all equal) _validation-2 168 ± 0% 168 ± 0% ~ (all equal) _noValidation-2 168 ± 0% 168 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 638 ± 0% 638 ± 0% ~ (all equal) _directGzipHead-2 182 ± 0% 182 ± 0% ~ (all equal) _noDirectGzip-2 1.04k ± 0% 1.04k ± 0% ~ (all equal) _directGzip_decode-2 638 ± 0% 638 ± 0% ~ (all equal) _noDirectGzip_decode-2 1.04k ± 0% 1.04k ± 0% ~ (all equal) _htmlResponse-2 355 ± 0% 355 ± 0% ~ (all equal) _jsonBodyManual-2 207 ± 0% 207 ± 0% ~ (all equal) _jsonBody-2 207 ± 0% 207 ± 0% ~ (all equal) _jsonBodyValidation-2 193 ± 0% 193 ± 0% ~ (all equal) _outputHeaders-2 214 ± 0% 214 ± 0% ~ (all equal) _requestResponseMapping-2 108 ± 0% 108 ± 0% ~ (all equal) _validation-2 176 ± 0% 176 ± 0% ~ (all equal) _noValidation-2 176 ± 0% 176 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 322 ± 0% 322 ± 0% ~ (all equal) _ok-2 344 ± 0% 344 ± 0% ~ (all equal) _invalidBody-2 420 ± 0% 420 ± 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) _requestResponseMapping-2 169 ± 0% 169 ± 0% ~ (all equal) _validation-2 170 ± 0% 170 ± 0% ~ (all equal) _noValidation-2 173 ± 0% 173 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/advanced-generic 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) _htmlResponse-2 108 ± 0% 108 ± 0% ~ (all equal) _jsonBodyManual-2 195 ± 0% 195 ± 0% ~ (all equal) _jsonBody-2 188 ± 0% 188 ± 0% ~ (all equal) _jsonBodyValidation-2 192 ± 0% 192 ± 0% ~ (all equal) _outputHeaders-2 88.0 ± 0% 88.0 ± 0% ~ (all equal) _requestResponseMapping-2 169 ± 0% 169 ± 0% ~ (all equal) _validation-2 170 ± 0% 170 ± 0% ~ (all equal) _noValidation-2 173 ± 0% 173 ± 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 41.1k ± 7% 42.4k ± 1% ~ (p=0.063 n=5+4) _directGzipHead-2 42.8k ± 1% 41.9k ± 5% ~ (p=0.095 n=5+5) _noDirectGzip-2 7.93k ± 1% 7.93k ± 0% ~ (p=0.690 n=5+5) _directGzip_decode-2 2.14k ± 2% 2.14k ± 2% ~ (p=1.000 n=5+5) _noDirectGzip_decode-2 7.88k ± 1% 7.79k ± 2% ~ (p=0.198 n=5+5) _jsonBody-2 21.3k ± 1% 20.9k ± 2% ~ (p=0.056 n=5+5) _jsonBodyValidation-2 17.8k ± 3% 17.7k ± 2% ~ (p=0.690 n=5+5) _outputHeaders-2 41.1k ± 1% 40.8k ± 1% ~ (p=0.095 n=5+5) _requestResponseMapping-2 20.4k ± 4% 20.1k ± 1% ~ (p=0.310 n=5+5) _validation-2 18.9k ± 3% 18.9k ± 1% ~ (p=0.548 n=5+5) _noValidation-2 27.7k ± 1% 27.7k ± 3% ~ (p=0.841 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 41.2k ±12% 42.3k ± 1% ~ (p=1.000 n=5+5) _directGzipHead-2 42.0k ± 3% 42.3k ± 2% ~ (p=0.730 n=5+4) _noDirectGzip-2 7.55k ± 1% 7.51k ± 2% ~ (p=0.841 n=5+5) _directGzip_decode-2 2.09k ± 1% 2.08k ± 1% ~ (p=0.937 n=5+5) _noDirectGzip_decode-2 7.50k ± 1% 7.47k ± 2% ~ (p=0.690 n=5+5) _htmlResponse-2 24.5k ± 2% 24.5k ± 2% ~ (p=1.000 n=5+5) _jsonBodyManual-2 34.4k ± 1% 34.1k ± 1% -0.96% (p=0.016 n=5+5) _jsonBody-2 23.3k ± 3% 22.8k ± 2% ~ (p=0.095 n=5+5) _jsonBodyValidation-2 17.2k ± 2% 17.0k ± 2% ~ (p=0.310 n=5+5) _outputHeaders-2 23.9k ± 7% 24.4k ± 3% ~ (p=0.548 n=5+5) _requestResponseMapping-2 20.3k ± 2% 20.3k ± 1% ~ (p=0.690 n=5+5) _validation-2 19.0k ± 2% 18.8k ± 3% ~ (p=0.151 n=5+5) _noValidation-2 26.7k ± 4% 26.5k ± 2% ~ (p=0.421 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 38.0k ± 1% 37.5k ± 6% ~ (p=1.000 n=5+5) _ok-2 37.6k ±12% 38.2k ± 2% ~ (p=0.690 n=5+5) _invalidBody-2 26.0k ± 2% 25.3k ± 2% -2.53% (p=0.032 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.85kB ± 0% 3.85kB ± 0% ~ (p=0.151 n=5+5) _directGzipHead-2 3.85kB ± 0% 3.84kB ± 0% ~ (p=0.690 n=5+5) _noDirectGzip-2 6.81kB ±19% 6.19kB ±20% ~ (p=0.310 n=5+5) _directGzip_decode-2 403kB ± 0% 403kB ± 0% ~ (p=1.000 n=5+5) _noDirectGzip_decode-2 5.54kB ± 6% 5.84kB ± 9% ~ (p=0.310 n=5+5) _jsonBody-2 13.1kB ± 0% 13.1kB ± 0% ~ (p=0.167 n=5+5) _jsonBodyValidation-2 18.9kB ± 0% 18.9kB ± 0% ~ (p=0.500 n=5+5) _outputHeaders-2 3.56kB ± 0% 3.56kB ± 0% ~ (p=0.238 n=4+5) _requestResponseMapping-2 16.6kB ± 0% 16.6kB ± 0% ~ (p=0.968 n=5+5) _validation-2 16.5kB ± 0% 16.5kB ± 0% ~ (p=0.881 n=5+5) _noValidation-2 7.75kB ± 0% 7.75kB ± 0% ~ (p=0.516 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 3.88kB ± 0% 3.88kB ± 0% ~ (p=1.000 n=5+5) _directGzipHead-2 3.88kB ± 0% 3.88kB ± 0% ~ (p=0.206 n=5+5) _noDirectGzip-2 6.72kB ±24% 6.81kB ±18% ~ (p=1.000 n=5+5) _directGzip_decode-2 403kB ± 0% 403kB ± 0% ~ (p=1.000 n=5+5) _noDirectGzip_decode-2 5.86kB ± 6% 5.83kB ± 7% ~ (p=0.841 n=5+5) _htmlResponse-2 8.02kB ± 0% 8.02kB ± 0% ~ (p=0.841 n=5+5) _jsonBodyManual-2 4.48kB ± 0% 4.48kB ± 0% ~ (p=0.119 n=5+5) _jsonBody-2 10.2kB ± 0% 10.2kB ± 0% ~ (p=0.151 n=5+5) _jsonBodyValidation-2 19.0kB ± 0% 19.0kB ± 0% ~ (p=0.635 n=5+5) _outputHeaders-2 10.4kB ± 0% 10.4kB ± 0% ~ (p=0.571 n=5+5) _requestResponseMapping-2 16.6kB ± 0% 16.6kB ± 0% ~ (p=0.460 n=5+5) _validation-2 16.5kB ± 0% 16.5kB ± 0% ~ (p=0.984 n=5+5) _noValidation-2 7.81kB ± 0% 7.81kB ± 0% ~ (p=0.762 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 4.63kB ± 0% 4.63kB ± 0% ~ (p=0.762 n=5+5) _ok-2 4.53kB ± 0% 4.54kB ± 0% ~ (p=0.619 n=4+5) _invalidBody-2 8.24kB ± 0% 8.24kB ± 0% ~ (p=0.771 n=4+4) name old allocs/op new allocs/op delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-2 42.0 ± 0% 42.0 ± 0% ~ (all equal) _directGzipHead-2 42.0 ± 0% 42.0 ± 0% ~ (all equal) _noDirectGzip-2 49.6 ± 3% 49.6 ± 3% ~ (p=1.000 n=5+5) _directGzip_decode-2 504 ± 0% 504 ± 0% ~ (p=0.571 n=5+4) _noDirectGzip_decode-2 50.0 ± 0% 50.0 ± 0% ~ (all equal) _jsonBody-2 128 ± 0% 128 ± 0% ~ (all equal) _jsonBodyValidation-2 185 ± 0% 185 ± 0% ~ (all equal) _outputHeaders-2 36.0 ± 0% 36.0 ± 0% ~ (all equal) _requestResponseMapping-2 124 ± 0% 124 ± 0% ~ (all equal) _validation-2 154 ± 0% 154 ± 0% ~ (all equal) _noValidation-2 91.0 ± 0% 91.0 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 44.0 ± 0% 44.0 ± 0% ~ (all equal) _directGzipHead-2 44.0 ± 0% 44.0 ± 0% ~ (all equal) _noDirectGzip-2 51.8 ± 3% 51.8 ± 3% ~ (p=1.000 n=5+5) _directGzip_decode-2 506 ± 0% 506 ± 0% ~ (p=0.444 n=5+5) _noDirectGzip_decode-2 52.0 ± 0% 52.0 ± 0% ~ (all equal) _htmlResponse-2 145 ± 0% 145 ± 0% ~ (all equal) _jsonBodyManual-2 49.0 ± 0% 49.0 ± 0% ~ (all equal) _jsonBody-2 100 ± 0% 100 ± 0% ~ (all equal) _jsonBodyValidation-2 187 ± 0% 187 ± 0% ~ (all equal) _outputHeaders-2 113 ± 0% 113 ± 0% ~ (all equal) _requestResponseMapping-2 126 ± 0% 126 ± 0% ~ (all equal) _validation-2 156 ± 0% 156 ± 0% ~ (all equal) _noValidation-2 93.0 ± 0% 93.0 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 53.0 ± 0% 53.0 ± 0% ~ (all equal) _ok-2 49.0 ± 0% 49.0 ± 0% ~ (all equal) _invalidBody-2 97.0 ± 0% 97.0 ± 0% ~ (all equal) ```