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 OpenAPI deep object decoding #164

Closed vearutop closed 11 months ago

github-actions[bot] commented 11 months ago

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 106 7760 (+73) 5650 (+59) 504 1606 (+14) 967 (+19) 188.1K (+1.7K)
Go (test) 49 (+1) 5684 (+175) 4405 (+159) 187 1092 (+16) 182 (+2) 157.8K (+4.7K)
JSON 3 1590 (+23) 1590 (+23) 0 0 0 66.2K (+1.3K)
github-actions[bot] commented 11 months ago

Go API Changes

# summary
Inferred base version: v0.2.52
Suggested version: v0.3.0
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.74µs ± 5% 1.73µs ± 1% ~ (p=0.792 n=6+5) pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 908ns ± 1% 888ns ± 1% -2.14% (p=0.008 n=5+5) DecoderFunc_Decode-2 2.57µs ± 0% 2.56µs ± 1% ~ (p=0.312 n=5+6) Decoder_Decode_json-2 28.2µs ± 2% 28.6µs ± 1% ~ (p=0.065 n=6+6) Decoder_Decode_queryObject-2 6.31µs ± 1% 6.20µs ± 1% -1.65% (p=0.009 n=5+6) Decoder_Decode_jsonParam-2 2.27µs ± 2% 2.32µs ± 1% +1.99% (p=0.026 n=6+6) DecoderFactory_SetDecoderFunc-2 2.18µs ± 6% 2.16µs ± 1% ~ (p=1.000 n=6+6) pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 13.8µs ± 3% 13.7µs ± 1% ~ (p=0.394 n=6+6) Middleware_control-2 4.65µs ± 2% 4.69µs ± 9% ~ (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.14kB ± 3% 1.13kB ± 2% ~ (p=0.697 n=6+5) 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 ± 1% pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 888ns ± 1% DecoderFunc_Decode-2 2.56µs ± 1% Decoder_Decode_json-2 28.6µs ± 1% Decoder_Decode_queryObject-2 6.20µs ± 1% Decoder_Decode_jsonParam-2 2.32µs ± 1% DecoderFactory_SetDecoderFunc-2 2.16µs ± 1% pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 13.7µs ± 1% Middleware_control-2 4.69µs ± 9% 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.13kB ± 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 29.0µs ± 1% 30.0µs ±16% ~ (p=0.905 n=4+5) _directGzipHead-2 28.7µs ± 2% 28.8µs ± 2% ~ (p=1.000 n=5+5) _noDirectGzip-2 161µs ± 2% 164µs ± 8% ~ (p=1.000 n=5+5) _directGzip_decode-2 616µs ± 6% 593µs ± 2% ~ (p=0.056 n=5+5) _noDirectGzip_decode-2 161µs ± 1% 161µs ± 1% ~ (p=0.841 n=5+5) _jsonBody-2 58.1µs ± 2% 58.5µs ± 1% ~ (p=0.310 n=5+5) _jsonBodyValidation-2 69.8µs ± 2% 71.5µs ± 2% ~ (p=0.151 n=5+5) _outputHeaders-2 29.2µs ± 2% 29.9µs ± 3% ~ (p=0.056 n=5+5) _requestResponseMapping-2 59.0µs ± 5% 61.8µs ± 6% ~ (p=0.056 n=5+5) _validation-2 64.6µs ± 4% 66.0µs ± 2% ~ (p=0.151 n=5+5) _noValidation-2 46.6µs ± 4% 46.1µs ± 2% ~ (p=0.690 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 30.1µs ± 3% 30.4µs ±13% ~ (p=0.548 n=5+5) _directGzipHead-2 30.7µs ± 5% 29.7µs ± 2% -3.26% (p=0.032 n=5+5) _noDirectGzip-2 154µs ± 1% 154µs ± 1% ~ (p=1.000 n=5+5) _directGzip_decode-2 593µs ± 3% 598µs ± 3% ~ (p=0.690 n=5+5) _noDirectGzip_decode-2 156µs ± 3% 157µs ± 3% ~ (p=0.690 n=5+5) _htmlResponse-2 49.7µs ± 2% 50.8µs ± 3% ~ (p=0.151 n=5+5) _jsonBodyManual-2 35.6µs ± 4% 35.3µs ± 1% ~ (p=1.000 n=5+5) _jsonBody-2 52.7µs ± 2% 53.1µs ± 4% ~ (p=0.310 n=5+5) _jsonBodyValidation-2 70.9µs ± 7% 72.4µs ± 2% ~ (p=0.151 n=5+5) _outputHeaders-2 51.5µs ± 2% 51.1µs ± 3% ~ (p=0.548 n=5+5) _requestResponseMapping-2 63.1µs ± 3% 62.6µs ± 2% ~ (p=0.548 n=5+5) _validation-2 66.5µs ± 3% 65.6µs ± 2% ~ (p=0.421 n=5+5) _noValidation-2 45.9µs ± 3% 45.6µs ± 2% ~ (p=0.841 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 32.0µs ± 1% 31.5µs ± 2% ~ (p=0.114 n=4+4) _ok-2 31.9µs ± 1% 32.2µs ± 1% ~ (p=0.151 n=5+5) _invalidBody-2 47.7µs ± 4% 48.8µs ± 3% ~ (p=0.151 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.40 ± 7% 1.42 ±10% ~ (p=0.690 n=5+5) _directGzipHead-2 1.35 ± 8% 1.37 ± 6% ~ (p=0.690 n=5+5) _noDirectGzip-2 7.54 ± 4% 7.60 ± 4% ~ (p=1.000 n=5+5) _directGzip_decode-2 23.5 ± 8% 22.2 ± 6% ~ (p=0.310 n=5+5) _noDirectGzip_decode-2 7.65 ± 3% 7.61 ± 3% ~ (p=0.841 n=5+5) _jsonBody-2 2.67 ± 4% 2.70 ± 6% ~ (p=0.841 n=5+5) _jsonBodyValidation-2 3.27 ± 8% 3.32 ± 6% ~ (p=0.690 n=5+5) _outputHeaders-2 1.36 ± 5% 1.38 ± 5% ~ (p=0.452 n=5+5) _requestResponseMapping-2 2.63 ± 4% 2.72 ± 5% ~ (p=0.151 n=5+5) _validation-2 2.84 ± 8% 2.98 ± 3% ~ (p=0.095 n=5+5) _noValidation-2 2.05 ± 3% 1.99 ± 4% ~ (p=0.095 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 1.41 ± 3% 1.42 ± 5% ~ (p=0.548 n=5+5) _directGzipHead-2 1.36 ± 4% 1.33 ± 2% ~ (p=0.222 n=5+5) _noDirectGzip-2 7.37 ± 4% 7.36 ± 3% ~ (p=1.000 n=5+5) _directGzip_decode-2 22.2 ± 4% 23.5 ± 6% ~ (p=0.056 n=5+5) _noDirectGzip_decode-2 7.59 ± 7% 7.49 ± 4% ~ (p=0.690 n=5+5) _htmlResponse-2 2.26 ± 2% 2.39 ± 4% +5.66% (p=0.016 n=5+5) _jsonBodyManual-2 1.64 ± 3% 1.63 ± 5% ~ (p=0.421 n=5+5) _jsonBody-2 2.37 ± 6% 2.26 ± 4% -4.87% (p=0.032 n=5+5) _jsonBodyValidation-2 3.27 ± 8% 3.23 ± 4% ~ (p=0.690 n=5+5) _outputHeaders-2 2.14 ± 6% 2.10 ± 4% ~ (p=0.421 n=5+5) _requestResponseMapping-2 2.82 ± 7% 2.75 ± 5% ~ (p=0.421 n=5+5) _validation-2 2.92 ± 4% 2.79 ± 3% ~ (p=0.095 n=5+5) _noValidation-2 1.96 ± 5% 1.96 ± 5% ~ (p=1.000 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 1.55 ± 6% 1.54 ± 4% ~ (p=1.000 n=5+5) _ok-2 1.55 ± 5% 1.51 ± 4% ~ (p=0.548 n=5+5) _invalidBody-2 2.02 ± 5% 2.08 ±12% ~ (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-2 2.55 ± 9% 2.55 ± 7% ~ (p=1.000 n=5+5) _directGzipHead-2 2.50 ± 5% 2.45 ± 5% ~ (p=0.690 n=5+5) _noDirectGzip-2 13.9 ± 4% 14.5 ± 9% ~ (p=0.310 n=5+5) _directGzip_decode-2 49.9 ± 9% 49.0 ± 4% ~ (p=1.000 n=5+5) _noDirectGzip_decode-2 14.0 ± 4% 13.8 ± 2% ~ (p=0.651 n=5+5) _jsonBody-2 5.32 ± 5% 5.23 ± 5% ~ (p=0.421 n=5+5) _jsonBodyValidation-2 6.15 ± 4% 6.26 ± 7% ~ (p=0.690 n=5+5) _outputHeaders-2 2.44 ± 6% 2.49 ± 8% ~ (p=0.310 n=5+5) _requestResponseMapping-2 5.30 ± 6% 5.59 ±11% ~ (p=0.095 n=5+5) _validation-2 5.79 ± 6% 5.92 ± 7% ~ (p=0.548 n=5+5) _noValidation-2 4.37 ± 5% 4.47 ± 5% ~ (p=0.421 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 2.57 ± 9% 2.56 ± 6% ~ (p=1.000 n=5+5) _directGzipHead-2 2.60 ± 7% 2.56 ± 5% ~ (p=0.548 n=5+5) _noDirectGzip-2 13.2 ± 5% 13.2 ± 4% ~ (p=1.000 n=5+5) _directGzip_decode-2 49.2 ±10% 48.9 ± 7% ~ (p=0.548 n=5+5) _noDirectGzip_decode-2 13.2 ± 3% 13.5 ± 5% ~ (p=0.111 n=5+5) _htmlResponse-2 4.56 ± 5% 4.71 ± 5% ~ (p=0.222 n=5+5) _jsonBodyManual-2 2.97 ± 3% 2.98 ± 5% ~ (p=1.000 n=5+5) _jsonBody-2 4.92 ± 4% 5.08 ± 6% ~ (p=0.310 n=5+5) _jsonBodyValidation-2 6.39 ± 2% 6.45 ± 5% ~ (p=0.841 n=5+5) _outputHeaders-2 5.04 ± 4% 5.01 ± 7% ~ (p=0.841 n=5+5) _requestResponseMapping-2 5.85 ± 7% 5.59 ± 8% ~ (p=0.151 n=5+5) _validation-2 5.99 ± 4% 6.09 ± 4% ~ (p=0.421 n=5+5) _noValidation-2 4.41 ± 9% 4.41 ± 3% ~ (p=0.690 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 2.78 ± 8% 2.83 ±13% ~ (p=1.000 n=5+5) _ok-2 2.74 ± 3% 2.74 ± 3% ~ (p=0.841 n=5+5) _invalidBody-2 4.57 ± 1% 4.95 ± 8% ~ (p=0.111 n=4+5) name old 99%:ms new 99%:ms delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-2 4.25 ± 6% 4.21 ± 6% ~ (p=1.000 n=4+4) _directGzipHead-2 4.41 ± 8% 4.46 ± 7% ~ (p=0.548 n=5+5) _noDirectGzip-2 20.8 ± 4% 20.7 ± 3% ~ (p=0.968 n=5+4) _directGzip_decode-2 84.1 ±17% 84.5 ± 6% ~ (p=0.690 n=5+5) _noDirectGzip_decode-2 21.0 ± 5% 20.6 ± 4% ~ (p=0.690 n=5+5) _jsonBody-2 8.11 ± 9% 7.77 ±12% ~ (p=0.421 n=5+5) _jsonBodyValidation-2 10.6 ±30% 9.7 ±11% ~ (p=1.000 n=5+5) _outputHeaders-2 4.78 ± 6% 5.13 ±10% ~ (p=0.151 n=5+5) _requestResponseMapping-2 8.38 ±15% 8.62 ±40% ~ (p=0.690 n=5+5) _validation-2 8.87 ±21% 8.70 ±20% ~ (p=0.738 n=5+5) _noValidation-2 7.97 ± 8% 7.68 ±21% ~ (p=0.310 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 4.56 ± 8% 4.30 ± 6% ~ (p=0.190 n=5+4) _directGzipHead-2 5.07 ± 9% 4.72 ± 9% ~ (p=0.190 n=4+5) _noDirectGzip-2 20.4 ± 2% 20.2 ± 7% ~ (p=0.500 n=5+5) _directGzip_decode-2 80.7 ± 4% 81.4 ±12% ~ (p=0.841 n=5+5) _noDirectGzip_decode-2 20.2 ± 5% 20.8 ± 3% ~ (p=0.151 n=5+5) _htmlResponse-2 7.31 ± 6% 7.63 ±10% ~ (p=0.548 n=5+5) _jsonBodyManual-2 5.67 ±10% 5.58 ± 4% ~ (p=0.421 n=5+5) _jsonBody-2 7.68 ± 7% 8.11 ±19% ~ (p=0.548 n=5+5) _jsonBodyValidation-2 8.90 ± 6% 10.05 ±12% +12.91% (p=0.032 n=5+5) _outputHeaders-2 8.15 ±15% 7.93 ± 5% ~ (p=1.000 n=5+5) _requestResponseMapping-2 9.68 ±14% 9.45 ±11% ~ (p=0.548 n=5+5) _validation-2 9.50 ± 7% 9.24 ± 9% ~ (p=0.548 n=5+5) _noValidation-2 7.30 ±15% 7.57 ± 3% ~ (p=0.421 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 4.47 ± 1% 4.26 ± 1% -4.65% (p=0.029 n=4+4) _ok-2 4.59 ± 5% 4.46 ± 7% ~ (p=0.421 n=5+5) _invalidBody-2 7.86 ±19% 8.23 ±15% ~ (p=0.548 n=5+5) name old 99.9%:ms new 99.9%:ms delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-2 11.6 ±61% 9.3 ±90% ~ (p=0.421 n=5+5) _directGzipHead-2 10.9 ±38% 10.0 ±37% ~ (p=0.841 n=5+5) _noDirectGzip-2 24.8 ±13% 29.4 ±46% ~ (p=0.222 n=5+5) _directGzip_decode-2 110 ±30% 106 ± 4% ~ (p=0.690 n=5+5) _noDirectGzip_decode-2 24.4 ± 6% 25.1 ±12% ~ (p=0.310 n=5+5) _jsonBody-2 13.8 ±23% 11.9 ±27% ~ (p=0.222 n=5+5) _jsonBodyValidation-2 16.3 ±26% 15.3 ±21% ~ (p=0.548 n=5+5) _outputHeaders-2 9.43 ±28% 10.28 ±33% ~ (p=0.548 n=5+5) _requestResponseMapping-2 12.9 ±21% 14.3 ±43% ~ (p=0.690 n=5+5) _validation-2 13.1 ±21% 13.0 ±32% ~ (p=0.841 n=5+5) _noValidation-2 14.0 ±23% 12.2 ±38% ~ (p=0.310 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 9.58 ±59% 9.45 ±79% ~ (p=0.841 n=5+5) _directGzipHead-2 11.0 ±32% 10.9 ±27% ~ (p=0.841 n=5+5) _noDirectGzip-2 25.5 ±10% 24.6 ±15% ~ (p=0.421 n=5+5) _directGzip_decode-2 100 ±11% 105 ± 6% ~ (p=0.421 n=5+5) _noDirectGzip_decode-2 24.4 ±19% 28.4 ±33% ~ (p=0.310 n=5+5) _htmlResponse-2 14.1 ±30% 13.2 ±36% ~ (p=0.841 n=5+5) _jsonBodyManual-2 10.3 ±27% 9.2 ±36% ~ (p=0.421 n=5+5) _jsonBody-2 11.6 ±17% 13.5 ±44% ~ (p=0.310 n=5+5) _jsonBodyValidation-2 13.1 ±21% 15.6 ±10% ~ (p=0.056 n=5+5) _outputHeaders-2 12.6 ±23% 11.7 ±22% ~ (p=0.548 n=5+5) _requestResponseMapping-2 17.7 ±21% 17.1 ±35% ~ (p=0.730 n=5+5) _validation-2 15.1 ±27% 13.6 ±23% ~ (p=0.310 n=5+5) _noValidation-2 11.8 ±38% 14.7 ±30% ~ (p=0.151 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 11.6 ±75% 9.9 ±123% ~ (p=0.690 n=5+5) _ok-2 9.47 ±46% 10.18 ±64% ~ (p=0.841 n=5+5) _invalidBody-2 12.8 ±34% 15.2 ±16% ~ (p=0.151 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 34.5k ± 1% 33.6k ±14% ~ (p=0.905 n=4+5) _directGzipHead-2 34.8k ± 2% 34.8k ± 2% ~ (p=1.000 n=5+5) _noDirectGzip-2 6.21k ± 2% 6.12k ± 8% ~ (p=1.000 n=5+5) _directGzip_decode-2 1.62k ± 6% 1.69k ± 2% ~ (p=0.056 n=5+5) _noDirectGzip_decode-2 6.20k ± 1% 6.20k ± 1% ~ (p=0.841 n=5+5) _jsonBody-2 17.2k ± 2% 17.1k ± 1% ~ (p=0.310 n=5+5) _jsonBodyValidation-2 14.3k ± 2% 14.0k ± 2% ~ (p=0.151 n=5+5) _outputHeaders-2 34.3k ± 2% 33.4k ± 3% ~ (p=0.056 n=5+5) _requestResponseMapping-2 17.0k ± 4% 16.2k ± 5% ~ (p=0.056 n=5+5) _validation-2 15.5k ± 4% 15.1k ± 2% ~ (p=0.151 n=5+5) _noValidation-2 21.5k ± 4% 21.7k ± 2% ~ (p=0.690 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 33.3k ± 3% 33.0k ±11% ~ (p=0.548 n=5+5) _directGzipHead-2 32.6k ± 5% 33.7k ± 2% +3.30% (p=0.032 n=5+5) _noDirectGzip-2 6.48k ± 1% 6.48k ± 1% ~ (p=0.937 n=5+5) _directGzip_decode-2 1.69k ± 3% 1.67k ± 3% ~ (p=0.690 n=5+5) _noDirectGzip_decode-2 6.43k ± 3% 6.38k ± 3% ~ (p=0.595 n=5+5) _htmlResponse-2 20.1k ± 2% 19.7k ± 3% ~ (p=0.151 n=5+5) _jsonBodyManual-2 28.1k ± 4% 28.3k ± 1% ~ (p=1.000 n=5+5) _jsonBody-2 19.0k ± 2% 18.8k ± 5% ~ (p=0.310 n=5+5) _jsonBodyValidation-2 14.1k ± 6% 13.8k ± 2% ~ (p=0.151 n=5+5) _outputHeaders-2 19.4k ± 2% 19.6k ± 3% ~ (p=0.548 n=5+5) _requestResponseMapping-2 15.8k ± 3% 16.0k ± 2% ~ (p=0.548 n=5+5) _validation-2 15.1k ± 3% 15.3k ± 2% ~ (p=0.421 n=5+5) _noValidation-2 21.8k ± 3% 21.9k ± 2% ~ (p=0.841 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 31.3k ± 1% 30.4k ±17% ~ (p=0.413 n=4+5) _ok-2 31.3k ± 1% 31.0k ± 1% ~ (p=0.151 n=5+5) _invalidBody-2 21.0k ± 4% 20.5k ± 3% ~ (p=0.151 n=5+5) name old alloc/op new alloc/op delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-2 3.85kB ± 0% 3.85kB ± 0% ~ (p=0.905 n=5+5) _directGzipHead-2 3.85kB ± 0% 3.85kB ± 0% ~ (p=0.381 n=5+5) _noDirectGzip-2 6.98kB ±29% 6.86kB ±15% ~ (p=0.690 n=5+5) _directGzip_decode-2 403kB ± 0% 403kB ± 0% ~ (p=0.151 n=5+5) _noDirectGzip_decode-2 5.89kB ±15% 6.00kB ±15% ~ (p=0.690 n=5+5) _jsonBody-2 13.1kB ± 0% 13.1kB ± 0% ~ (p=0.802 n=5+5) _jsonBodyValidation-2 18.9kB ± 0% 18.9kB ± 0% ~ (p=0.579 n=5+5) _outputHeaders-2 3.57kB ± 0% 3.57kB ± 0% ~ (p=0.135 n=5+5) _requestResponseMapping-2 16.6kB ± 0% 16.6kB ± 0% ~ (p=1.000 n=5+5) _validation-2 16.5kB ± 0% 16.5kB ± 0% ~ (p=0.413 n=5+5) _noValidation-2 7.76kB ± 0% 7.76kB ± 0% ~ (p=0.508 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 3.88kB ± 0% 3.88kB ± 0% ~ (p=0.095 n=4+5) _directGzipHead-2 3.88kB ± 0% 3.88kB ± 0% ~ (p=0.952 n=5+5) _noDirectGzip-2 7.18kB ±14% 7.08kB ±20% ~ (p=1.000 n=5+5) _directGzip_decode-2 403kB ± 0% 404kB ± 0% ~ (p=0.548 n=5+5) _noDirectGzip_decode-2 6.25kB ± 9% 5.93kB ±11% ~ (p=0.690 n=5+5) _htmlResponse-2 8.03kB ± 0% 8.03kB ± 0% ~ (p=0.437 n=5+5) _jsonBodyManual-2 4.49kB ± 0% 4.49kB ± 0% ~ (p=0.754 n=5+5) _jsonBody-2 10.2kB ± 0% 10.2kB ± 0% ~ (p=0.238 n=5+5) _jsonBodyValidation-2 19.0kB ± 0% 19.0kB ± 0% ~ (p=0.889 n=5+5) _outputHeaders-2 10.4kB ± 0% 10.4kB ± 0% ~ (p=0.524 n=5+5) _requestResponseMapping-2 16.6kB ± 0% 16.6kB ± 0% ~ (p=1.000 n=5+5) _validation-2 16.6kB ± 0% 16.5kB ± 0% ~ (p=0.524 n=5+5) _noValidation-2 7.82kB ± 0% 7.82kB ± 0% ~ (p=1.000 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% +0.10% (p=0.032 n=5+5) _ok-2 4.54kB ± 0% 4.54kB ± 0% ~ (p=0.400 n=4+4) _invalidBody-2 8.25kB ± 0% 8.25kB ± 0% ~ (p=0.829 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% 50.0 ± 4% ~ (p=1.000 n=5+5) _directGzip_decode-2 504 ± 0% 504 ± 0% ~ (p=0.413 n=5+4) _noDirectGzip_decode-2 50.0 ± 0% 50.0 ± 0% ~ (all equal) _jsonBody-2 128 ± 0% 128 ± 0% ~ (all equal) _jsonBodyValidation-2 185 ± 0% 185 ± 0% ~ (all equal) _outputHeaders-2 36.0 ± 0% 36.0 ± 0% ~ (all equal) _requestResponseMapping-2 124 ± 0% 124 ± 0% ~ (all equal) _validation-2 154 ± 0% 154 ± 0% ~ (all equal) _noValidation-2 91.0 ± 0% 91.0 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 44.0 ± 0% 44.0 ± 0% ~ (all equal) _directGzipHead-2 44.0 ± 0% 44.0 ± 0% ~ (all equal) _noDirectGzip-2 52.0 ± 4% 51.8 ± 3% ~ (p=1.000 n=5+5) _directGzip_decode-2 506 ± 1% 507 ± 0% ~ (p=0.476 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) ```
github-actions[bot] commented 11 months ago

Unit Test Coverage

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

Coverage of changed lines | File | Function | Coverage | |-----------------------------|------------------------------|----------| | Total | | 89.4% | | jsonschema/validator.go | | 100.0% | | jsonschema/validator.go:197 | ValidateData | 100.0% | | openapi/collector.go | | 66.7% | | openapi/collector.go:415 | paramSchema | 76.5% | | openapi/collector.go:360 | provideParametersJSONSchemas | 65.0% | | request/decoder.go | | 50.0% | | request/decoder.go:32 | decodeValidate | 50.0% | | request/factory.go | | 100.0% | | request/factory.go:53 | NewDecoderFactory | 100.0% | | request/factory.go:74 | SetDecoderFunc | 100.0% | | request/factory.go:98 | MakeDecoder | 100.0% | | request/factory.go:222 | jsonParams | 100.0% | | request/factory.go:254 | makeDefaultDecoder | 100.0% | | request/factory.go:295 | makeCustomMappingDecoder | 100.0% |
Coverage diff with base branch | File | Function | Base Coverage | Current Coverage | |-----------------------------------------------|------------------------------|---------------|------------------| | Total | | 83.7% | 83.6% (-0.1%) | | github.com/swaggest/rest/openapi/collector.go | paramSchema | no function | 60.0% | | github.com/swaggest/rest/openapi/collector.go | provideParametersJSONSchemas | 72.7% | 63.0% (-9.7%) | | github.com/swaggest/rest/request/decoder.go | decodeValidate | 76.9% | 73.3% (-3.6%) | | github.com/swaggest/rest/request/factory.go | makeCustomMappingDecoder | 93.3% | 94.1% (+0.8%) |
codecov[bot] commented 11 months ago

Codecov Report

Merging #164 (6938fac) into master (020a738) will decrease coverage by 0.14%. The diff coverage is 76.74%.

@@            Coverage Diff             @@
##           master     #164      +/-   ##
==========================================
- Coverage   78.04%   77.91%   -0.14%     
==========================================
  Files          28       28              
  Lines        1608     1639      +31     
==========================================
+ Hits         1255     1277      +22     
- Misses        232      239       +7     
- Partials      121      123       +2     
Flag Coverage Δ
unittests 77.91% <76.74%> (-0.14%) :arrow_down:

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

Impacted Files Coverage Δ
request/decoder.go 65.00% <0.00%> (-2.25%) :arrow_down:
openapi/collector.go 63.00% <50.00%> (-1.14%) :arrow_down:
jsonschema/validator.go 80.19% <100.00%> (ø)
request/factory.go 89.36% <100.00%> (+1.65%) :arrow_up:

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