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

Add support for gorilla/mux #165

Closed vearutop closed 11 months ago

vearutop commented 11 months ago

This PR reduces direct dependency on openapi3 package to prepare for the future inclusion of openapi31.

Instrumentation for gorilla/mux is built on-top of improved API.

github-actions[bot] commented 11 months ago

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 109 (+3) 7983 (+223) 5784 (+134) 548 (+44) 1651 (+45) 971 (+4) 193.8K (+5.7K)
Go (test) 53 (+4) 6321 (+637) 4846 (+441) 290 (+103) 1185 (+93) 186 (+4) 174.1K (+16.3K)
JSON 3 1575 (-15) 1575 (-15) 0 0 0 65.8K (-451B)
Markdown 6 544 (+4) 414 (+2) 0 130 (+2) 0 18.4K (+154B)
YAML 10 736 (+5) 631 (+5) 46 59 0 23K (+81B)
github-actions[bot] commented 11 months ago

Go API Changes

# github.com/swaggest/rest
## compatible changes
HandlerTrait.OpenAPIAnnotations: added

# github.com/swaggest/rest/gorillamux
## compatible changes
package added

# github.com/swaggest/rest/nethttp
## compatible changes
AnnotateOpenAPIOperation: added
Handler.OpenAPIAnnotations: added
OpenAPIAnnotationsMiddleware: added

# github.com/swaggest/rest/openapi
## compatible changes
(*Collector).AnnotateOperation: added
(*Collector).CollectOperation: added
(*Collector).CollectUseCase: added
(*Collector).HasAnnotation: added
(*Collector).Refl: added
(*Collector).SpecSchema: added
NewCollector: added

# github.com/swaggest/rest/web
## compatible changes
(*Service).OpenAPIReflector: added
(*Service).OpenAPISchema: added

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

Unit Test Coverage

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

Coverage of changed lines | File | Function | Coverage | |-------------------------------|------------------------------|----------| | Total | | 69.5% | | gorillamux/collector.go | | 86.0% | | gorillamux/collector.go:31 | NewOpenAPICollector | 100.0% | | gorillamux/collector.go:95 | collect | 93.8% | | gorillamux/collector.go:51 | Walker | 86.2% | | gorillamux/path_decoder.go | | 100.0% | | gorillamux/path_decoder.go:11 | PathToURLValues | 100.0% | | jsonschema/validator.go | | 75.0% | | jsonschema/validator.go:166 | ValidateJSONBody | 100.0% | | nethttp/handler.go | | 100.0% | | nethttp/handler.go:17 | NewHandler | 100.0% | | nethttp/openapi.go | | 100.0% | | nethttp/openapi.go:13 | OpenAPIMiddleware | 100.0% | | nethttp/openapi.go:151 | OpenAPIAnnotationsMiddleware | 100.0% | | nethttp/openapi.go:174 | securityMiddleware | 100.0% | | nethttp/options.go | | 72.7% | | nethttp/options.go:57 | RequestBodyContent | 100.0% | | nethttp/options.go:40 | AnnotateOperation | 90.9% | | nethttp/options.go:31 | AnnotateOpenAPIOperation | 0.0% | | openapi/collector.go | | 60.2% | | openapi/collector.go:60 | SpecSchema | 100.0% | | openapi/collector.go:330 | setupInput | 100.0% | | openapi/collector.go:340 | setFieldMapping | 100.0% | | openapi/collector.go:350 | processUseCase | 100.0% | | openapi/collector.go:412 | setOCJSONResponse | 100.0% | | openapi/collector.go:421 | processOCExpectedErrors | 100.0% | | openapi/collector.go:565 | ServeHTTP | 100.0% | | openapi/collector.go:514 | ProvideResponseJSONSchemas | 98.1% | | openapi/collector.go:278 | setupOutput | 94.0% | | openapi/collector.go:224 | Collect | 92.4% | | openapi/collector.go:485 | ProvideRequestJSONSchemas | 81.6% | | openapi/collector.go:537 | jsonSchemaCallback | 77.8% | | openapi/collector.go:74 | Reflector | 75.0% | | openapi/collector.go:65 | Refl | 71.4% | | openapi/collector.go:460 | combineOCErrors | 71.4% | | openapi/collector.go:47 | NewCollector | 0.0% | | openapi/collector.go:102 | AnnotateOperation | 0.0% | | openapi/collector.go:114 | HasAnnotation | 0.0% | | openapi/collector.go:123 | CollectOperation | 0.0% | | openapi/collector.go:165 | CollectUseCase | 0.0% | | request/factory.go | | 100.0% | | request/factory.go:98 | MakeDecoder | 100.0% | | web/service.go | | 75.0% | | web/service.go:25 | DefaultService | 100.0% | | web/service.go:105 | OpenAPISchema | 0.0% | | web/service.go:110 | OpenAPIReflector | 0.0% |
Coverage diff with base branch | File | Function | Base Coverage | Current Coverage | |-----------------------------------------------------|------------------------------|---------------|------------------| | Total | | 83.6% | 82.4% (-1.2%) | | github.com/swaggest/rest/gorillamux/collector.go | NewOpenAPICollector | no function | 100.0% | | github.com/swaggest/rest/gorillamux/collector.go | Walker | no function | 81.0% | | github.com/swaggest/rest/gorillamux/collector.go | collect | no function | 90.0% | | github.com/swaggest/rest/gorillamux/path_decoder.go | PathToURLValues | no function | 100.0% | | github.com/swaggest/rest/nethttp/handler.go | NewHandler | 83.3% | 87.5% (+4.2%) | | github.com/swaggest/rest/nethttp/openapi.go | AnnotateOpenAPI | 100.0% | 0.0% (-100.0%) | | github.com/swaggest/rest/nethttp/openapi.go | OpenAPIAnnotationsMiddleware | no function | 100.0% | | github.com/swaggest/rest/nethttp/options.go | AnnotateOpenAPIOperation | no function | 0.0% | | github.com/swaggest/rest/nethttp/options.go | AnnotateOperation | 100.0% | 85.7% (-14.3%) | | github.com/swaggest/rest/openapi/collector.go | AnnotateOperation | no function | 0.0% | | github.com/swaggest/rest/openapi/collector.go | Collect | 70.4% | 66.7% (-3.7%) | | github.com/swaggest/rest/openapi/collector.go | CollectOperation | no function | 0.0% | | github.com/swaggest/rest/openapi/collector.go | CollectUseCase | no function | 0.0% | | github.com/swaggest/rest/openapi/collector.go | HasAnnotation | no function | 0.0% | | github.com/swaggest/rest/openapi/collector.go | NewCollector | no function | 0.0% | | github.com/swaggest/rest/openapi/collector.go | ProvideRequestJSONSchemas | 53.8% | 75.0% (+21.2%) | | github.com/swaggest/rest/openapi/collector.go | ProvideResponseJSONSchemas | 66.7% | 90.0% (+23.3%) | | github.com/swaggest/rest/openapi/collector.go | Refl | no function | 66.7% | | github.com/swaggest/rest/openapi/collector.go | Reflector | 100.0% | 80.0% (-20.0%) | | github.com/swaggest/rest/openapi/collector.go | SpecSchema | no function | 100.0% | | github.com/swaggest/rest/openapi/collector.go | combineErrors | 72.7% | no function | | github.com/swaggest/rest/openapi/collector.go | combineOCErrors | no function | 75.0% | | github.com/swaggest/rest/openapi/collector.go | jsonSchemaCallback | no function | 78.6% | | github.com/swaggest/rest/openapi/collector.go | paramSchema | 60.0% | no function | | github.com/swaggest/rest/openapi/collector.go | processExpectedErrors | 87.5% | no function | | github.com/swaggest/rest/openapi/collector.go | processOCExpectedErrors | no function | 93.3% | | github.com/swaggest/rest/openapi/collector.go | provideFormDataSchemas | 0.0% | no function | | github.com/swaggest/rest/openapi/collector.go | provideHeaderSchemas | 68.4% | no function | | github.com/swaggest/rest/openapi/collector.go | provideParametersJSONSchemas | 63.0% | no function | | github.com/swaggest/rest/openapi/collector.go | setFieldMapping | no function | 100.0% | | github.com/swaggest/rest/openapi/collector.go | setJSONResponse | 100.0% | no function | | github.com/swaggest/rest/openapi/collector.go | setOCJSONResponse | no function | 100.0% | | github.com/swaggest/rest/openapi/collector.go | setRequestMapping | 100.0% | no function | | github.com/swaggest/rest/openapi/collector.go | setupInput | 87.5% | 100.0% (+12.5%) | | github.com/swaggest/rest/openapi/collector.go | setupOutput | 74.1% | 92.0% (+17.9%) | | github.com/swaggest/rest/web/service.go | OpenAPIReflector | no function | 0.0% | | github.com/swaggest/rest/web/service.go | OpenAPISchema | no function | 0.0% |
codecov[bot] commented 11 months ago

Codecov Report

Merging #165 (319f296) into master (18f55a4) will decrease coverage by 0.29%. The diff coverage is 65.49%.

@@            Coverage Diff             @@
##           master     #165      +/-   ##
==========================================
- Coverage   77.91%   77.62%   -0.29%     
==========================================
  Files          28       30       +2     
  Lines        1639     1676      +37     
==========================================
+ Hits         1277     1301      +24     
- Misses        239      268      +29     
+ Partials      123      107      -16     
Flag Coverage Δ
unittests 77.62% <65.49%> (-0.29%) :arrow_down:

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

Files Changed Coverage Δ
jsonschema/validator.go 80.19% <0.00%> (ø)
trait.go 85.18% <ø> (ø)
openapi/collector.go 62.74% <55.41%> (-0.26%) :arrow_down:
web/service.go 95.45% <60.00%> (-4.55%) :arrow_down:
nethttp/options.go 84.00% <72.72%> (-4.89%) :arrow_down:
gorillamux/collector.go 78.18% <78.18%> (ø)
gorillamux/path_decoder.go 100.00% <100.00%> (ø)
nethttp/handler.go 85.22% <100.00%> (ø)
nethttp/openapi.go 80.72% <100.00%> (-13.49%) :arrow_down:
request/factory.go 89.36% <100.00%> (ø)

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

github-actions[bot] commented 11 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-2 1.76µs ± 6% 1.73µs ± 3% ~ (p=0.662 n=6+5) pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 909ns ± 3% 910ns ± 3% ~ (p=0.818 n=6+6) DecoderFunc_Decode-2 2.56µs ± 2% 2.61µs ± 3% ~ (p=0.193 n=6+6) Decoder_Decode_json-2 28.4µs ± 3% 28.9µs ± 3% ~ (p=0.310 n=6+6) Decoder_Decode_queryObject-2 6.18µs ± 0% 6.26µs ± 2% ~ (p=0.114 n=4+6) Decoder_Decode_jsonParam-2 2.32µs ± 2% 2.31µs ± 3% ~ (p=0.463 n=6+6) DecoderFactory_SetDecoderFunc-2 2.17µs ± 3% 2.17µs ± 4% ~ (p=1.000 n=6+6) pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 13.8µs ± 2% 13.8µs ± 2% ~ (p=0.589 n=6+6) Middleware_control-2 4.53µs ± 5% 4.71µs ± 4% ~ (p=0.180 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.15kB ± 2% 1.14kB ± 2% ~ (p=0.413 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.73µs ± 3% pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 910ns ± 3% DecoderFunc_Decode-2 2.61µs ± 3% Decoder_Decode_json-2 28.9µs ± 3% Decoder_Decode_queryObject-2 6.26µs ± 2% Decoder_Decode_jsonParam-2 2.31µs ± 3% DecoderFactory_SetDecoderFunc-2 2.17µs ± 4% pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 13.8µs ± 2% Middleware_control-2 4.71µs ± 4% 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.14kB ± 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 11 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-2 27.2µs ±20% 26.9µs ±14% ~ (p=1.000 n=5+5) _directGzipHead-2 26.9µs ± 2% 27.2µs ± 2% ~ (p=0.421 n=5+5) _noDirectGzip-2 136µs ± 2% 139µs ± 2% ~ (p=0.310 n=5+5) _directGzip_decode-2 534µs ± 7% 525µs ± 3% ~ (p=0.421 n=5+5) _noDirectGzip_decode-2 140µs ± 1% 140µs ± 0% ~ (p=0.690 n=5+5) _jsonBody-2 51.7µs ± 8% 54.1µs ± 5% ~ (p=0.095 n=5+5) _jsonBodyValidation-2 61.5µs ± 5% 65.4µs ± 2% +6.33% (p=0.008 n=5+5) _outputHeaders-2 26.7µs ± 3% 26.9µs ± 4% ~ (p=1.000 n=5+5) _requestResponseMapping-2 56.2µs ± 3% 57.7µs ± 2% ~ (p=0.421 n=5+5) _validation-2 57.0µs ± 2% 58.9µs ± 4% ~ (p=0.056 n=5+5) _noValidation-2 41.6µs ± 3% 43.4µs ±15% ~ (p=0.548 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 27.4µs ± 4% 26.5µs ± 4% ~ (p=0.095 n=5+5) _directGzipHead-2 26.7µs ± 3% 28.1µs ±10% ~ (p=0.056 n=5+5) _noDirectGzip-2 134µs ± 2% 133µs ± 2% ~ (p=1.000 n=5+5) _directGzip_decode-2 520µs ± 4% 499µs ± 3% -4.04% (p=0.016 n=5+5) _noDirectGzip_decode-2 137µs ± 2% 135µs ± 4% ~ (p=0.310 n=5+5) _htmlResponse-2 45.5µs ± 1% 45.5µs ± 4% ~ (p=0.548 n=5+5) _jsonBodyManual-2 32.6µs ± 2% 32.9µs ± 5% ~ (p=1.000 n=5+5) _jsonBody-2 47.3µs ± 4% 48.9µs ± 4% ~ (p=0.151 n=5+5) _jsonBodyValidation-2 66.5µs ± 6% 65.1µs ± 4% ~ (p=0.310 n=5+5) _outputHeaders-2 46.5µs ± 3% 47.7µs ± 3% ~ (p=0.222 n=5+5) _requestResponseMapping-2 56.7µs ± 4% 56.4µs ± 3% ~ (p=0.841 n=5+5) _validation-2 61.4µs ± 2% 60.6µs ± 6% ~ (p=1.000 n=5+5) _noValidation-2 41.8µs ± 4% 41.6µs ± 6% ~ (p=0.841 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 31.1µs ±10% 30.9µs ±14% ~ (p=0.841 n=5+5) _ok-2 28.6µs ± 2% 29.1µs ± 4% ~ (p=0.222 n=5+5) _invalidBody-2 45.4µs ± 1% 44.1µs ± 7% ~ (p=0.095 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.20 ± 6% 1.23 ± 7% ~ (p=0.690 n=5+5) _directGzipHead-2 1.28 ± 5% 1.23 ± 5% ~ (p=0.310 n=5+5) _noDirectGzip-2 6.72 ± 8% 6.61 ± 6% ~ (p=0.690 n=5+5) _directGzip_decode-2 19.9 ± 9% 20.9 ± 9% ~ (p=0.421 n=5+5) _noDirectGzip_decode-2 6.73 ± 3% 6.93 ± 5% ~ (p=0.222 n=5+5) _jsonBody-2 2.33 ± 8% 2.44 ± 6% ~ (p=0.151 n=5+5) _jsonBodyValidation-2 2.84 ± 7% 3.04 ± 2% +7.16% (p=0.008 n=5+5) _outputHeaders-2 1.22 ± 6% 1.22 ± 4% ~ (p=0.841 n=5+5) _requestResponseMapping-2 2.55 ± 2% 2.65 ± 6% ~ (p=0.310 n=5+5) _validation-2 2.58 ± 5% 2.56 ± 7% ~ (p=0.690 n=5+5) _noValidation-2 1.71 ± 0% 1.84 ±12% ~ (p=0.111 n=4+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 1.26 ± 6% 1.25 ± 2% ~ (p=0.690 n=5+5) _directGzipHead-2 1.26 ± 5% 1.26 ± 7% ~ (p=1.000 n=5+5) _noDirectGzip-2 6.45 ± 4% 6.48 ± 5% ~ (p=0.841 n=5+5) _directGzip_decode-2 20.2 ± 6% 19.5 ±13% ~ (p=0.222 n=5+5) _noDirectGzip_decode-2 6.50 ± 3% 6.56 ± 8% ~ (p=0.222 n=5+5) _htmlResponse-2 2.03 ± 7% 2.00 ± 6% ~ (p=0.690 n=5+5) _jsonBodyManual-2 1.48 ± 5% 1.54 ±12% ~ (p=0.310 n=5+5) _jsonBody-2 2.04 ± 6% 2.14 ± 5% ~ (p=0.151 n=5+5) _jsonBodyValidation-2 2.97 ± 6% 2.91 ± 9% ~ (p=0.690 n=5+5) _outputHeaders-2 1.95 ± 5% 2.01 ± 4% ~ (p=0.222 n=5+5) _requestResponseMapping-2 2.33 ± 4% 2.48 ± 9% +6.51% (p=0.032 n=5+5) _validation-2 2.60 ± 3% 2.60 ±11% ~ (p=0.690 n=5+5) _noValidation-2 1.81 ± 7% 1.88 ± 6% ~ (p=0.206 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 1.42 ± 2% 1.43 ± 5% ~ (p=1.000 n=5+5) _ok-2 1.33 ± 6% 1.35 ± 6% ~ (p=0.690 n=5+5) _invalidBody-2 1.94 ± 4% 1.87 ± 3% ~ (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.25 ± 8% 2.21 ± 8% ~ (p=0.421 n=5+5) _directGzipHead-2 2.30 ± 6% 2.27 ± 3% ~ (p=0.841 n=5+5) _noDirectGzip-2 11.7 ± 9% 11.8 ± 7% ~ (p=0.548 n=5+5) _directGzip_decode-2 45.7 ±15% 44.1 ±10% ~ (p=0.690 n=5+5) _noDirectGzip_decode-2 12.0 ± 1% 11.8 ± 2% ~ (p=0.095 n=5+5) _jsonBody-2 4.67 ± 5% 4.95 ± 7% ~ (p=0.095 n=5+5) _jsonBodyValidation-2 5.34 ± 6% 5.71 ± 3% +7.08% (p=0.008 n=5+5) _outputHeaders-2 2.31 ± 5% 2.20 ± 5% ~ (p=0.063 n=5+5) _requestResponseMapping-2 5.01 ± 5% 5.30 ± 6% ~ (p=0.151 n=5+5) _validation-2 5.03 ± 4% 5.20 ± 6% ~ (p=0.222 n=5+5) _noValidation-2 4.05 ± 5% 4.10 ±13% ~ (p=1.000 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 2.39 ± 5% 2.29 ± 6% ~ (p=0.095 n=5+5) _directGzipHead-2 2.29 ± 2% 2.31 ± 4% ~ (p=0.421 n=5+5) _noDirectGzip-2 11.4 ± 4% 11.5 ± 3% ~ (p=0.548 n=5+5) _directGzip_decode-2 44.0 ± 6% 42.7 ± 7% ~ (p=0.421 n=5+5) _noDirectGzip_decode-2 11.7 ± 4% 11.6 ± 3% ~ (p=0.333 n=5+5) _htmlResponse-2 4.16 ± 4% 4.25 ± 7% ~ (p=0.421 n=5+5) _jsonBodyManual-2 2.78 ± 2% 2.80 ± 6% ~ (p=0.841 n=5+5) _jsonBody-2 4.65 ± 6% 4.56 ± 4% ~ (p=0.690 n=5+5) _jsonBodyValidation-2 5.84 ± 7% 5.85 ± 7% ~ (p=1.000 n=5+5) _outputHeaders-2 4.62 ±11% 4.73 ± 5% ~ (p=0.548 n=5+5) _requestResponseMapping-2 5.31 ± 8% 5.16 ± 3% ~ (p=0.690 n=5+5) _validation-2 5.70 ± 2% 5.57 ± 5% ~ (p=0.310 n=5+5) _noValidation-2 4.09 ± 4% 4.04 ± 4% ~ (p=0.548 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 2.64 ± 6% 2.67 ± 4% ~ (p=0.690 n=5+5) _ok-2 2.47 ± 5% 2.53 ± 7% ~ (p=0.548 n=5+5) _invalidBody-2 4.48 ± 5% 4.33 ± 7% ~ (p=0.460 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.90 ± 8% 3.94 ± 9% ~ (p=1.000 n=4+4) _directGzipHead-2 4.51 ±21% 4.93 ±41% ~ (p=0.690 n=5+5) _noDirectGzip-2 16.2 ±12% 17.2 ± 8% ~ (p=0.310 n=5+5) _directGzip_decode-2 77.9 ±10% 69.9 ± 8% ~ (p=0.095 n=5+5) _noDirectGzip_decode-2 16.8 ± 8% 16.8 ± 4% ~ (p=0.690 n=5+5) _jsonBody-2 7.09 ±10% 7.44 ± 6% ~ (p=0.222 n=5+5) _jsonBodyValidation-2 7.81 ± 7% 8.17 ±11% ~ (p=0.548 n=5+5) _outputHeaders-2 4.52 ±15% 4.57 ±15% ~ (p=1.000 n=5+5) _requestResponseMapping-2 8.93 ±23% 8.69 ±36% ~ (p=1.000 n=5+5) _validation-2 7.79 ± 7% 8.53 ±11% ~ (p=0.056 n=5+5) _noValidation-2 7.22 ±15% 8.02 ±63% ~ (p=1.000 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 4.29 ± 9% 4.08 ± 7% ~ (p=0.286 n=4+5) _directGzipHead-2 4.22 ± 5% 6.09 ±74% ~ (p=0.151 n=5+5) _noDirectGzip-2 15.9 ± 4% 15.9 ± 3% ~ (p=0.841 n=5+5) _directGzip_decode-2 73.6 ± 8% 69.1 ± 8% ~ (p=0.222 n=5+5) _noDirectGzip_decode-2 16.9 ± 3% 16.3 ± 5% ~ (p=0.222 n=5+5) _htmlResponse-2 7.03 ±12% 6.99 ±10% ~ (p=0.841 n=5+5) _jsonBodyManual-2 5.39 ± 8% 5.50 ±11% ~ (p=0.690 n=5+5) _jsonBody-2 7.17 ± 9% 7.54 ± 8% ~ (p=0.222 n=5+5) _jsonBodyValidation-2 9.33 ±17% 9.59 ± 9% ~ (p=0.421 n=5+5) _outputHeaders-2 7.76 ±16% 7.54 ± 5% ~ (p=0.690 n=5+5) _requestResponseMapping-2 9.09 ±17% 8.67 ±15% ~ (p=0.548 n=5+5) _validation-2 9.32 ±24% 8.66 ±10% ~ (p=0.421 n=5+5) _noValidation-2 6.90 ± 8% 6.96 ± 9% ~ (p=1.000 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 6.17 ±75% 4.10 ± 3% ~ (p=0.413 n=5+4) _ok-2 4.24 ± 3% 4.53 ±12% ~ (p=0.151 n=5+5) _invalidBody-2 7.95 ± 8% 7.76 ±24% ~ (p=1.000 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 11.6 ±111% 8.6 ±70% ~ (p=0.548 n=5+5) _directGzipHead-2 9.38 ±46% 11.11 ±23% ~ (p=0.421 n=5+5) _noDirectGzip-2 21.7 ±14% 21.6 ± 8% ~ (p=1.000 n=5+5) _directGzip_decode-2 105 ±23% 89 ± 8% -14.83% (p=0.032 n=5+5) _noDirectGzip_decode-2 21.6 ± 5% 22.3 ±17% ~ (p=1.000 n=5+5) _jsonBody-2 12.5 ±18% 12.2 ±44% ~ (p=0.690 n=5+5) _jsonBodyValidation-2 12.2 ±25% 12.5 ±26% ~ (p=1.000 n=5+5) _outputHeaders-2 10.7 ±49% 11.3 ±32% ~ (p=0.841 n=5+5) _requestResponseMapping-2 14.5 ±32% 14.1 ±36% ~ (p=0.690 n=5+5) _validation-2 13.4 ±25% 14.9 ±28% ~ (p=0.421 n=5+5) _noValidation-2 16.7 ±18% 14.9 ±56% ~ (p=0.421 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 10.1 ±42% 7.4 ± 7% ~ (p=0.222 n=5+5) _directGzipHead-2 9.27 ±42% 10.97 ±33% ~ (p=0.421 n=5+5) _noDirectGzip-2 20.0 ± 7% 20.2 ±11% ~ (p=1.000 n=5+5) _directGzip_decode-2 96.5 ±14% 90.6 ±11% ~ (p=0.548 n=5+5) _noDirectGzip_decode-2 22.7 ±17% 20.5 ±11% ~ (p=0.151 n=5+5) _htmlResponse-2 13.0 ±31% 15.6 ±31% ~ (p=0.310 n=5+5) _jsonBodyManual-2 9.51 ±23% 11.49 ±27% ~ (p=0.095 n=5+5) _jsonBody-2 11.5 ±26% 12.8 ±38% ~ (p=0.548 n=5+5) _jsonBodyValidation-2 15.1 ±19% 16.9 ±17% ~ (p=0.310 n=5+5) _outputHeaders-2 12.1 ±29% 12.6 ±21% ~ (p=0.690 n=5+5) _requestResponseMapping-2 16.4 ±14% 18.2 ±34% ~ (p=0.548 n=5+5) _validation-2 15.4 ±43% 15.2 ±19% ~ (p=0.841 n=5+5) _noValidation-2 11.1 ±13% 12.2 ±45% ~ (p=0.841 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 10.9 ±67% 10.3 ±118% ~ (p=0.841 n=5+5) _ok-2 8.20 ±28% 9.74 ±32% ~ (p=0.222 n=5+5) _invalidBody-2 15.7 ±76% 15.1 ±67% ~ (p=1.000 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 37.1k ±17% 37.4k ±13% ~ (p=1.000 n=5+5) _directGzipHead-2 37.2k ± 2% 36.7k ± 2% ~ (p=0.421 n=5+5) _noDirectGzip-2 7.33k ± 2% 7.22k ± 2% ~ (p=0.310 n=5+5) _directGzip_decode-2 1.87k ± 7% 1.91k ± 3% ~ (p=0.421 n=5+5) _noDirectGzip_decode-2 7.14k ± 1% 7.15k ± 0% ~ (p=0.690 n=5+5) _jsonBody-2 19.4k ± 7% 18.5k ± 5% ~ (p=0.095 n=5+5) _jsonBodyValidation-2 16.3k ± 5% 15.3k ± 2% -6.02% (p=0.008 n=5+5) _outputHeaders-2 37.5k ± 3% 37.2k ± 4% ~ (p=1.000 n=5+5) _requestResponseMapping-2 17.8k ± 3% 17.3k ± 2% ~ (p=0.421 n=5+5) _validation-2 17.5k ± 2% 17.0k ± 4% ~ (p=0.056 n=5+5) _noValidation-2 24.0k ± 4% 23.2k ±14% ~ (p=0.548 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 36.5k ± 4% 37.7k ± 4% ~ (p=0.095 n=5+5) _directGzipHead-2 37.4k ± 3% 35.7k ± 9% ~ (p=0.056 n=5+5) _noDirectGzip-2 7.48k ± 2% 7.49k ± 2% ~ (p=1.000 n=5+5) _directGzip_decode-2 1.92k ± 4% 2.00k ± 3% +4.18% (p=0.016 n=5+5) _noDirectGzip_decode-2 7.32k ± 2% 7.43k ± 4% ~ (p=0.310 n=5+5) _htmlResponse-2 22.0k ± 2% 22.0k ± 4% ~ (p=0.548 n=5+5) _jsonBodyManual-2 30.7k ± 2% 30.4k ± 5% ~ (p=1.000 n=5+5) _jsonBody-2 21.2k ± 4% 20.5k ± 4% ~ (p=0.151 n=5+5) _jsonBodyValidation-2 15.0k ± 7% 15.4k ± 4% ~ (p=0.310 n=5+5) _outputHeaders-2 21.5k ± 3% 21.0k ± 3% ~ (p=0.222 n=5+5) _requestResponseMapping-2 17.7k ± 4% 17.7k ± 3% ~ (p=0.841 n=5+5) _validation-2 16.3k ± 2% 16.5k ± 7% ~ (p=1.000 n=5+5) _noValidation-2 24.0k ± 4% 24.1k ± 6% ~ (p=0.794 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 32.2k ± 9% 32.5k ±13% ~ (p=0.841 n=5+5) _ok-2 35.0k ± 2% 34.3k ± 3% ~ (p=0.222 n=5+5) _invalidBody-2 22.0k ± 1% 22.7k ± 7% ~ (p=0.095 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=1.000 n=5+5) _directGzipHead-2 3.85kB ± 0% 3.85kB ± 0% ~ (p=0.286 n=5+5) _noDirectGzip-2 6.53kB ±19% 6.51kB ±17% ~ (p=1.000 n=5+5) _directGzip_decode-2 403kB ± 0% 403kB ± 0% ~ (p=0.222 n=5+5) _noDirectGzip_decode-2 5.79kB ± 6% 5.70kB ± 9% ~ (p=0.690 n=5+5) _jsonBody-2 13.1kB ± 0% 13.1kB ± 0% ~ (p=0.119 n=5+5) _jsonBodyValidation-2 18.9kB ± 0% 18.9kB ± 0% ~ (p=0.190 n=5+5) _outputHeaders-2 3.56kB ± 0% 3.56kB ± 0% ~ (p=0.071 n=5+5) _requestResponseMapping-2 16.6kB ± 0% 16.6kB ± 0% ~ (p=0.587 n=5+5) _validation-2 16.5kB ± 0% 16.5kB ± 0% ~ (p=0.238 n=5+5) _noValidation-2 7.75kB ± 0% 7.76kB ± 0% ~ (p=0.095 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=1.000 n=5+5) _noDirectGzip-2 6.73kB ±19% 6.88kB ±16% ~ (p=0.841 n=5+5) _directGzip_decode-2 403kB ± 0% 403kB ± 0% ~ (p=0.730 n=5+5) _noDirectGzip_decode-2 5.73kB ± 4% 5.90kB ± 5% ~ (p=0.151 n=5+5) _htmlResponse-2 8.02kB ± 0% 8.06kB ± 0% +0.40% (p=0.008 n=5+5) _jsonBodyManual-2 4.49kB ± 0% 4.49kB ± 0% ~ (p=0.270 n=5+5) _jsonBody-2 10.2kB ± 0% 10.2kB ± 0% ~ (p=0.889 n=5+5) _jsonBodyValidation-2 19.0kB ± 0% 19.0kB ± 0% ~ (p=0.310 n=5+5) _outputHeaders-2 10.4kB ± 0% 10.4kB ± 0% ~ (p=0.754 n=5+5) _requestResponseMapping-2 16.6kB ± 0% 16.6kB ± 0% ~ (p=0.222 n=5+5) _validation-2 16.6kB ± 0% 16.5kB ± 0% ~ (p=0.310 n=5+5) _noValidation-2 7.82kB ± 0% 7.82kB ± 0% ~ (p=0.198 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.968 n=5+5) _ok-2 4.53kB ± 0% 4.54kB ± 0% ~ (p=0.971 n=4+4) _invalidBody-2 8.25kB ± 0% 8.25kB ± 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-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.8 ± 4% ~ (p=1.000 n=5+5) _directGzip_decode-2 504 ± 0% 503 ± 0% ~ (p=0.413 n=5+5) _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.6 ± 3% 51.8 ± 3% ~ (p=1.000 n=5+5) _directGzip_decode-2 505 ± 0% 506 ± 0% ~ (p=1.000 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) ```