swaggest / rest

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

Use custom content types in OpenAPI collector #127

Closed vearutop closed 1 year ago

vearutop commented 1 year ago

Fixes #122.

github-actions[bot] commented 1 year ago

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 105 7346 (+36) 5329 (+23) 492 (+4) 1525 (+9) 887 (+5) 177.7K (+1.2K)
Go (test) 47 5156 (+15) 3945 (+12) 185 1026 (+3) 179 143.9K (+597B)
JSON 3 1471 (+9) 1471 (+9) 0 0 0 60K (+273B)
github-actions[bot] commented 1 year ago

Unit Test Coverage

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

Coverage of changed lines | File | Function | Coverage | |--------------------------|----------------------------|----------| | Total | | 89.7% | | openapi/collector.go | | 87.5% | | openapi/collector.go:126 | setupOutput | 100.0% | | openapi/collector.go:265 | setJSONResponse | 100.0% | | openapi/collector.go:275 | processExpectedErrors | 83.3% | | openapi/collector.go:514 | ProvideResponseJSONSchemas | 66.7% | | web/service.go | | 100.0% | | web/service.go:24 | DefaultService | 100.0% |
Coverage diff with base branch | File | Function | Base Coverage | Current Coverage | |-----------------------------------------------|----------------------------|---------------|------------------| | Total | | 83.4% | 83.5% (+0.1%) | | github.com/swaggest/rest/openapi/collector.go | ProvideResponseJSONSchemas | 68.4% | 66.7% (-1.7%) | | github.com/swaggest/rest/openapi/collector.go | processExpectedErrors | 84.0% | 83.3% (-0.7%) | | github.com/swaggest/rest/openapi/collector.go | setJSONResponse | no function | 100.0% | | github.com/swaggest/rest/openapi/collector.go | setupOutput | 66.7% | 72.7% (+6.0%) |
github-actions[bot] commented 1 year ago

Go API Changes

# github.com/swaggest/rest/openapi
## compatible changes
Collector.DefaultErrorResponseContentType: added
Collector.DefaultSuccessResponseContentType: added

# summary
Inferred base version: v0.2.38
Suggested version: v0.3.0
codecov[bot] commented 1 year ago

Codecov Report

Merging #127 (7d968ba) into master (d69c5c1) will increase coverage by 0.08%. The diff coverage is 80.95%.

@@            Coverage Diff             @@
##           master     #127      +/-   ##
==========================================
+ Coverage   77.62%   77.71%   +0.08%     
==========================================
  Files          28       28              
  Lines        1493     1508      +15     
==========================================
+ Hits         1159     1172      +13     
- Misses        217      218       +1     
- Partials      117      118       +1     
Flag Coverage Δ
unittests 77.71% <80.95%> (+0.08%) :arrow_up:

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

Impacted Files Coverage Δ
openapi/collector.go 64.28% <76.47%> (+0.85%) :arrow_up:
web/service.go 100.00% <100.00%> (ø)

: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.34µs ± 4% 1.32µs ± 2% ~ (p=0.126 n=6+5) pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 701ns ± 0% 699ns ± 0% ~ (p=0.111 n=5+5) DecoderFunc_Decode-2 1.97µs ± 0% 1.98µs ± 0% +0.52% (p=0.045 n=6+6) Decoder_Decode_json-2 21.4µs ± 0% 21.8µs ± 0% +1.55% (p=0.004 n=6+5) Decoder_Decode_queryObject-2 4.57µs ± 0% 4.58µs ± 0% +0.30% (p=0.006 n=6+6) Decoder_Decode_jsonParam-2 1.76µs ± 0% 1.76µs ± 1% ~ (p=0.913 n=6+6) DecoderFactory_SetDecoderFunc-2 1.63µs ± 0% 1.63µs ± 0% ~ (p=0.667 n=4+6) pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 10.9µs ± 1% 10.9µs ± 1% ~ (p=0.931 n=6+5) Middleware_control-2 3.39µs ± 1% 3.40µs ± 2% ~ (p=1.000 n=5+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.15kB ± 4% 1.15kB ± 2% ~ (p=0.937 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.32µs ± 2% pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 699ns ± 0% DecoderFunc_Decode-2 1.98µs ± 0% Decoder_Decode_json-2 21.8µs ± 0% Decoder_Decode_queryObject-2 4.58µs ± 0% Decoder_Decode_jsonParam-2 1.76µs ± 1% DecoderFactory_SetDecoderFunc-2 1.63µs ± 0% pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 10.9µs ± 1% Middleware_control-2 3.40µs ± 2% 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 ± 2% 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 25.9µs ± 1% 28.0µs ± 1% +7.98% (p=0.029 n=4+4) _directGzipHead-2 26.2µs ± 3% 28.4µs ± 1% +8.13% (p=0.016 n=5+4) _noDirectGzip-2 143µs ± 2% 151µs ± 1% +5.76% (p=0.008 n=5+5) _directGzip_decode-2 512µs ± 3% 536µs ± 1% +4.58% (p=0.008 n=5+5) _noDirectGzip_decode-2 142µs ± 1% 152µs ± 2% +7.08% (p=0.008 n=5+5) _jsonBody-2 47.7µs ± 2% 53.0µs ± 2% +10.96% (p=0.008 n=5+5) _jsonBodyValidation-2 55.1µs ± 3% 61.6µs ± 2% +11.80% (p=0.008 n=5+5) _outputHeaders-2 26.1µs ± 4% 27.8µs ± 2% +6.61% (p=0.008 n=5+5) _requestResponseMapping-2 49.1µs ± 4% 51.7µs ± 2% +5.32% (p=0.008 n=5+5) _validation-2 53.7µs ± 3% 54.7µs ± 2% ~ (p=0.222 n=5+5) _noValidation-2 38.1µs ± 3% 40.4µs ± 1% +6.20% (p=0.008 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 27.3µs ± 3% 28.9µs ± 2% +5.69% (p=0.016 n=5+4) _directGzipHead-2 27.7µs ±16% 29.2µs ± 2% ~ (p=0.151 n=5+5) _noDirectGzip-2 144µs ± 4% 153µs ± 1% +6.10% (p=0.008 n=5+5) _directGzip_decode-2 505µs ± 3% 531µs ± 6% ~ (p=0.056 n=5+5) _noDirectGzip_decode-2 148µs ± 3% 146µs ± 2% ~ (p=0.310 n=5+5) _htmlResponse-2 44.4µs ± 1% 43.5µs ± 5% ~ (p=0.151 n=5+5) _jsonBodyManual-2 32.5µs ± 2% 33.1µs ± 2% ~ (p=0.310 n=5+5) _jsonBody-2 46.6µs ± 3% 46.5µs ± 2% ~ (p=0.841 n=5+5) _jsonBodyValidation-2 60.3µs ± 2% 60.6µs ± 5% ~ (p=0.968 n=5+5) _outputHeaders-2 28.4µs ± 2% 28.2µs ± 2% ~ (p=0.548 n=5+5) _requestResponseMapping-2 51.2µs ± 3% 51.9µs ± 3% ~ (p=0.421 n=5+5) _validation-2 54.5µs ± 3% 54.8µs ± 1% ~ (p=0.690 n=5+5) _noValidation-2 40.2µs ± 1% 40.5µs ± 2% ~ (p=0.548 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 31.9µs ± 1% 31.7µs ± 3% ~ (p=0.460 n=5+5) _ok-2 33.2µs ±16% 31.6µs ± 5% ~ (p=0.310 n=5+5) _invalidBody-2 45.4µs ± 4% 45.4µs ± 5% ~ (p=0.690 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.27 ± 5% 1.36 ± 7% ~ (p=0.056 n=5+5) _directGzipHead-2 1.23 ± 7% 1.33 ± 9% ~ (p=0.056 n=5+5) _noDirectGzip-2 6.80 ± 4% 7.09 ± 2% +4.24% (p=0.032 n=5+5) _directGzip_decode-2 20.0 ± 4% 22.0 ± 9% +9.69% (p=0.040 n=5+5) _noDirectGzip_decode-2 6.92 ± 4% 7.13 ± 3% ~ (p=0.222 n=5+5) _jsonBody-2 2.16 ± 6% 2.29 ± 8% ~ (p=0.095 n=5+5) _jsonBodyValidation-2 2.39 ± 4% 2.74 ± 1% +14.61% (p=0.008 n=5+5) _outputHeaders-2 1.19 ± 5% 1.29 ± 4% +8.38% (p=0.008 n=5+5) _requestResponseMapping-2 2.12 ± 9% 2.22 ±10% ~ (p=0.222 n=5+5) _validation-2 2.39 ± 5% 2.37 ± 4% ~ (p=1.000 n=5+5) _noValidation-2 1.73 ± 9% 1.86 ± 4% ~ (p=0.056 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 1.30 ± 7% 1.37 ± 9% ~ (p=0.222 n=5+5) _directGzipHead-2 1.27 ±15% 1.34 ± 3% ~ (p=0.151 n=5+5) _noDirectGzip-2 6.94 ± 3% 7.34 ± 5% +5.68% (p=0.032 n=5+5) _directGzip_decode-2 20.1 ±10% 21.5 ±11% ~ (p=0.222 n=5+5) _noDirectGzip_decode-2 6.91 ± 4% 6.99 ± 4% ~ (p=0.222 n=5+5) _htmlResponse-2 2.11 ± 4% 2.02 ± 6% ~ (p=0.222 n=5+5) _jsonBodyManual-2 1.52 ± 6% 1.56 ± 3% ~ (p=0.222 n=5+5) _jsonBody-2 2.10 ± 4% 2.09 ± 5% ~ (p=0.690 n=5+5) _jsonBodyValidation-2 2.63 ± 4% 2.70 ± 7% ~ (p=0.421 n=5+5) _outputHeaders-2 1.31 ± 6% 1.32 ± 6% ~ (p=0.690 n=5+5) _requestResponseMapping-2 2.21 ± 7% 2.23 ± 5% ~ (p=0.841 n=5+5) _validation-2 2.32 ± 3% 2.32 ± 2% ~ (p=1.000 n=5+5) _noValidation-2 1.82 ± 4% 1.90 ± 2% +4.66% (p=0.016 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 1.53 ± 5% 1.55 ± 5% ~ (p=1.000 n=5+5) _ok-2 1.55 ± 6% 1.51 ± 5% ~ (p=0.310 n=5+5) _invalidBody-2 1.98 ± 5% 2.07 ± 6% ~ (p=0.095 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.30 ±17% 2.37 ± 7% ~ (p=0.310 n=5+5) _directGzipHead-2 2.21 ± 3% 2.47 ± 9% +11.97% (p=0.008 n=5+5) _noDirectGzip-2 12.2 ± 3% 12.8 ± 2% +4.60% (p=0.016 n=5+5) _directGzip_decode-2 43.3 ±10% 45.3 ± 6% ~ (p=0.151 n=5+5) _noDirectGzip_decode-2 12.1 ± 4% 13.0 ± 6% +6.79% (p=0.016 n=5+5) _jsonBody-2 4.38 ± 4% 4.83 ± 4% +10.30% (p=0.008 n=5+5) _jsonBodyValidation-2 4.91 ± 5% 5.68 ± 5% +15.57% (p=0.008 n=5+5) _outputHeaders-2 2.22 ± 5% 2.30 ± 6% ~ (p=0.548 n=5+5) _requestResponseMapping-2 4.54 ± 7% 4.77 ± 5% ~ (p=0.151 n=5+5) _validation-2 5.04 ± 4% 5.05 ± 4% ~ (p=1.000 n=5+5) _noValidation-2 3.35 ± 5% 3.64 ± 5% +8.68% (p=0.016 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 2.30 ± 4% 2.46 ± 9% +6.94% (p=0.016 n=5+5) _directGzipHead-2 2.29 ± 8% 2.48 ± 4% +8.42% (p=0.032 n=5+5) _noDirectGzip-2 12.5 ± 7% 12.9 ± 1% ~ (p=0.127 n=5+5) _directGzip_decode-2 41.7 ± 3% 44.8 ±11% ~ (p=0.151 n=5+5) _noDirectGzip_decode-2 12.7 ± 2% 12.5 ± 3% ~ (p=0.310 n=5+5) _htmlResponse-2 3.93 ± 2% 3.86 ± 5% ~ (p=0.310 n=5+5) _jsonBodyManual-2 2.76 ± 6% 2.79 ± 8% ~ (p=1.000 n=5+5) _jsonBody-2 4.35 ± 8% 4.34 ± 3% ~ (p=1.000 n=5+5) _jsonBodyValidation-2 5.65 ± 4% 5.52 ± 3% ~ (p=0.421 n=5+5) _outputHeaders-2 2.35 ± 8% 2.26 ± 4% ~ (p=0.310 n=5+5) _requestResponseMapping-2 5.06 ± 9% 4.87 ± 3% ~ (p=0.310 n=5+5) _validation-2 5.22 ± 7% 5.17 ± 4% ~ (p=0.690 n=5+5) _noValidation-2 3.58 ± 2% 3.61 ± 4% ~ (p=1.000 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 2.76 ± 6% 2.73 ± 6% ~ (p=1.000 n=5+5) _ok-2 2.77 ±15% 2.72 ± 6% ~ (p=1.000 n=5+5) _invalidBody-2 4.31 ± 6% 4.19 ± 4% ~ (p=0.310 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.81 ± 3% 4.06 ± 3% +6.49% (p=0.029 n=4+4) _directGzipHead-2 4.11 ±36% 4.33 ± 4% ~ (p=0.190 n=5+4) _noDirectGzip-2 18.3 ± 2% 19.9 ± 4% +8.94% (p=0.008 n=5+5) _directGzip_decode-2 70.6 ± 9% 76.5 ± 7% ~ (p=0.151 n=5+5) _noDirectGzip_decode-2 17.6 ± 8% 19.7 ± 6% +12.21% (p=0.032 n=5+5) _jsonBody-2 7.09 ± 4% 8.02 ±13% +13.06% (p=0.008 n=5+5) _jsonBodyValidation-2 7.54 ± 7% 9.16 ±19% +21.49% (p=0.008 n=5+5) _outputHeaders-2 4.58 ±22% 4.91 ±13% ~ (p=0.151 n=5+5) _requestResponseMapping-2 7.68 ± 8% 8.16 ± 8% ~ (p=0.548 n=5+5) _validation-2 7.84 ± 9% 8.20 ± 7% ~ (p=0.222 n=5+5) _noValidation-2 6.33 ±13% 6.51 ± 6% ~ (p=0.421 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 4.02 ± 8% 4.28 ± 4% ~ (p=0.111 n=5+4) _directGzipHead-2 3.81 ± 3% 5.00 ±24% +31.34% (p=0.016 n=4+5) _noDirectGzip-2 18.5 ± 7% 20.1 ± 4% +8.71% (p=0.016 n=5+5) _directGzip_decode-2 72.7 ±19% 71.8 ± 7% ~ (p=0.841 n=5+5) _noDirectGzip_decode-2 19.0 ± 9% 19.0 ± 5% ~ (p=0.841 n=5+5) _htmlResponse-2 6.84 ± 7% 6.56 ± 9% ~ (p=0.151 n=5+5) _jsonBodyManual-2 5.19 ± 4% 5.86 ±14% ~ (p=0.222 n=5+5) _jsonBody-2 7.18 ± 5% 7.08 ± 9% ~ (p=0.548 n=5+5) _jsonBodyValidation-2 8.58 ± 6% 8.66 ±14% ~ (p=0.841 n=5+5) _outputHeaders-2 5.13 ± 6% 4.86 ± 9% ~ (p=0.310 n=5+5) _requestResponseMapping-2 7.75 ± 7% 8.39 ±25% ~ (p=0.690 n=5+5) _validation-2 8.23 ±24% 8.53 ±13% ~ (p=0.421 n=5+5) _noValidation-2 6.77 ± 5% 6.65 ± 5% ~ (p=0.690 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 4.48 ± 4% 4.37 ± 5% ~ (p=0.310 n=5+5) _ok-2 4.41 ±10% 4.53 ± 7% ~ (p=1.000 n=4+5) _invalidBody-2 8.18 ±25% 7.84 ±14% ~ (p=0.690 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.07 ±62% 9.36 ±75% ~ (p=0.690 n=5+5) _directGzipHead-2 6.76 ±52% 10.15 ±47% ~ (p=0.095 n=5+5) _noDirectGzip-2 24.8 ±23% 24.5 ±19% ~ (p=0.548 n=5+5) _directGzip_decode-2 90.6 ±19% 98.5 ±21% ~ (p=0.952 n=5+5) _noDirectGzip_decode-2 24.0 ±27% 24.3 ±13% ~ (p=0.508 n=5+5) _jsonBody-2 11.7 ±22% 12.4 ±25% ~ (p=0.548 n=5+5) _jsonBodyValidation-2 12.6 ±55% 14.7 ±16% ~ (p=0.151 n=5+5) _outputHeaders-2 10.5 ±23% 9.6 ±23% ~ (p=0.151 n=5+5) _requestResponseMapping-2 14.5 ±27% 15.7 ±32% ~ (p=0.421 n=5+5) _validation-2 15.0 ±53% 12.2 ±17% ~ (p=0.421 n=5+5) _noValidation-2 14.3 ±64% 12.6 ±29% ~ (p=0.841 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 7.96 ±26% 8.51 ±121% ~ (p=0.222 n=5+5) _directGzipHead-2 7.87 ±107% 9.40 ±33% ~ (p=0.310 n=5+5) _noDirectGzip-2 25.4 ±50% 23.6 ±16% ~ (p=1.000 n=5+5) _directGzip_decode-2 88.4 ±12% 89.4 ±11% ~ (p=1.000 n=5+5) _noDirectGzip_decode-2 21.4 ± 4% 24.0 ±17% ~ (p=0.222 n=5+5) _htmlResponse-2 11.3 ±32% 11.6 ±25% ~ (p=1.000 n=5+5) _jsonBodyManual-2 10.5 ±25% 12.0 ±32% ~ (p=0.548 n=5+5) _jsonBody-2 11.2 ±18% 11.3 ±25% ~ (p=1.000 n=5+5) _jsonBodyValidation-2 12.9 ±26% 13.8 ±10% ~ (p=0.690 n=5+5) _outputHeaders-2 11.6 ±30% 10.6 ±35% ~ (p=0.690 n=5+5) _requestResponseMapping-2 12.9 ±26% 13.3 ±28% ~ (p=0.841 n=5+5) _validation-2 11.5 ±25% 16.8 ±50% ~ (p=0.151 n=5+5) _noValidation-2 12.7 ± 6% 10.5 ±10% -17.52% (p=0.008 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 6.77 ±16% 7.22 ±35% ~ (p=0.841 n=5+5) _ok-2 9.95 ±84% 9.43 ±45% ~ (p=0.841 n=5+5) _invalidBody-2 14.5 ±86% 13.5 ±37% ~ (p=0.690 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 624 ± 0% 630 ± 0% +0.96% (p=0.008 n=5+5) _directGzipHead-2 168 ± 0% 174 ± 0% +3.57% (p=0.008 n=5+5) _noDirectGzip-2 1.03k ± 0% 1.03k ± 0% +0.58% (p=0.008 n=5+5) _directGzip_decode-2 624 ± 0% 630 ± 0% +0.96% (p=0.008 n=5+5) _noDirectGzip_decode-2 1.03k ± 0% 1.03k ± 0% +0.58% (p=0.008 n=5+5) _jsonBody-2 193 ± 0% 199 ± 0% +3.11% (p=0.008 n=5+5) _jsonBodyValidation-2 179 ± 0% 185 ± 0% +3.35% (p=0.008 n=5+5) _outputHeaders-2 140 ± 0% 146 ± 0% +4.29% (p=0.008 n=5+5) _requestResponseMapping-2 94.0 ± 0% 94.0 ± 0% ~ (all equal) _validation-2 162 ± 0% 168 ± 0% +3.70% (p=0.008 n=5+5) _noValidation-2 162 ± 0% 168 ± 0% +3.70% (p=0.008 n=5+5) 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 370 ± 0% 355 ± 0% -4.05% (p=0.008 n=5+5) _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 154 ± 0% 154 ± 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 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/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.1k ±16% 35.7k ± 1% ~ (p=0.190 n=5+4) _directGzipHead-2 38.1k ± 3% 34.5k ± 8% -9.46% (p=0.008 n=5+5) _noDirectGzip-2 7.00k ± 2% 6.62k ± 1% -5.44% (p=0.008 n=5+5) _directGzip_decode-2 1.95k ± 3% 1.87k ± 1% -4.42% (p=0.008 n=5+5) _noDirectGzip_decode-2 7.06k ± 1% 6.59k ± 2% -6.68% (p=0.008 n=5+5) _jsonBody-2 21.0k ± 2% 18.9k ± 2% -9.88% (p=0.008 n=5+5) _jsonBodyValidation-2 18.2k ± 3% 16.2k ± 2% -10.59% (p=0.008 n=5+5) _outputHeaders-2 38.4k ± 4% 36.0k ± 1% -6.23% (p=0.008 n=5+5) _requestResponseMapping-2 20.4k ± 4% 19.4k ± 2% -5.06% (p=0.008 n=5+5) _validation-2 18.6k ± 3% 18.3k ± 2% ~ (p=0.222 n=5+5) _noValidation-2 26.3k ± 3% 24.7k ± 1% -5.86% (p=0.008 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 36.6k ± 3% 34.7k ± 2% -5.41% (p=0.016 n=5+4) _directGzipHead-2 36.3k ±14% 34.2k ± 2% ~ (p=0.151 n=5+5) _noDirectGzip-2 6.95k ± 3% 6.55k ± 1% -5.79% (p=0.008 n=5+5) _directGzip_decode-2 1.98k ± 3% 1.88k ± 7% ~ (p=0.056 n=5+5) _noDirectGzip_decode-2 6.78k ± 3% 6.86k ± 2% ~ (p=0.310 n=5+5) _htmlResponse-2 22.5k ± 1% 23.0k ± 5% ~ (p=0.151 n=5+5) _jsonBodyManual-2 30.8k ± 2% 30.2k ± 2% ~ (p=0.310 n=5+5) _jsonBody-2 21.5k ± 3% 21.5k ± 2% ~ (p=0.841 n=5+5) _jsonBodyValidation-2 16.6k ± 2% 16.5k ± 5% ~ (p=0.968 n=5+5) _outputHeaders-2 35.2k ± 2% 35.5k ± 2% ~ (p=0.548 n=5+5) _requestResponseMapping-2 19.5k ± 3% 19.3k ± 3% ~ (p=0.421 n=5+5) _validation-2 18.3k ± 3% 18.2k ± 1% ~ (p=0.690 n=5+5) _noValidation-2 24.8k ± 1% 24.7k ± 2% ~ (p=0.548 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 31.3k ± 1% 31.6k ± 3% ~ (p=0.421 n=5+5) _ok-2 30.3k ±15% 31.6k ± 5% ~ (p=0.310 n=5+5) _invalidBody-2 22.1k ± 4% 22.0k ± 5% ~ (p=0.690 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.94kB ± 0% 3.94kB ± 0% ~ (p=0.079 n=5+4) _directGzipHead-2 3.94kB ± 0% 3.94kB ± 0% ~ (p=0.508 n=5+5) _noDirectGzip-2 6.89kB ±19% 7.18kB ±17% ~ (p=0.421 n=5+5) _directGzip_decode-2 403kB ± 0% 403kB ± 0% ~ (p=0.389 n=5+5) _noDirectGzip_decode-2 6.21kB ± 4% 5.79kB ± 5% -6.68% (p=0.032 n=5+5) _jsonBody-2 13.2kB ± 0% 13.3kB ± 0% +0.04% (p=0.024 n=5+5) _jsonBodyValidation-2 19.0kB ± 0% 19.0kB ± 0% ~ (p=0.373 n=5+5) _outputHeaders-2 3.71kB ± 0% 3.72kB ± 0% +0.08% (p=0.016 n=5+5) _requestResponseMapping-2 16.7kB ± 0% 16.7kB ± 0% ~ (p=0.762 n=5+5) _validation-2 16.6kB ± 0% 16.6kB ± 0% ~ (p=0.667 n=5+5) _noValidation-2 7.89kB ± 0% 7.90kB ± 0% ~ (p=0.413 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 3.99kB ± 0% 3.99kB ± 0% ~ (p=0.175 n=5+5) _directGzipHead-2 3.99kB ± 0% 3.99kB ± 0% ~ (p=0.524 n=5+5) _noDirectGzip-2 7.02kB ±17% 6.96kB ±19% ~ (p=1.000 n=5+5) _directGzip_decode-2 403kB ± 0% 403kB ± 0% -0.03% (p=0.016 n=5+5) _noDirectGzip_decode-2 6.14kB ± 4% 5.96kB ± 9% ~ (p=0.421 n=5+5) _htmlResponse-2 8.26kB ± 0% 8.29kB ± 0% +0.40% (p=0.008 n=5+5) _jsonBodyManual-2 4.65kB ± 0% 4.65kB ± 0% ~ (p=0.556 n=5+4) _jsonBody-2 10.4kB ± 0% 10.4kB ± 0% ~ (p=0.468 n=5+5) _jsonBodyValidation-2 19.1kB ± 0% 19.1kB ± 0% ~ (p=0.889 n=5+5) _outputHeaders-2 3.75kB ± 0% 3.75kB ± 0% ~ (p=1.000 n=5+5) _requestResponseMapping-2 16.8kB ± 0% 16.8kB ± 0% ~ (p=0.230 n=5+5) _validation-2 16.7kB ± 0% 16.7kB ± 0% ~ (p=0.540 n=5+5) _noValidation-2 7.96kB ± 0% 7.96kB ± 0% ~ (p=0.286 n=5+4) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 4.89kB ± 0% 4.89kB ± 0% +0.04% (p=0.016 n=5+4) _ok-2 4.80kB ± 0% 4.79kB ± 0% ~ (p=0.914 n=4+4) _invalidBody-2 8.64kB ± 0% 8.63kB ± 0% ~ (p=0.629 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.8 ± 4% 49.8 ± 4% ~ (p=1.000 n=5+5) _directGzip_decode-2 502 ± 0% 502 ± 0% ~ (p=1.000 n=5+5) _noDirectGzip_decode-2 50.0 ± 0% 50.0 ± 0% ~ (all equal) _jsonBody-2 130 ± 0% 130 ± 0% ~ (all equal) _jsonBodyValidation-2 186 ± 0% 186 ± 0% ~ (all equal) _outputHeaders-2 37.0 ± 0% 37.0 ± 0% ~ (all equal) _requestResponseMapping-2 126 ± 0% 126 ± 0% ~ (all equal) _validation-2 155 ± 0% 155 ± 0% ~ (all equal) _noValidation-2 92.0 ± 0% 92.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 505 ± 0% 504 ± 0% ~ (p=0.079 n=5+5) _noDirectGzip_decode-2 52.0 ± 0% 52.0 ± 0% ~ (all equal) _htmlResponse-2 145 ± 0% 146 ± 0% +0.69% (p=0.008 n=5+5) _jsonBodyManual-2 51.0 ± 0% 51.0 ± 0% ~ (all equal) _jsonBody-2 102 ± 0% 102 ± 0% ~ (all equal) _jsonBodyValidation-2 188 ± 0% 188 ± 0% ~ (all equal) _outputHeaders-2 38.0 ± 0% 38.0 ± 0% ~ (all equal) _requestResponseMapping-2 128 ± 0% 128 ± 0% ~ (all equal) _validation-2 157 ± 0% 157 ± 0% ~ (all equal) _noValidation-2 94.0 ± 0% 94.0 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 54.0 ± 0% 54.0 ± 0% ~ (all equal) _ok-2 50.0 ± 0% 50.0 ± 0% ~ (all equal) _invalidBody-2 99.0 ± 0% 99.0 ± 0% ~ (all equal) ```