swaggest / rest

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

Fix handling of request input that can accept form or json #213

Closed vearutop closed 2 weeks ago

vearutop commented 2 weeks ago

Fixes #212.

github-actions[bot] commented 2 weeks ago

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 114 (+1) 8877 (+43) 6414 (+32) 664 1799 (+11) 1051 (+8) 216.8K (+1K)
Go (test) 56 (+1) 6757 (+76) 5185 (+60) 295 1277 (+16) 191 (+3) 184.6K (+2.3K)
JSON 3 2035 (+36) 2035 (+36) 0 0 0 77.5K (+1.5K)
github-actions[bot] commented 2 weeks ago

Go API Changes

# summary
Inferred base version: v0.2.68
Suggested version: v0.2.69
github-actions[bot] commented 2 weeks ago

Unit Test Coverage

total: (statements) 81.1% changed lines: (statements) 100.0%

Coverage of changed lines | File | Function | Coverage | |------------------------------------------------------|-------------|-------------| | Total | | 100.0% | | request/decoder.go | | 100.0% | | request/decoder.go:78 | makeDecoder | 100.0% | | _examples/advanced-generic-openapi31/form_or_json.go | | no coverage | | _examples/advanced-generic-openapi31/router.go | | no coverage |
Coverage diff with base branch | File | Function | Base Coverage | Current Coverage | |--------------------|---------------------|---------------|------------------| | Total | | 81.2% | 81.1% (-0.1%) | | request/decoder.go | formDataToURLValues | 77.8% | 55.6% (-22.2%) | | request/decoder.go | makeDecoder | 85.7% | 90.0% (+4.3%) |
github-actions[bot] commented 2 weeks 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-4 1.10µs ± 1% 1.10µs ± 0% ~ (p=0.841 n=5+5) pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-4 522ns ± 0% 595ns ± 1% +14.02% (p=0.004 n=5+6) DecoderFunc_Decode-4 1.50µs ± 1% 1.69µs ± 1% +12.47% (p=0.002 n=6+6) Decoder_Decode_json-4 18.2µs ± 1% 18.3µs ± 0% ~ (p=0.065 n=6+6) Decoder_Decode_queryObject-4 3.98µs ± 0% 4.11µs ± 0% +3.15% (p=0.004 n=5+6) Decoder_Decode_jsonParam-4 1.49µs ± 0% 1.55µs ± 1% +4.03% (p=0.002 n=6+6) DecoderFactory_SetDecoderFunc-4 1.31µs ± 0% 1.38µs ± 0% +5.51% (p=0.002 n=6+6) pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-4 8.35µs ± 1% 8.28µs ± 0% -0.87% (p=0.030 n=6+5) Middleware_control-4 2.75µs ± 1% 2.72µs ± 1% -1.17% (p=0.041 n=6+6) name old alloc/op new alloc/op delta pkg:github.com/swaggest/rest/jsonschema goos:linux goarch:amd64 RequestValidator_ValidateRequestData-4 2.46kB ± 0% 2.46kB ± 0% ~ (all equal) pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-4 440B ± 0% 440B ± 0% ~ (all equal) DecoderFunc_Decode-4 1.53kB ± 0% 1.53kB ± 0% ~ (all equal) Decoder_Decode_json-4 12.4kB ± 0% 12.4kB ± 0% ~ (all equal) Decoder_Decode_queryObject-4 2.01kB ± 0% 2.01kB ± 0% ~ (all equal) Decoder_Decode_jsonParam-4 736B ± 0% 736B ± 0% ~ (all equal) DecoderFactory_SetDecoderFunc-4 1.02kB ± 0% 1.02kB ± 0% ~ (all equal) pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-4 1.17kB ± 3% 1.17kB ± 3% ~ (p=0.779 n=6+6) Middleware_control-4 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-4 8.00 ± 0% 8.00 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-4 4.00 ± 0% 4.00 ± 0% ~ (all equal) DecoderFunc_Decode-4 12.0 ± 0% 12.0 ± 0% ~ (all equal) Decoder_Decode_json-4 177 ± 0% 177 ± 0% ~ (all equal) Decoder_Decode_queryObject-4 38.0 ± 0% 38.0 ± 0% ~ (all equal) Decoder_Decode_jsonParam-4 12.0 ± 0% 12.0 ± 0% ~ (all equal) DecoderFactory_SetDecoderFunc-4 16.0 ± 0% 16.0 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-4 11.0 ± 0% 11.0 ± 0% ~ (all equal) Middleware_control-4 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-4 1.10µs ± 0% pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-4 595ns ± 1% DecoderFunc_Decode-4 1.69µs ± 1% Decoder_Decode_json-4 18.3µs ± 0% Decoder_Decode_queryObject-4 4.11µs ± 0% Decoder_Decode_jsonParam-4 1.55µs ± 1% DecoderFactory_SetDecoderFunc-4 1.38µs ± 0% pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-4 8.28µs ± 0% Middleware_control-4 2.72µs ± 1% name alloc/op pkg:github.com/swaggest/rest/jsonschema goos:linux goarch:amd64 RequestValidator_ValidateRequestData-4 2.46kB ± 0% pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-4 440B ± 0% DecoderFunc_Decode-4 1.53kB ± 0% Decoder_Decode_json-4 12.4kB ± 0% Decoder_Decode_queryObject-4 2.01kB ± 0% Decoder_Decode_jsonParam-4 736B ± 0% DecoderFactory_SetDecoderFunc-4 1.02kB ± 0% pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-4 1.17kB ± 3% Middleware_control-4 11.2kB ± 0% name allocs/op pkg:github.com/swaggest/rest/jsonschema goos:linux goarch:amd64 RequestValidator_ValidateRequestData-4 8.00 ± 0% pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-4 4.00 ± 0% DecoderFunc_Decode-4 12.0 ± 0% Decoder_Decode_json-4 177 ± 0% Decoder_Decode_queryObject-4 38.0 ± 0% Decoder_Decode_jsonParam-4 12.0 ± 0% DecoderFactory_SetDecoderFunc-4 16.0 ± 0% pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-4 11.0 ± 0% Middleware_control-4 9.00 ± 0% ```
github-actions[bot] commented 2 weeks 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-4 16.8µs ± 2% 16.8µs ± 1% ~ (p=1.000 n=5+5) _directGzipHead-4 17.8µs ±12% 17.1µs ± 9% ~ (p=0.151 n=5+5) _noDirectGzip-4 105µs ± 1% 105µs ± 0% ~ (p=0.421 n=5+5) _directGzip_decode-4 321µs ± 1% 322µs ± 0% ~ (p=0.056 n=5+5) _noDirectGzip_decode-4 106µs ± 0% 106µs ± 1% ~ (p=1.000 n=5+5) _jsonBody-4 36.0µs ± 1% 36.4µs ± 1% +1.16% (p=0.032 n=5+5) _jsonBodyValidation-4 41.0µs ± 0% 41.5µs ± 1% +1.34% (p=0.008 n=5+5) _outputHeaders-4 16.9µs ± 2% 17.2µs ± 2% ~ (p=0.095 n=5+5) _requestResponseMapping-4 34.2µs ± 2% 35.2µs ± 1% +3.06% (p=0.008 n=5+5) _validation-4 37.1µs ± 1% 37.4µs ± 3% ~ (p=0.151 n=5+5) _noValidation-4 26.4µs ± 2% 27.2µs ± 4% +3.11% (p=0.032 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64 _directGzip-4 17.1µs ± 2% 17.4µs ± 1% ~ (p=0.151 n=5+5) _directGzipHead-4 17.5µs ±10% 17.6µs ± 2% ~ (p=0.222 n=5+5) _noDirectGzip-4 106µs ± 1% 106µs ± 1% ~ (p=0.310 n=5+5) _directGzip_decode-4 319µs ± 0% 330µs ± 1% +3.42% (p=0.008 n=5+5) _noDirectGzip_decode-4 107µs ± 1% 107µs ± 1% ~ (p=0.310 n=5+5) _htmlResponse-4 30.5µs ± 5% 31.0µs ± 1% ~ (p=0.151 n=5+5) _jsonBodyManual-4 21.1µs ± 1% 21.5µs ± 1% +1.69% (p=0.008 n=5+5) _jsonBody-4 32.1µs ± 0% 32.9µs ± 2% +2.78% (p=0.016 n=4+5) _jsonBodyValidation-4 41.0µs ± 3% 41.9µs ± 2% ~ (p=0.056 n=5+5) _outputHeaders-4 29.2µs ± 1% 30.4µs ± 3% +3.92% (p=0.008 n=5+5) _requestResponseMapping-4 34.2µs ± 3% 35.2µs ± 3% ~ (p=0.056 n=5+5) _validation-4 37.0µs ± 4% 38.3µs ± 1% +3.61% (p=0.032 n=5+5) _noValidation-4 26.5µs ± 2% 27.1µs ± 2% +2.28% (p=0.032 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-4 19.8µs ± 7% 19.6µs ± 1% ~ (p=0.841 n=5+5) _ok-4 19.5µs ± 2% 19.7µs ± 1% ~ (p=0.190 n=5+4) _invalidBody-4 29.0µs ± 3% 29.0µs ± 3% ~ (p=1.000 n=5+5) name old 50%:ms new 50%:ms delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-4 0.73 ± 7% 0.77 ± 9% ~ (p=0.151 n=5+5) _directGzipHead-4 0.75 ±10% 0.75 ± 9% ~ (p=1.000 n=5+5) _noDirectGzip-4 4.92 ± 3% 4.82 ± 5% ~ (p=0.310 n=5+5) _directGzip_decode-4 10.8 ± 2% 10.5 ± 8% ~ (p=0.286 n=5+5) _noDirectGzip_decode-4 4.77 ± 4% 4.81 ± 4% ~ (p=1.000 n=5+5) _jsonBody-4 1.47 ± 5% 1.51 ± 5% ~ (p=0.421 n=5+5) _jsonBodyValidation-4 1.68 ± 6% 1.66 ± 2% ~ (p=0.222 n=5+5) _outputHeaders-4 0.75 ± 8% 0.72 ± 3% ~ (p=0.421 n=5+5) _requestResponseMapping-4 1.42 ±11% 1.45 ± 4% ~ (p=0.738 n=5+5) _validation-4 1.57 ± 7% 1.56 ± 5% ~ (p=0.841 n=5+5) _noValidation-4 1.11 ± 8% 1.10 ± 8% ~ (p=0.500 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64 _directGzip-4 0.75 ± 3% 0.74 ± 5% ~ (p=0.730 n=5+5) _directGzipHead-4 0.75 ±16% 0.74 ± 4% ~ (p=0.548 n=5+5) _noDirectGzip-4 4.91 ± 4% 4.80 ±10% ~ (p=0.310 n=5+5) _directGzip_decode-4 10.5 ± 5% 11.7 ±13% +11.38% (p=0.016 n=5+5) _noDirectGzip_decode-4 4.77 ± 3% 4.86 ± 3% ~ (p=0.421 n=5+5) _htmlResponse-4 1.28 ± 4% 1.30 ± 2% ~ (p=0.421 n=5+5) _jsonBodyManual-4 0.92 ± 4% 0.89 ± 6% ~ (p=0.222 n=5+5) _jsonBody-4 1.33 ± 5% 1.37 ± 8% ~ (p=0.690 n=5+5) _jsonBodyValidation-4 1.67 ± 1% 1.78 ± 5% +6.48% (p=0.008 n=5+5) _outputHeaders-4 1.16 ± 5% 1.23 ± 3% +6.30% (p=0.032 n=5+5) _requestResponseMapping-4 1.40 ± 7% 1.44 ± 9% ~ (p=0.548 n=5+5) _validation-4 1.48 ± 5% 1.58 ± 7% +6.70% (p=0.032 n=5+5) _noValidation-4 1.09 ± 9% 1.11 ± 8% ~ (p=0.548 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-4 0.88 ± 6% 0.86 ± 7% ~ (p=0.841 n=5+5) _ok-4 0.83 ± 7% 0.86 ± 4% ~ (p=0.310 n=5+5) _invalidBody-4 1.20 ± 6% 1.15 ± 5% ~ (p=0.151 n=5+5) name old 90%:ms new 90%:ms delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-4 1.52 ± 9% 1.53 ± 4% ~ (p=0.516 n=5+5) _directGzipHead-4 1.58 ±10% 1.56 ± 9% ~ (p=1.000 n=5+5) _noDirectGzip-4 10.0 ± 3% 10.0 ± 3% ~ (p=1.000 n=5+5) _directGzip_decode-4 30.7 ± 8% 32.2 ± 7% ~ (p=0.103 n=5+5) _noDirectGzip_decode-4 10.1 ± 4% 10.2 ± 3% ~ (p=0.937 n=5+5) _jsonBody-4 3.32 ± 3% 3.29 ± 2% ~ (p=0.548 n=5+5) _jsonBodyValidation-4 3.73 ± 4% 3.85 ± 5% ~ (p=0.222 n=5+5) _outputHeaders-4 1.53 ± 3% 1.56 ± 5% ~ (p=0.222 n=5+5) _requestResponseMapping-4 3.11 ± 5% 3.33 ± 3% +7.08% (p=0.016 n=5+5) _validation-4 3.42 ± 2% 3.50 ± 5% ~ (p=0.421 n=5+5) _noValidation-4 2.44 ± 5% 2.47 ± 4% ~ (p=0.690 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64 _directGzip-4 1.55 ± 3% 1.60 ± 6% ~ (p=0.222 n=5+5) _directGzipHead-4 1.63 ±12% 1.58 ± 5% ~ (p=0.524 n=5+5) _noDirectGzip-4 9.94 ± 3% 9.92 ± 5% ~ (p=0.841 n=5+5) _directGzip_decode-4 31.3 ± 6% 31.3 ± 8% ~ (p=1.000 n=5+5) _noDirectGzip_decode-4 10.2 ± 4% 10.2 ± 6% ~ (p=0.452 n=5+5) _htmlResponse-4 2.82 ± 3% 2.95 ± 5% ~ (p=0.056 n=5+5) _jsonBodyManual-4 1.89 ± 5% 1.95 ± 9% ~ (p=0.421 n=5+5) _jsonBody-4 2.92 ± 2% 3.03 ± 3% +3.94% (p=0.032 n=5+5) _jsonBodyValidation-4 3.76 ± 4% 3.85 ± 5% ~ (p=0.548 n=5+5) _outputHeaders-4 2.78 ± 2% 2.88 ± 4% +3.53% (p=0.016 n=5+5) _requestResponseMapping-4 3.14 ± 6% 3.28 ± 6% ~ (p=0.095 n=5+5) _validation-4 3.48 ± 7% 3.59 ± 3% ~ (p=0.222 n=5+5) _noValidation-4 2.56 ± 5% 2.59 ± 5% ~ (p=0.690 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-4 1.81 ± 6% 1.72 ± 3% -5.00% (p=0.016 n=5+5) _ok-4 1.75 ± 4% 1.83 ±11% ~ (p=0.341 n=5+5) _invalidBody-4 2.80 ± 8% 2.79 ± 6% ~ (p=0.841 n=5+5) name old 99%:ms new 99%:ms delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-4 2.59 ±11% 2.55 ± 2% ~ (p=0.548 n=5+5) _directGzipHead-4 3.12 ±39% 2.79 ±25% ~ (p=0.690 n=5+5) _noDirectGzip-4 15.1 ± 5% 15.4 ± 4% ~ (p=0.310 n=5+5) _directGzip_decode-4 59.5 ± 9% 61.2 ± 8% ~ (p=0.690 n=5+5) _noDirectGzip_decode-4 15.4 ± 3% 15.5 ± 4% ~ (p=1.000 n=5+5) _jsonBody-4 5.54 ±11% 6.10 ± 5% +10.14% (p=0.032 n=5+5) _jsonBodyValidation-4 6.85 ± 5% 6.61 ± 6% ~ (p=0.151 n=5+5) _outputHeaders-4 2.66 ± 2% 2.65 ± 2% ~ (p=0.841 n=5+5) _requestResponseMapping-4 5.30 ±11% 5.80 ±11% ~ (p=0.056 n=5+5) _validation-4 5.94 ± 7% 5.67 ±11% ~ (p=0.151 n=5+5) _noValidation-4 4.22 ± 2% 4.53 ±16% ~ (p=0.421 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64 _directGzip-4 2.58 ± 6% 2.75 ± 5% +6.24% (p=0.032 n=5+5) _directGzipHead-4 3.01 ±33% 2.79 ± 4% ~ (p=0.690 n=5+5) _noDirectGzip-4 16.1 ± 5% 15.9 ± 5% ~ (p=0.452 n=5+5) _directGzip_decode-4 60.9 ± 8% 58.7 ± 8% ~ (p=0.421 n=5+5) _noDirectGzip_decode-4 16.0 ± 5% 16.1 ± 9% ~ (p=1.000 n=5+5) _htmlResponse-4 4.88 ±18% 4.94 ± 5% ~ (p=0.421 n=5+5) _jsonBodyManual-4 3.15 ± 3% 3.32 ± 6% ~ (p=0.056 n=5+5) _jsonBody-4 4.86 ± 7% 4.90 ± 8% ~ (p=0.548 n=5+5) _jsonBodyValidation-4 6.28 ± 9% 6.28 ±13% ~ (p=1.000 n=5+5) _outputHeaders-4 4.47 ± 7% 4.73 ± 9% ~ (p=0.095 n=5+5) _requestResponseMapping-4 5.19 ± 6% 5.26 ±10% ~ (p=0.690 n=5+5) _validation-4 5.57 ± 5% 5.84 ±10% ~ (p=0.310 n=5+5) _noValidation-4 4.20 ± 3% 4.41 ± 6% ~ (p=0.056 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-4 2.97 ±19% 2.80 ± 7% ~ (p=0.421 n=5+5) _ok-4 2.97 ± 7% 2.90 ± 3% ~ (p=0.556 n=5+4) _invalidBody-4 5.37 ±13% 5.15 ± 6% ~ (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-4 4.69 ±16% 5.19 ±16% ~ (p=0.421 n=5+5) _directGzipHead-4 7.81 ±65% 5.45 ±28% ~ (p=0.151 n=5+5) _noDirectGzip-4 20.3 ±12% 20.4 ± 7% ~ (p=0.690 n=5+5) _directGzip_decode-4 78.6 ± 7% 83.6 ±10% ~ (p=0.151 n=5+5) _noDirectGzip_decode-4 20.6 ±10% 20.7 ±19% ~ (p=0.548 n=5+5) _jsonBody-4 8.56 ± 6% 9.59 ±12% +12.06% (p=0.016 n=5+5) _jsonBodyValidation-4 10.8 ± 8% 9.8 ± 8% -9.21% (p=0.032 n=5+5) _outputHeaders-4 5.18 ±27% 5.62 ±13% ~ (p=0.690 n=5+5) _requestResponseMapping-4 8.48 ± 5% 8.83 ± 8% ~ (p=0.421 n=5+5) _validation-4 9.33 ± 8% 8.85 ± 9% ~ (p=0.421 n=5+5) _noValidation-4 8.16 ±22% 7.84 ±58% ~ (p=0.548 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64 _directGzip-4 5.18 ±22% 5.40 ±25% ~ (p=0.690 n=5+5) _directGzipHead-4 6.65 ±36% 5.88 ±12% ~ (p=0.421 n=5+5) _noDirectGzip-4 19.9 ± 4% 22.6 ±12% ~ (p=0.056 n=5+5) _directGzip_decode-4 79.3 ± 8% 83.0 ±11% ~ (p=0.421 n=5+5) _noDirectGzip_decode-4 22.8 ±27% 21.6 ±10% ~ (p=0.841 n=5+5) _htmlResponse-4 8.23 ±19% 8.18 ±20% ~ (p=0.841 n=5+5) _jsonBodyManual-4 6.09 ±24% 5.87 ±16% ~ (p=0.548 n=5+5) _jsonBody-4 7.41 ±17% 7.45 ±25% ~ (p=0.690 n=5+5) _jsonBodyValidation-4 9.85 ±12% 9.86 ±21% ~ (p=1.000 n=5+5) _outputHeaders-4 6.64 ±10% 6.90 ±15% ~ (p=0.690 n=5+5) _requestResponseMapping-4 7.48 ±10% 7.93 ± 9% ~ (p=0.222 n=5+5) _validation-4 9.07 ±13% 8.62 ±10% ~ (p=0.548 n=5+5) _noValidation-4 6.37 ± 9% 7.38 ±12% ~ (p=0.095 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-4 5.25 ±58% 5.27 ±18% ~ (p=0.421 n=5+5) _ok-4 5.67 ±19% 5.64 ±41% ~ (p=0.690 n=5+5) _invalidBody-4 8.88 ±20% 8.88 ± 5% ~ (p=0.841 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-4 630 ± 0% 630 ± 0% ~ (all equal) _directGzipHead-4 174 ± 0% 174 ± 0% ~ (all equal) _noDirectGzip-4 1.03k ± 0% 1.03k ± 0% ~ (all equal) _directGzip_decode-4 630 ± 0% 630 ± 0% ~ (all equal) _noDirectGzip_decode-4 1.03k ± 0% 1.03k ± 0% ~ (all equal) _jsonBody-4 199 ± 0% 199 ± 0% ~ (all equal) _jsonBodyValidation-4 185 ± 0% 185 ± 0% ~ (all equal) _outputHeaders-4 146 ± 0% 146 ± 0% ~ (all equal) _requestResponseMapping-4 94.0 ± 0% 94.0 ± 0% ~ (all equal) _validation-4 168 ± 0% 168 ± 0% ~ (all equal) _noValidation-4 168 ± 0% 168 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64 _directGzip-4 638 ± 0% 638 ± 0% ~ (all equal) _directGzipHead-4 182 ± 0% 182 ± 0% ~ (all equal) _noDirectGzip-4 1.04k ± 0% 1.04k ± 0% ~ (all equal) _directGzip_decode-4 638 ± 0% 638 ± 0% ~ (all equal) _noDirectGzip_decode-4 1.04k ± 0% 1.04k ± 0% ~ (all equal) _htmlResponse-4 355 ± 0% 355 ± 0% ~ (all equal) _jsonBodyManual-4 207 ± 0% 207 ± 0% ~ (all equal) _jsonBody-4 207 ± 0% 207 ± 0% ~ (all equal) _jsonBodyValidation-4 193 ± 0% 193 ± 0% ~ (all equal) _outputHeaders-4 214 ± 0% 214 ± 0% ~ (all equal) _requestResponseMapping-4 108 ± 0% 108 ± 0% ~ (all equal) _validation-4 176 ± 0% 176 ± 0% ~ (all equal) _noValidation-4 176 ± 0% 176 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-4 322 ± 0% 322 ± 0% ~ (all equal) _ok-4 344 ± 0% 344 ± 0% ~ (all equal) _invalidBody-4 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-4 103 ± 0% 103 ± 0% ~ (all equal) _directGzipHead-4 104 ± 0% 104 ± 0% ~ (all equal) _noDirectGzip-4 117 ± 0% 117 ± 0% ~ (all equal) _directGzip_decode-4 116 ± 0% 116 ± 0% ~ (all equal) _noDirectGzip_decode-4 130 ± 0% 130 ± 0% ~ (all equal) _jsonBody-4 188 ± 0% 188 ± 0% ~ (all equal) _jsonBodyValidation-4 192 ± 0% 192 ± 0% ~ (all equal) _outputHeaders-4 77.0 ± 0% 77.0 ± 0% ~ (all equal) _requestResponseMapping-4 169 ± 0% 169 ± 0% ~ (all equal) _validation-4 170 ± 0% 170 ± 0% ~ (all equal) _noValidation-4 173 ± 0% 173 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64 _directGzip-4 103 ± 0% 103 ± 0% ~ (all equal) _directGzipHead-4 104 ± 0% 104 ± 0% ~ (all equal) _noDirectGzip-4 117 ± 0% 117 ± 0% ~ (all equal) _directGzip_decode-4 116 ± 0% 116 ± 0% ~ (all equal) _noDirectGzip_decode-4 130 ± 0% 130 ± 0% ~ (all equal) _htmlResponse-4 108 ± 0% 108 ± 0% ~ (all equal) _jsonBodyManual-4 195 ± 0% 195 ± 0% ~ (all equal) _jsonBody-4 188 ± 0% 188 ± 0% ~ (all equal) _jsonBodyValidation-4 192 ± 0% 192 ± 0% ~ (all equal) _outputHeaders-4 88.0 ± 0% 88.0 ± 0% ~ (all equal) _requestResponseMapping-4 169 ± 0% 169 ± 0% ~ (all equal) _validation-4 170 ± 0% 170 ± 0% ~ (all equal) _noValidation-4 173 ± 0% 173 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-4 74.0 ± 0% 74.0 ± 0% ~ (all equal) _ok-4 74.0 ± 0% 74.0 ± 0% ~ (all equal) _invalidBody-4 137 ± 0% 137 ± 0% ~ (all equal) name old rps new rps delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-4 59.5k ± 2% 59.4k ± 1% ~ (p=1.000 n=5+5) _directGzipHead-4 56.5k ±11% 58.6k ± 9% ~ (p=0.151 n=5+5) _noDirectGzip-4 9.56k ± 1% 9.54k ± 0% ~ (p=0.421 n=5+5) _directGzip_decode-4 3.12k ± 1% 3.10k ± 0% ~ (p=0.056 n=5+5) _noDirectGzip_decode-4 9.47k ± 0% 9.48k ± 1% ~ (p=1.000 n=5+5) _jsonBody-4 27.8k ± 1% 27.5k ± 1% -1.14% (p=0.032 n=5+5) _jsonBodyValidation-4 24.4k ± 0% 24.1k ± 1% -1.32% (p=0.008 n=5+5) _outputHeaders-4 59.0k ± 2% 58.2k ± 2% ~ (p=0.095 n=5+5) _requestResponseMapping-4 29.3k ± 2% 28.4k ± 1% -2.99% (p=0.008 n=5+5) _validation-4 26.9k ± 1% 26.7k ± 3% ~ (p=0.151 n=5+5) _noValidation-4 37.9k ± 2% 36.8k ± 4% -2.98% (p=0.032 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64 _directGzip-4 58.4k ± 2% 57.5k ± 1% ~ (p=0.151 n=5+5) _directGzipHead-4 57.3k ± 9% 56.8k ± 2% ~ (p=0.222 n=5+5) _noDirectGzip-4 9.42k ± 1% 9.40k ± 1% ~ (p=0.310 n=5+5) _directGzip_decode-4 3.13k ± 0% 3.03k ± 1% -3.30% (p=0.008 n=5+5) _noDirectGzip_decode-4 9.38k ± 1% 9.32k ± 1% ~ (p=0.310 n=5+5) _htmlResponse-4 32.9k ± 4% 32.3k ± 1% ~ (p=0.151 n=5+5) _jsonBodyManual-4 47.3k ± 1% 46.5k ± 1% -1.65% (p=0.008 n=5+5) _jsonBody-4 31.2k ± 0% 30.4k ± 2% -2.67% (p=0.016 n=4+5) _jsonBodyValidation-4 24.4k ± 3% 23.9k ± 2% ~ (p=0.056 n=5+5) _outputHeaders-4 34.2k ± 1% 32.9k ± 3% -3.75% (p=0.008 n=5+5) _requestResponseMapping-4 29.3k ± 2% 28.4k ± 3% ~ (p=0.056 n=5+5) _validation-4 27.1k ± 4% 26.1k ± 1% -3.51% (p=0.032 n=5+5) _noValidation-4 37.7k ± 2% 36.9k ± 2% -2.23% (p=0.032 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-4 50.5k ± 6% 51.1k ± 1% ~ (p=0.841 n=5+5) _ok-4 51.2k ± 2% 50.9k ± 1% ~ (p=0.190 n=5+4) _invalidBody-4 34.5k ± 3% 34.5k ± 3% ~ (p=1.000 n=5+5) name old alloc/op new alloc/op delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-4 3.99kB ± 0% 3.99kB ± 0% ~ (p=0.413 n=5+4) _directGzipHead-4 3.99kB ± 0% 3.99kB ± 0% ~ (p=0.444 n=5+5) _noDirectGzip-4 7.35kB ±19% 7.20kB ±13% ~ (p=1.000 n=5+5) _directGzip_decode-4 399kB ± 0% 398kB ± 0% ~ (p=0.151 n=5+5) _noDirectGzip_decode-4 7.44kB ±13% 6.72kB ±18% ~ (p=0.310 n=5+5) _jsonBody-4 13.7kB ± 0% 13.7kB ± 0% ~ (p=0.730 n=5+5) _jsonBodyValidation-4 19.5kB ± 0% 19.5kB ± 0% ~ (p=1.000 n=5+5) _outputHeaders-4 3.70kB ± 0% 3.71kB ± 0% ~ (p=0.103 n=5+5) _requestResponseMapping-4 16.8kB ± 0% 16.8kB ± 0% ~ (p=0.595 n=5+5) _validation-4 16.7kB ± 0% 16.7kB ± 0% ~ (p=0.286 n=5+5) _noValidation-4 7.93kB ± 0% 7.93kB ± 0% ~ (p=0.222 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64 _directGzip-4 4.01kB ± 0% 4.01kB ± 0% ~ (p=0.238 n=5+4) _directGzipHead-4 4.01kB ± 0% 4.00kB ± 0% ~ (p=0.500 n=5+5) _noDirectGzip-4 7.68kB ±15% 7.56kB ±20% ~ (p=0.841 n=5+5) _directGzip_decode-4 398kB ± 0% 398kB ± 0% ~ (p=0.841 n=5+5) _noDirectGzip_decode-4 7.13kB ±11% 6.76kB ±11% ~ (p=0.548 n=5+5) _htmlResponse-4 8.54kB ± 0% 8.54kB ± 0% ~ (p=0.063 n=5+4) _jsonBodyManual-4 4.96kB ± 0% 4.96kB ± 0% ~ (p=0.873 n=5+5) _jsonBody-4 10.7kB ± 0% 10.7kB ± 0% ~ (p=0.841 n=5+5) _jsonBodyValidation-4 19.6kB ± 0% 19.5kB ± 0% -0.10% (p=0.008 n=5+5) _outputHeaders-4 10.5kB ± 0% 10.5kB ± 0% ~ (p=0.437 n=5+5) _requestResponseMapping-4 16.8kB ± 0% 16.8kB ± 0% ~ (p=0.079 n=5+5) _validation-4 16.7kB ± 0% 16.7kB ± 0% ~ (p=0.246 n=5+5) _noValidation-4 7.96kB ± 0% 7.96kB ± 0% ~ (p=0.508 n=5+4) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-4 5.23kB ± 0% 5.23kB ± 0% ~ (p=0.952 n=5+5) _ok-4 5.13kB ± 0% 5.16kB ± 2% ~ (p=0.143 n=4+5) _invalidBody-4 8.81kB ± 0% 8.81kB ± 0% ~ (p=1.000 n=4+4) name old allocs/op new allocs/op delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-4 42.0 ± 0% 42.0 ± 0% ~ (all equal) _directGzipHead-4 42.0 ± 0% 42.0 ± 0% ~ (all equal) _noDirectGzip-4 49.2 ± 4% 49.2 ± 4% ~ (p=1.000 n=5+5) _directGzip_decode-4 487 ± 0% 486 ± 0% ~ (p=0.365 n=5+5) _noDirectGzip_decode-4 50.0 ± 0% 50.0 ± 0% ~ (all equal) _jsonBody-4 130 ± 0% 130 ± 0% ~ (all equal) _jsonBodyValidation-4 187 ± 0% 187 ± 0% ~ (all equal) _outputHeaders-4 36.0 ± 0% 36.0 ± 0% ~ (all equal) _requestResponseMapping-4 124 ± 0% 124 ± 0% ~ (all equal) _validation-4 155 ± 0% 155 ± 0% ~ (all equal) _noValidation-4 91.0 ± 0% 91.0 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64 _directGzip-4 43.0 ± 0% 43.0 ± 0% ~ (all equal) _directGzipHead-4 43.0 ± 0% 43.0 ± 0% ~ (all equal) _noDirectGzip-4 50.2 ± 4% 50.2 ± 4% ~ (p=1.000 n=5+5) _directGzip_decode-4 487 ± 0% 487 ± 0% ~ (p=1.000 n=5+5) _noDirectGzip_decode-4 51.0 ± 0% 51.0 ± 0% ~ (all equal) _htmlResponse-4 146 ± 0% 146 ± 0% ~ (all equal) _jsonBodyManual-4 49.0 ± 0% 49.0 ± 0% ~ (all equal) _jsonBody-4 100 ± 0% 100 ± 0% ~ (all equal) _jsonBodyValidation-4 188 ± 0% 188 ± 0% ~ (all equal) _outputHeaders-4 112 ± 0% 112 ± 0% ~ (all equal) _requestResponseMapping-4 125 ± 0% 125 ± 0% ~ (all equal) _validation-4 156 ± 0% 155 ± 0% ~ (p=0.095 n=5+4) _noValidation-4 92.0 ± 0% 92.0 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-4 54.0 ± 0% 54.0 ± 0% ~ (all equal) _ok-4 50.0 ± 0% 50.0 ± 0% ~ (all equal) _invalidBody-4 97.0 ± 0% 97.0 ± 0% ~ (all equal) ```