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

Infer default values from prepared schema #195

Closed vearutop closed 8 months ago

vearutop commented 8 months ago

Fixes https://github.com/swaggest/rest/issues/133. Fixes #194.

github-actions[bot] commented 8 months ago

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 113 8734 (+21) 6297 (+16) 660 (+1) 1777 (+4) 1038 (+9) 213.5K (+603B)
Go (test) 55 6678 (+67) 5124 (+52) 295 1259 (+15) 188 182.3K (+2K)
github-actions[bot] commented 8 months ago

Go API Changes

# github.com/swaggest/rest/request
## compatible changes
DecoderFactory.JSONSchemaReflector: added

# summary
Inferred base version: v0.2.63
Suggested version: v0.3.0
github-actions[bot] commented 8 months ago

Unit Test Coverage

total: (statements) 81.2% changed lines: (statements) 90.5%

Coverage of changed lines | File | Function | Coverage | |------------------------|--------------------|----------| | Total | | 90.5% | | request/factory.go | | 87.5% | | request/factory.go:261 | makeDefaultDecoder | 93.3% | | web/service.go | | 100.0% | | web/service.go:23 | NewService | 100.0% |
Coverage diff with base branch | File | Function | Base Coverage | Current Coverage | |--------------------|--------------------|---------------|------------------| | Total | | 81.2% | 81.2% (0.0%) | | request/factory.go | makeDefaultDecoder | 100.0% | 93.3% (-6.7%) |
codecov[bot] commented 8 months ago

Codecov Report

Attention: Patch coverage is 69.23077% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 76.10%. Comparing base (af28bea) to head (478c206).

Files Patch % Lines
request/factory.go 66.66% 2 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #195 +/- ## ========================================== - Coverage 76.18% 76.10% -0.09% ========================================== Files 30 30 Lines 1713 1724 +11 ========================================== + Hits 1305 1312 +7 - Misses 295 297 +2 - Partials 113 115 +2 ``` | [Flag](https://app.codecov.io/gh/swaggest/rest/pull/195/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=swaggest) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/swaggest/rest/pull/195/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=swaggest) | `76.10% <69.23%> (-0.09%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=swaggest#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 8 months 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 ± 1% ~ (p=0.113 n=6+5) pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-4 505ns ± 0% 496ns ± 1% -1.85% (p=0.008 n=5+5) DecoderFunc_Decode-4 1.47µs ± 1% 1.46µs ± 1% ~ (p=0.169 n=6+6) Decoder_Decode_json-4 18.3µs ± 0% 18.4µs ± 0% ~ (p=0.502 n=5+6) Decoder_Decode_queryObject-4 3.94µs ± 0% 3.91µs ± 1% -0.65% (p=0.039 n=6+6) Decoder_Decode_jsonParam-4 1.50µs ± 0% 1.51µs ± 0% +0.51% (p=0.004 n=6+6) DecoderFactory_SetDecoderFunc-4 1.31µs ± 1% 1.29µs ± 1% -1.43% (p=0.002 n=6+6) pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-4 11.5µs ± 2% 11.4µs ± 1% ~ (p=0.937 n=6+6) Middleware_control-4 2.77µs ± 1% 2.76µs ± 2% ~ (p=0.240 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.51kB ± 0% 1.51kB ± 0% ~ (all equal) Decoder_Decode_json-4 12.3kB ± 0% 12.3kB ± 0% ~ (all equal) Decoder_Decode_queryObject-4 2.00kB ± 0% 2.00kB ± 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.32kB ± 4% 1.33kB ± 7% ~ (p=0.937 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 36.0 ± 0% 36.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 ± 1% pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-4 496ns ± 1% DecoderFunc_Decode-4 1.46µs ± 1% Decoder_Decode_json-4 18.4µs ± 0% Decoder_Decode_queryObject-4 3.91µs ± 1% Decoder_Decode_jsonParam-4 1.51µs ± 0% DecoderFactory_SetDecoderFunc-4 1.29µs ± 1% pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-4 11.4µs ± 1% Middleware_control-4 2.76µs ± 2% 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.51kB ± 0% Decoder_Decode_json-4 12.3kB ± 0% Decoder_Decode_queryObject-4 2.00kB ± 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.33kB ± 7% 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 36.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 8 months 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.1µs ± 2% 16.1µs ± 1% ~ (p=0.841 n=5+5) _directGzipHead-4 16.1µs ± 4% 16.0µs ± 0% ~ (p=0.556 n=5+4) _noDirectGzip-4 91.8µs ± 2% 91.2µs ± 1% ~ (p=0.548 n=5+5) _directGzip_decode-4 324µs ± 1% 324µs ± 1% ~ (p=0.690 n=5+5) _noDirectGzip_decode-4 91.1µs ± 0% 91.4µs ± 0% +0.35% (p=0.032 n=5+5) _jsonBody-4 34.5µs ± 3% 34.7µs ± 2% ~ (p=0.548 n=5+5) _jsonBodyValidation-4 39.9µs ± 1% 39.6µs ± 1% ~ (p=0.548 n=5+5) _outputHeaders-4 16.4µs ± 1% 16.5µs ± 1% ~ (p=0.056 n=5+5) _requestResponseMapping-4 34.0µs ± 2% 34.3µs ± 1% ~ (p=0.151 n=5+5) _validation-4 36.9µs ± 2% 37.1µs ± 1% ~ (p=0.421 n=5+5) _noValidation-4 25.7µs ± 1% 25.7µs ± 1% ~ (p=0.841 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64 _directGzip-4 16.5µs ± 6% 16.3µs ± 0% ~ (p=0.413 n=5+4) _directGzipHead-4 16.2µs ± 1% 16.3µs ± 3% ~ (p=0.690 n=5+5) _noDirectGzip-4 92.3µs ± 0% 91.7µs ± 0% -0.73% (p=0.032 n=5+5) _directGzip_decode-4 325µs ± 1% 325µs ± 1% ~ (p=0.841 n=5+5) _noDirectGzip_decode-4 92.3µs ± 0% 92.1µs ± 1% ~ (p=0.151 n=5+5) _htmlResponse-4 29.4µs ± 1% 29.4µs ± 1% ~ (p=0.548 n=5+5) _jsonBodyManual-4 20.4µs ± 1% 20.4µs ± 1% ~ (p=0.548 n=5+5) _jsonBody-4 30.7µs ± 1% 30.9µs ± 1% ~ (p=0.222 n=5+5) _jsonBodyValidation-4 40.0µs ± 1% 40.3µs ± 2% ~ (p=0.222 n=5+5) _outputHeaders-4 28.7µs ± 1% 28.8µs ± 1% ~ (p=0.841 n=5+5) _requestResponseMapping-4 33.9µs ± 1% 33.8µs ± 1% ~ (p=0.690 n=5+5) _validation-4 36.3µs ± 0% 36.3µs ± 1% ~ (p=0.421 n=5+5) _noValidation-4 25.8µs ± 0% 25.6µs ± 2% ~ (p=0.548 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-4 18.6µs ± 6% 18.2µs ± 0% ~ (p=0.556 n=5+4) _ok-4 18.2µs ± 1% 18.3µs ± 1% ~ (p=0.548 n=5+5) _invalidBody-4 26.5µs ± 5% 26.9µs ± 4% ~ (p=0.421 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.70 ± 6% 0.71 ± 6% ~ (p=0.690 n=5+5) _directGzipHead-4 0.71 ± 7% 0.70 ±10% ~ (p=0.841 n=5+5) _noDirectGzip-4 4.22 ± 6% 4.11 ± 2% ~ (p=0.690 n=5+5) _directGzip_decode-4 10.2 ±12% 10.3 ± 6% ~ (p=0.841 n=5+5) _noDirectGzip_decode-4 4.21 ± 4% 4.18 ± 5% ~ (p=0.841 n=5+5) _jsonBody-4 1.45 ± 9% 1.40 ± 1% ~ (p=0.135 n=5+5) _jsonBodyValidation-4 1.62 ± 4% 1.62 ± 4% ~ (p=0.841 n=5+5) _outputHeaders-4 0.72 ± 7% 0.73 ± 9% ~ (p=0.690 n=5+5) _requestResponseMapping-4 1.36 ± 6% 1.35 ± 5% ~ (p=0.690 n=5+5) _validation-4 1.47 ± 5% 1.47 ± 4% ~ (p=1.000 n=5+5) _noValidation-4 1.08 ± 5% 1.07 ± 7% ~ (p=0.841 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64 _directGzip-4 0.72 ± 6% 0.72 ± 7% ~ (p=1.000 n=5+5) _directGzipHead-4 0.72 ± 5% 0.73 ± 9% ~ (p=0.841 n=5+5) _noDirectGzip-4 4.17 ± 6% 4.18 ± 3% ~ (p=1.000 n=5+5) _directGzip_decode-4 10.3 ± 9% 11.4 ± 7% +10.00% (p=0.016 n=5+5) _noDirectGzip_decode-4 4.24 ± 4% 4.31 ± 7% ~ (p=1.000 n=5+5) _htmlResponse-4 1.25 ± 9% 1.29 ± 5% ~ (p=0.310 n=5+5) _jsonBodyManual-4 0.87 ± 5% 0.90 ± 2% ~ (p=0.421 n=5+5) _jsonBody-4 1.29 ± 3% 1.26 ± 3% ~ (p=0.087 n=5+5) _jsonBodyValidation-4 1.58 ± 4% 1.70 ± 9% ~ (p=0.079 n=5+5) _outputHeaders-4 1.19 ± 6% 1.18 ± 6% ~ (p=0.690 n=5+5) _requestResponseMapping-4 1.37 ± 3% 1.36 ± 4% ~ (p=0.889 n=5+5) _validation-4 1.58 ± 8% 1.51 ± 3% ~ (p=0.151 n=5+5) _noValidation-4 1.08 ± 4% 1.02 ± 3% -5.56% (p=0.032 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-4 0.81 ± 6% 0.82 ± 9% ~ (p=0.841 n=5+5) _ok-4 0.79 ± 3% 0.82 ± 4% ~ (p=0.222 n=5+5) _invalidBody-4 1.12 ±11% 1.12 ± 5% ~ (p=0.690 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.42 ± 3% 1.47 ± 5% ~ (p=0.151 n=5+5) _directGzipHead-4 1.43 ± 5% 1.52 ±11% ~ (p=0.095 n=5+5) _noDirectGzip-4 8.76 ± 5% 8.56 ± 1% ~ (p=0.310 n=5+5) _directGzip_decode-4 31.6 ± 5% 32.3 ± 4% ~ (p=0.548 n=5+5) _noDirectGzip_decode-4 8.50 ± 2% 8.74 ± 3% ~ (p=0.095 n=5+5) _jsonBody-4 3.24 ± 3% 3.30 ± 7% ~ (p=0.841 n=5+5) _jsonBodyValidation-4 3.52 ± 1% 3.62 ± 3% +2.78% (p=0.008 n=5+5) _outputHeaders-4 1.46 ± 4% 1.47 ± 3% ~ (p=0.548 n=5+5) _requestResponseMapping-4 3.18 ± 5% 3.21 ± 5% ~ (p=0.690 n=5+5) _validation-4 3.33 ± 3% 3.51 ± 2% +5.31% (p=0.008 n=5+5) _noValidation-4 2.41 ± 4% 2.36 ± 2% ~ (p=0.421 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64 _directGzip-4 1.50 ± 9% 1.51 ± 5% ~ (p=0.548 n=5+5) _directGzipHead-4 1.46 ± 4% 1.46 ± 5% ~ (p=1.000 n=5+5) _noDirectGzip-4 8.91 ± 5% 8.69 ± 5% ~ (p=0.421 n=5+5) _directGzip_decode-4 31.7 ± 8% 31.3 ± 6% ~ (p=0.690 n=5+5) _noDirectGzip_decode-4 8.65 ± 4% 8.72 ± 3% ~ (p=1.000 n=5+5) _htmlResponse-4 2.68 ± 5% 2.74 ± 5% ~ (p=0.421 n=5+5) _jsonBodyManual-4 1.83 ± 6% 1.87 ± 3% ~ (p=0.421 n=5+5) _jsonBody-4 2.88 ± 7% 2.92 ± 2% ~ (p=0.310 n=5+5) _jsonBodyValidation-4 3.76 ± 6% 3.84 ± 4% ~ (p=0.310 n=5+5) _outputHeaders-4 2.72 ± 5% 2.74 ± 5% ~ (p=0.841 n=5+5) _requestResponseMapping-4 3.17 ± 8% 3.15 ± 5% ~ (p=1.000 n=5+5) _validation-4 3.42 ± 4% 3.31 ± 2% ~ (p=0.151 n=5+5) _noValidation-4 2.46 ± 4% 2.42 ± 3% ~ (p=0.548 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-4 1.65 ± 3% 1.67 ±14% ~ (p=0.421 n=5+5) _ok-4 1.62 ± 5% 1.65 ± 4% ~ (p=0.421 n=5+5) _invalidBody-4 2.52 ±11% 2.64 ± 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-4 2.38 ± 5% 2.34 ± 3% ~ (p=0.690 n=5+5) _directGzipHead-4 2.43 ±17% 2.59 ±23% ~ (p=0.310 n=5+5) _noDirectGzip-4 13.4 ±11% 13.3 ± 3% ~ (p=0.690 n=5+5) _directGzip_decode-4 60.2 ±17% 63.5 ±10% ~ (p=0.421 n=5+5) _noDirectGzip_decode-4 13.0 ± 3% 13.3 ± 6% ~ (p=0.246 n=5+5) _jsonBody-4 5.34 ± 9% 5.18 ±13% ~ (p=0.310 n=5+5) _jsonBodyValidation-4 6.18 ± 6% 6.29 ±10% ~ (p=0.841 n=5+5) _outputHeaders-4 2.54 ± 4% 2.59 ± 6% ~ (p=0.310 n=5+5) _requestResponseMapping-4 5.86 ±11% 5.67 ± 9% ~ (p=0.690 n=5+5) _validation-4 6.18 ± 6% 6.42 ±10% ~ (p=0.548 n=5+5) _noValidation-4 4.57 ± 8% 4.36 ± 8% ~ (p=0.421 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64 _directGzip-4 2.49 ±12% 2.41 ± 3% ~ (p=0.413 n=5+4) _directGzipHead-4 2.49 ± 6% 2.59 ±17% ~ (p=0.841 n=5+5) _noDirectGzip-4 13.4 ± 5% 13.3 ± 2% ~ (p=1.000 n=5+5) _directGzip_decode-4 58.3 ± 5% 55.3 ±13% ~ (p=0.222 n=5+5) _noDirectGzip_decode-4 13.1 ± 4% 13.1 ± 7% ~ (p=0.889 n=5+5) _htmlResponse-4 4.63 ± 8% 4.70 ± 5% ~ (p=0.548 n=5+5) _jsonBodyManual-4 3.06 ± 6% 3.16 ± 9% ~ (p=0.421 n=5+5) _jsonBody-4 4.99 ±10% 4.95 ± 7% ~ (p=0.841 n=5+5) _jsonBodyValidation-4 6.59 ± 6% 6.41 ± 5% ~ (p=0.460 n=5+5) _outputHeaders-4 4.57 ± 8% 4.44 ± 4% ~ (p=0.690 n=5+5) _requestResponseMapping-4 5.15 ± 3% 5.09 ±10% ~ (p=0.690 n=5+5) _validation-4 5.37 ± 9% 5.52 ± 8% ~ (p=0.690 n=5+5) _noValidation-4 4.02 ± 5% 4.12 ± 6% ~ (p=0.421 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-4 2.81 ±10% 2.57 ± 2% ~ (p=0.111 n=5+4) _ok-4 2.70 ± 5% 2.65 ± 5% ~ (p=0.690 n=5+5) _invalidBody-4 4.35 ± 8% 4.43 ± 3% ~ (p=0.841 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.54 ±35% 4.01 ±20% ~ (p=0.421 n=5+5) _directGzipHead-4 4.97 ±78% 5.56 ±78% ~ (p=0.421 n=5+5) _noDirectGzip-4 17.4 ± 5% 16.7 ± 9% ~ (p=0.111 n=4+5) _directGzip_decode-4 83.2 ±14% 84.0 ±13% ~ (p=0.889 n=5+5) _noDirectGzip_decode-4 16.8 ± 6% 17.2 ± 6% ~ (p=0.548 n=5+5) _jsonBody-4 8.18 ±13% 8.19 ±21% ~ (p=1.000 n=5+5) _jsonBodyValidation-4 9.23 ±15% 9.80 ±18% ~ (p=0.421 n=5+5) _outputHeaders-4 4.84 ± 5% 5.36 ±22% ~ (p=0.151 n=5+5) _requestResponseMapping-4 9.24 ±11% 8.85 ± 5% ~ (p=0.841 n=5+5) _validation-4 9.70 ±11% 10.62 ±10% ~ (p=0.222 n=5+5) _noValidation-4 8.40 ±20% 7.92 ±13% ~ (p=0.690 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64 _directGzip-4 4.77 ±37% 4.64 ±35% ~ (p=0.841 n=5+5) _directGzipHead-4 4.93 ±17% 4.80 ±15% ~ (p=0.841 n=5+5) _noDirectGzip-4 18.0 ±13% 17.1 ± 7% ~ (p=0.222 n=5+5) _directGzip_decode-4 77.1 ±12% 76.5 ± 7% ~ (p=1.000 n=5+5) _noDirectGzip_decode-4 17.6 ± 6% 18.1 ± 8% ~ (p=0.421 n=5+5) _htmlResponse-4 7.91 ±19% 7.25 ± 8% ~ (p=0.222 n=5+5) _jsonBodyManual-4 6.26 ±12% 6.16 ± 7% ~ (p=1.000 n=5+5) _jsonBody-4 8.05 ±20% 8.20 ±12% ~ (p=1.000 n=5+5) _jsonBodyValidation-4 10.2 ± 7% 9.9 ± 6% ~ (p=0.548 n=5+5) _outputHeaders-4 7.61 ±18% 6.34 ± 9% -16.75% (p=0.032 n=5+5) _requestResponseMapping-4 8.02 ±11% 8.55 ±13% ~ (p=0.421 n=5+5) _validation-4 8.49 ±14% 8.17 ±16% ~ (p=0.579 n=5+5) _noValidation-4 7.18 ±18% 6.37 ±15% ~ (p=0.222 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-4 5.02 ±31% 4.01 ±13% ~ (p=0.286 n=5+4) _ok-4 4.94 ±19% 4.54 ±35% ~ (p=0.310 n=5+5) _invalidBody-4 6.19 ± 9% 7.02 ±17% ~ (p=0.095 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% ~ (p=0.444 n=5+5) _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 62.2k ± 2% 62.3k ± 1% ~ (p=0.841 n=5+5) _directGzipHead-4 62.2k ± 4% 62.5k ± 0% ~ (p=0.556 n=5+4) _noDirectGzip-4 10.9k ± 2% 11.0k ± 1% ~ (p=0.548 n=5+5) _directGzip_decode-4 3.08k ± 1% 3.09k ± 1% ~ (p=0.746 n=5+5) _noDirectGzip_decode-4 11.0k ± 0% 10.9k ± 0% -0.35% (p=0.032 n=5+5) _jsonBody-4 29.0k ± 3% 28.9k ± 2% ~ (p=0.548 n=5+5) _jsonBodyValidation-4 25.1k ± 1% 25.2k ± 1% ~ (p=0.571 n=5+5) _outputHeaders-4 61.0k ± 1% 60.4k ± 1% ~ (p=0.056 n=5+5) _requestResponseMapping-4 29.4k ± 2% 29.1k ± 1% ~ (p=0.151 n=5+5) _validation-4 27.1k ± 2% 26.9k ± 1% ~ (p=0.421 n=5+5) _noValidation-4 38.9k ± 1% 38.8k ± 1% ~ (p=0.841 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64 _directGzip-4 60.8k ± 5% 61.3k ± 0% ~ (p=0.413 n=5+4) _directGzipHead-4 61.7k ± 1% 61.5k ± 3% ~ (p=0.690 n=5+5) _noDirectGzip-4 10.8k ± 0% 10.9k ± 0% +0.73% (p=0.032 n=5+5) _directGzip_decode-4 3.08k ± 1% 3.07k ± 1% ~ (p=0.889 n=5+5) _noDirectGzip_decode-4 10.8k ± 0% 10.9k ± 1% ~ (p=0.151 n=5+5) _htmlResponse-4 34.0k ± 1% 34.1k ± 1% ~ (p=0.548 n=5+5) _jsonBodyManual-4 48.9k ± 1% 49.0k ± 1% ~ (p=0.548 n=5+5) _jsonBody-4 32.6k ± 1% 32.4k ± 1% ~ (p=0.222 n=5+5) _jsonBodyValidation-4 25.0k ± 1% 24.8k ± 2% ~ (p=0.222 n=5+5) _outputHeaders-4 34.9k ± 1% 34.7k ± 1% ~ (p=0.841 n=5+5) _requestResponseMapping-4 29.5k ± 1% 29.6k ± 1% ~ (p=0.690 n=5+5) _validation-4 27.5k ± 0% 27.5k ± 1% ~ (p=0.421 n=5+5) _noValidation-4 38.7k ± 0% 39.0k ± 2% ~ (p=0.548 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-4 53.8k ± 6% 55.1k ± 0% ~ (p=0.556 n=5+4) _ok-4 55.0k ± 1% 54.8k ± 1% ~ (p=0.548 n=5+5) _invalidBody-4 37.8k ± 4% 37.3k ± 4% ~ (p=0.421 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.86kB ± 0% 3.86kB ± 0% ~ (p=0.056 n=5+5) _directGzipHead-4 3.85kB ± 0% 3.86kB ± 0% ~ (p=0.492 n=5+5) _noDirectGzip-4 6.76kB ±23% 6.63kB ±19% ~ (p=1.000 n=5+5) _directGzip_decode-4 404kB ± 0% 404kB ± 0% ~ (p=0.794 n=5+5) _noDirectGzip_decode-4 5.97kB ± 5% 6.26kB ± 6% ~ (p=0.222 n=5+5) _jsonBody-4 13.2kB ± 0% 13.2kB ± 0% ~ (p=0.841 n=5+5) _jsonBodyValidation-4 19.0kB ± 0% 19.0kB ± 0% ~ (p=0.500 n=5+5) _outputHeaders-4 3.57kB ± 0% 3.57kB ± 0% ~ (p=0.738 n=5+5) _requestResponseMapping-4 16.7kB ± 0% 16.7kB ± 0% ~ (p=0.063 n=5+5) _validation-4 16.6kB ± 0% 16.6kB ± 0% ~ (p=0.889 n=5+5) _noValidation-4 7.79kB ± 0% 7.79kB ± 0% ~ (p=0.373 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic-openapi31 goos:linux goarch:amd64 _directGzip-4 3.87kB ± 0% 3.87kB ± 0% ~ (p=0.500 n=5+5) _directGzipHead-4 3.87kB ± 0% 3.87kB ± 0% ~ (p=0.857 n=5+5) _noDirectGzip-4 6.64kB ±21% 6.80kB ±22% ~ (p=0.841 n=5+5) _directGzip_decode-4 404kB ± 0% 404kB ± 0% ~ (p=0.310 n=5+5) _noDirectGzip_decode-4 5.90kB ±10% 6.63kB ± 9% +12.42% (p=0.032 n=5+5) _htmlResponse-4 8.07kB ± 0% 8.07kB ± 0% ~ (p=0.571 n=5+5) _jsonBodyManual-4 4.48kB ± 0% 4.48kB ± 0% ~ (p=0.984 n=5+5) _jsonBody-4 10.3kB ± 0% 10.3kB ± 0% ~ (p=0.643 n=5+5) _jsonBodyValidation-4 19.1kB ± 0% 19.1kB ± 0% ~ (p=0.476 n=5+5) _outputHeaders-4 10.4kB ± 0% 10.4kB ± 0% ~ (p=0.929 n=5+5) _requestResponseMapping-4 16.7kB ± 0% 16.7kB ± 0% ~ (p=0.595 n=5+5) _validation-4 16.6kB ± 0% 16.6kB ± 0% ~ (p=0.056 n=5+5) _noValidation-4 7.83kB ± 0% 7.82kB ± 0% ~ (p=0.690 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-4 4.65kB ± 0% 4.65kB ± 0% ~ (p=0.278 n=5+5) _ok-4 4.56kB ± 0% 4.56kB ± 0% ~ (p=0.657 n=4+4) _invalidBody-4 8.27kB ± 0% 8.28kB ± 0% ~ (p=0.886 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 504 ± 0% 503 ± 0% ~ (p=0.413 n=5+4) _noDirectGzip_decode-4 50.0 ± 0% 50.0 ± 0% ~ (all equal) _jsonBody-4 128 ± 0% 128 ± 0% ~ (all equal) _jsonBodyValidation-4 186 ± 0% 186 ± 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 504 ± 0% 505 ± 0% ~ (p=1.000 n=5+5) _noDirectGzip_decode-4 51.0 ± 0% 51.0 ± 0% ~ (all equal) _htmlResponse-4 144 ± 0% 144 ± 0% ~ (all equal) _jsonBodyManual-4 48.0 ± 0% 48.0 ± 0% ~ (all equal) _jsonBody-4 99.0 ± 0% 99.0 ± 0% ~ (all equal) _jsonBodyValidation-4 187 ± 0% 187 ± 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=1.000 n=5+5) _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 53.0 ± 0% 53.0 ± 0% ~ (all equal) _ok-4 49.0 ± 0% 49.0 ± 0% ~ (all equal) _invalidBody-4 97.0 ± 0% 97.0 ± 0% ~ (all equal) ```