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

Update CI and deps #63

Closed vearutop closed 2 years ago

github-actions[bot] commented 2 years ago

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 96 6312 4568 435 1309 710 154.3K (-2B)
YAML 10 670 587 46 37 0 20.8K (+6B)
github-actions[bot] commented 2 years ago

Go API Changes

# summary
Inferred base version: v0.2.22
Suggested version: v0.2.23
github-actions[bot] commented 2 years ago

Unit Test Coverage

total: (statements) 82.8%

Coverage diff with base branch ```diff ```
codecov[bot] commented 2 years ago

Codecov Report

Merging #63 (fb45f26) into master (b406fda) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master      #63   +/-   ##
=======================================
  Coverage   76.56%   76.56%           
=======================================
  Files          27       27           
  Lines        1314     1314           
=======================================
  Hits         1006     1006           
  Misses        193      193           
  Partials      115      115           
Flag Coverage Δ
unittests 76.56% <ø> (ø)

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

Impacted Files Coverage Δ
trait.go 93.33% <ø> (ø)

:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

github-actions[bot] commented 2 years 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.19µs ± 1% 1.19µs ± 4% ~ (p=0.460 n=5+5) pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 641ns ± 2% 629ns ± 1% -1.82% (p=0.016 n=5+5) DecoderFunc_Decode-2 1.83µs ± 3% 1.81µs ± 2% ~ (p=0.286 n=5+5) Decoder_Decode_json-2 20.4µs ± 1% 20.2µs ± 1% ~ (p=0.095 n=5+5) Decoder_Decode_queryObject-2 4.41µs ± 2% 4.43µs ± 2% ~ (p=0.841 n=5+5) Decoder_Decode_jsonParam-2 1.64µs ± 1% 1.65µs ± 2% ~ (p=0.389 n=5+5) DecoderFactory_SetDecoderFunc-2 1.54µs ± 3% 1.52µs ± 2% ~ (p=0.095 n=5+5) pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 10.3µs ± 2% 10.4µs ± 2% ~ (p=0.421 n=5+5) Middleware_control-2 2.94µs ± 1% 2.95µs ± 2% ~ (p=0.500 n=5+5) 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.16kB ± 3% 1.16kB ± 2% ~ (p=0.841 n=5+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.19µs ± 4% pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 629ns ± 1% DecoderFunc_Decode-2 1.81µs ± 2% Decoder_Decode_json-2 20.2µs ± 1% Decoder_Decode_queryObject-2 4.43µs ± 2% Decoder_Decode_jsonParam-2 1.65µs ± 2% DecoderFactory_SetDecoderFunc-2 1.52µs ± 2% pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 10.4µs ± 2% Middleware_control-2 2.95µ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.16kB ± 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 2 years 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 23.4µs ± 1% 23.4µs ± 2% ~ (p=1.000 n=4+5) _directGzipHead-2 23.4µs ± 1% 24.8µs ±11% +5.87% (p=0.008 n=5+5) _noDirectGzip-2 135µs ± 1% 136µs ± 2% ~ (p=0.548 n=5+5) _directGzip_decode-2 438µs ± 1% 442µs ± 1% ~ (p=0.095 n=5+5) _noDirectGzip_decode-2 134µs ± 0% 135µs ± 1% ~ (p=0.095 n=5+5) _jsonBody-2 41.0µs ± 1% 42.1µs ± 4% +2.79% (p=0.032 n=5+5) _jsonBodyValidation-2 47.3µs ± 1% 47.7µs ± 1% ~ (p=0.151 n=5+5) _outputHeaders-2 22.8µs ± 1% 23.1µs ± 2% ~ (p=0.095 n=5+5) _requestResponseMapping-2 41.1µs ± 1% 41.3µs ± 3% ~ (p=1.000 n=5+5) _validation-2 44.0µs ± 1% 44.1µs ± 2% ~ (p=0.841 n=5+5) _noValidation-2 29.4µs ± 1% 29.5µs ± 3% ~ (p=1.000 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 24.7µs ±14% 23.7µs ± 1% ~ (p=0.190 n=5+4) _directGzipHead-2 23.6µs ± 0% 23.6µs ± 1% ~ (p=1.000 n=5+5) _noDirectGzip-2 135µs ± 1% 136µs ± 3% ~ (p=0.310 n=5+5) _directGzip_decode-2 443µs ± 3% 440µs ± 2% ~ (p=0.548 n=5+5) _noDirectGzip_decode-2 135µs ± 0% 135µs ± 0% ~ (p=0.421 n=5+5) _jsonBody-2 41.6µs ± 2% 41.8µs ± 1% ~ (p=0.690 n=5+5) _jsonBodyValidation-2 47.5µs ± 1% 47.9µs ± 1% ~ (p=0.095 n=5+5) _outputHeaders-2 23.4µs ± 1% 23.4µs ± 1% ~ (p=1.000 n=5+5) _requestResponseMapping-2 41.4µs ± 1% 41.3µs ± 1% ~ (p=0.548 n=5+5) _validation-2 44.3µs ± 1% 44.7µs ± 3% ~ (p=0.841 n=5+5) _noValidation-2 44.6µs ± 3% 44.9µs ± 2% ~ (p=0.421 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 27.0µs ± 0% 27.2µs ± 1% ~ (p=0.111 n=4+5) _ok-2 27.5µs ± 1% 27.5µs ± 1% ~ (p=0.690 n=5+5) _invalidBody-2 38.7µs ± 1% 38.5µs ± 1% ~ (p=0.548 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 639 ± 0% 639 ± 0% ~ (all equal) _directGzipHead-2 183 ± 0% 183 ± 0% ~ (all equal) _noDirectGzip-2 1.04k ± 0% 1.04k ± 0% ~ (all equal) _directGzip_decode-2 639 ± 0% 639 ± 0% ~ (all equal) _noDirectGzip_decode-2 1.04k ± 0% 1.04k ± 0% ~ (all equal) _jsonBody-2 208 ± 0% 208 ± 0% ~ (all equal) _jsonBodyValidation-2 194 ± 0% 194 ± 0% ~ (all equal) _outputHeaders-2 155 ± 0% 155 ± 0% ~ (all equal) _requestResponseMapping-2 94.0 ± 0% 94.0 ± 0% ~ (all equal) _validation-2 177 ± 0% 177 ± 0% ~ (all equal) _noValidation-2 177 ± 0% 177 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 639 ± 0% 639 ± 0% ~ (all equal) _directGzipHead-2 183 ± 0% 183 ± 0% ~ (all equal) _noDirectGzip-2 1.04k ± 0% 1.04k ± 0% ~ (all equal) _directGzip_decode-2 639 ± 0% 639 ± 0% ~ (all equal) _noDirectGzip_decode-2 1.04k ± 0% 1.04k ± 0% ~ (all equal) _jsonBody-2 208 ± 0% 208 ± 0% ~ (all equal) _jsonBodyValidation-2 194 ± 0% 194 ± 0% ~ (all equal) _outputHeaders-2 155 ± 0% 155 ± 0% ~ (all equal) _requestResponseMapping-2 94.0 ± 0% 94.0 ± 0% ~ (all equal) _validation-2 177 ± 0% 177 ± 0% ~ (all equal) _noValidation-2 177 ± 0% 177 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 337 ± 0% 337 ± 0% ~ (all equal) _ok-2 359 ± 0% 359 ± 0% ~ (all equal) _invalidBody-2 435 ± 0% 435 ± 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) _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 42.8k ± 1% 42.7k ± 2% ~ (p=1.000 n=4+5) _directGzipHead-2 42.8k ± 1% 40.5k ±10% -5.28% (p=0.008 n=5+5) _noDirectGzip-2 7.43k ± 1% 7.36k ± 2% ~ (p=0.548 n=5+5) _directGzip_decode-2 2.28k ± 1% 2.26k ± 1% ~ (p=0.095 n=5+5) _noDirectGzip_decode-2 7.45k ± 0% 7.43k ± 1% ~ (p=0.087 n=5+5) _jsonBody-2 24.4k ± 1% 23.8k ± 4% -2.65% (p=0.032 n=5+5) _jsonBodyValidation-2 21.1k ± 1% 21.0k ± 1% ~ (p=0.151 n=5+5) _outputHeaders-2 43.8k ± 1% 43.2k ± 2% ~ (p=0.095 n=5+5) _requestResponseMapping-2 24.3k ± 1% 24.2k ± 3% ~ (p=1.000 n=5+5) _validation-2 22.7k ± 1% 22.7k ± 2% ~ (p=0.841 n=5+5) _noValidation-2 34.0k ± 1% 33.9k ± 3% ~ (p=1.000 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 40.6k ±12% 42.2k ± 1% ~ (p=0.190 n=5+4) _directGzipHead-2 42.3k ± 0% 42.4k ± 1% ~ (p=1.000 n=5+5) _noDirectGzip-2 7.41k ± 1% 7.35k ± 3% ~ (p=0.286 n=5+5) _directGzip_decode-2 2.26k ± 3% 2.27k ± 2% ~ (p=0.548 n=5+5) _noDirectGzip_decode-2 7.43k ± 0% 7.42k ± 0% ~ (p=0.421 n=5+5) _jsonBody-2 24.0k ± 2% 23.9k ± 1% ~ (p=0.730 n=5+5) _jsonBodyValidation-2 21.0k ± 1% 20.9k ± 1% ~ (p=0.095 n=5+5) _outputHeaders-2 42.7k ± 1% 42.7k ± 1% ~ (p=1.000 n=5+5) _requestResponseMapping-2 24.2k ± 1% 24.2k ± 1% ~ (p=0.548 n=5+5) _validation-2 22.6k ± 1% 22.4k ± 3% ~ (p=0.841 n=5+5) _noValidation-2 22.4k ± 3% 22.3k ± 2% ~ (p=0.421 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 37.0k ± 0% 36.8k ± 1% ~ (p=0.111 n=4+5) _ok-2 36.4k ± 1% 36.3k ± 1% ~ (p=0.690 n=5+5) _invalidBody-2 25.9k ± 1% 25.9k ± 1% ~ (p=0.516 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.92kB ± 0% 3.92kB ± 0% ~ (p=0.294 n=5+5) _directGzipHead-2 3.92kB ± 0% 3.92kB ± 0% ~ (p=0.214 n=5+5) _noDirectGzip-2 6.33kB ±16% 6.17kB ±22% ~ (p=0.690 n=5+5) _directGzip_decode-2 402kB ± 0% 402kB ± 0% ~ (p=0.889 n=5+5) _noDirectGzip_decode-2 5.16kB ± 9% 5.25kB ± 7% ~ (p=0.690 n=5+5) _jsonBody-2 13.2kB ± 0% 13.2kB ± 0% ~ (p=0.444 n=5+5) _jsonBodyValidation-2 19.0kB ± 0% 19.0kB ± 0% ~ (p=0.722 n=5+5) _outputHeaders-2 3.70kB ± 0% 3.71kB ± 0% ~ (p=0.937 n=5+4) _requestResponseMapping-2 16.6kB ± 0% 16.6kB ± 0% ~ (p=0.302 n=5+5) _validation-2 16.5kB ± 0% 16.5kB ± 0% ~ (p=0.198 n=5+5) _noValidation-2 6.12kB ± 0% 6.12kB ± 0% ~ (p=0.302 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 3.93kB ± 0% 3.94kB ± 0% ~ (p=0.159 n=4+5) _directGzipHead-2 3.93kB ± 0% 3.93kB ± 0% ~ (p=1.000 n=5+5) _noDirectGzip-2 6.50kB ±19% 6.39kB ±17% ~ (p=1.000 n=5+5) _directGzip_decode-2 402kB ± 0% 402kB ± 0% ~ (p=0.841 n=5+5) _noDirectGzip_decode-2 5.56kB ±11% 5.33kB ± 6% ~ (p=0.310 n=5+5) _jsonBody-2 13.3kB ± 0% 13.3kB ± 0% ~ (p=0.921 n=5+5) _jsonBodyValidation-2 19.0kB ± 0% 19.0kB ± 0% ~ (p=0.802 n=5+5) _outputHeaders-2 3.70kB ± 0% 3.70kB ± 0% ~ (p=0.865 n=5+5) _requestResponseMapping-2 16.7kB ± 0% 16.7kB ± 0% ~ (p=1.000 n=5+5) _validation-2 16.6kB ± 0% 16.6kB ± 0% ~ (p=0.810 n=5+4) _noValidation-2 16.6kB ± 0% 16.6kB ± 0% ~ (p=0.119 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 4.88kB ± 0% 4.88kB ± 0% ~ (p=0.540 n=5+5) _ok-2 4.78kB ± 0% 4.78kB ± 0% ~ (p=0.200 n=4+4) _invalidBody-2 8.67kB ± 0% 8.67kB ± 0% ~ (p=0.314 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.6 ± 3% ~ (p=1.000 n=5+5) _directGzip_decode-2 500 ± 0% 500 ± 0% ~ (p=0.444 n=5+5) _noDirectGzip_decode-2 50.0 ± 0% 50.0 ± 0% ~ (all equal) _jsonBody-2 127 ± 0% 127 ± 0% ~ (all equal) _jsonBodyValidation-2 183 ± 0% 183 ± 0% ~ (all equal) _outputHeaders-2 37.0 ± 0% 37.0 ± 0% ~ (all equal) _requestResponseMapping-2 123 ± 0% 123 ± 0% ~ (all equal) _validation-2 152 ± 0% 152 ± 0% ~ (all equal) _noValidation-2 72.0 ± 0% 72.0 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 43.0 ± 0% 43.0 ± 0% ~ (all equal) _directGzipHead-2 43.0 ± 0% 43.0 ± 0% ~ (all equal) _noDirectGzip-2 50.6 ± 3% 50.6 ± 3% ~ (p=1.000 n=5+5) _directGzip_decode-2 501 ± 0% 501 ± 0% ~ (p=0.444 n=5+5) _noDirectGzip_decode-2 51.0 ± 0% 51.0 ± 0% ~ (all equal) _jsonBody-2 128 ± 0% 128 ± 0% ~ (all equal) _jsonBodyValidation-2 184 ± 0% 184 ± 0% ~ (all equal) _outputHeaders-2 37.0 ± 0% 37.0 ± 0% ~ (all equal) _requestResponseMapping-2 124 ± 0% 124 ± 0% ~ (all equal) _validation-2 153 ± 0% 153 ± 0% ~ (all equal) _noValidation-2 153 ± 0% 153 ± 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 100 ± 0% 100 ± 0% ~ (all equal) ```