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 dependencies and CI #42

Closed vearutop closed 3 years ago

vearutop commented 3 years ago

Takes advantage of https://github.com/swaggest/jsonschema-go/pull/22.

github-actions[bot] commented 3 years ago

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go (test) 33 3480 (+2) 2686 (+2) 89 705 95 96.1K (-265B)
JSON 1 465 465 0 0 0 19.6K (+16B)
YAML 9 (+1) 525 (+45) 463 (+42) 40 (+2) 22 (+1) 0 16.2K (+1.2K)
github-actions[bot] commented 3 years ago

Exported API Changes Report

# summary
Inferred base version: v0.2.8
Suggested version: v0.2.9
github-actions[bot] commented 3 years ago

Unit Test Coverage

total: (statements) 81.9%

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

Codecov Report

Merging #42 (5da731b) into master (9adf73f) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #42   +/-   ##
=======================================
  Coverage   74.15%   74.15%           
=======================================
  Files          26       26           
  Lines        1563     1563           
=======================================
  Hits         1159     1159           
  Misses        254      254           
  Partials      150      150           
Flag Coverage Δ
unittests 74.15% <ø> (ø)

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


Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9adf73f...5da731b. Read the comment docs.

github-actions[bot] commented 3 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.65µs ± 0% 1.89µs ±31% ~ (p=0.127 n=4+5) pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 928ns ± 1% 925ns ± 1% ~ (p=0.743 n=4+4) DecoderFunc_Decode-2 2.57µs ± 2% 2.64µs ± 8% ~ (p=0.310 n=5+5) Decoder_Decode_json-2 30.3µs ± 1% 29.6µs ± 2% ~ (p=0.151 n=5+5) Decoder_Decode_queryObject-2 6.36µs ± 2% 6.54µs ± 1% +2.82% (p=0.016 n=5+5) Decoder_Decode_jsonParam-2 2.35µs ± 2% 2.40µs ± 1% +2.15% (p=0.016 n=5+5) DecoderFactory_SetDecoderFunc-2 2.12µs ± 1% 2.15µs ± 1% +1.34% (p=0.016 n=5+5) pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 14.3µs ± 5% 14.3µs ± 1% ~ (p=0.310 n=5+5) Middleware_control-2 4.18µs ± 3% 4.36µs ±13% ~ (p=0.246 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.50kB ± 0% 2.50kB ± 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.3kB ± 0% 12.3kB ± 0% ~ (all equal) Decoder_Decode_queryObject-2 2.00kB ± 0% 2.00kB ± 0% ~ (all equal) Decoder_Decode_jsonParam-2 720B ± 0% 720B ± 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 ± 4% 1.11kB ± 3% -4.28% (p=0.040 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 169 ± 0% 169 ± 0% ~ (all equal) Decoder_Decode_queryObject-2 36.0 ± 0% 36.0 ± 0% ~ (all equal) Decoder_Decode_jsonParam-2 12.0 ± 0% 12.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) ```
github-actions[bot] commented 3 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.8µs ± 2% 23.9µs ± 1% ~ (p=0.886 n=4+4) _directGzipHead-2 24.5µs ± 3% 23.4µs ± 4% ~ (p=0.095 n=5+5) _noDirectGzip-2 129µs ± 2% 127µs ± 1% ~ (p=0.056 n=5+5) _directGzip_decode-2 469µs ± 1% 461µs ± 1% -1.75% (p=0.032 n=5+5) _noDirectGzip_decode-2 129µs ± 1% 127µs ± 1% -1.01% (p=0.032 n=5+5) _jsonBody-2 43.3µs ± 1% 40.8µs ± 2% -5.72% (p=0.008 n=5+5) _jsonBodyValidation-2 51.1µs ± 3% 48.1µs ± 4% -5.75% (p=0.016 n=5+5) _outputHeaders-2 23.6µs ± 3% 22.9µs ± 2% -2.93% (p=0.032 n=5+5) _validation-2 46.5µs ± 2% 45.2µs ± 2% ~ (p=0.151 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 26.0µs ± 3% 25.9µs ± 1% ~ (p=1.000 n=5+4) _ok-2 27.4µs ± 1% 27.3µs ± 2% ~ (p=0.905 n=4+5) _invalidBody-2 39.8µs ± 3% 40.2µs ± 2% ~ (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) _validation-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) _validation-2 170 ± 0% 170 ± 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.0k ± 2% 41.8k ± 1% ~ (p=0.886 n=4+4) _directGzipHead-2 40.8k ± 3% 42.8k ± 3% ~ (p=0.095 n=5+5) _noDirectGzip-2 7.73k ± 2% 7.85k ± 1% ~ (p=0.056 n=5+5) _directGzip_decode-2 2.13k ± 1% 2.17k ± 1% +1.77% (p=0.032 n=5+5) _noDirectGzip_decode-2 7.77k ± 1% 7.85k ± 1% +1.01% (p=0.032 n=5+5) _jsonBody-2 23.1k ± 1% 24.5k ± 2% +6.08% (p=0.008 n=5+5) _jsonBodyValidation-2 19.6k ± 3% 20.8k ± 4% +6.12% (p=0.016 n=5+5) _outputHeaders-2 42.5k ± 3% 43.7k ± 2% +3.02% (p=0.032 n=5+5) _validation-2 21.5k ± 2% 22.1k ± 2% ~ (p=0.151 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 38.4k ± 2% 38.6k ± 1% ~ (p=1.000 n=5+4) _ok-2 36.5k ± 1% 36.6k ± 2% ~ (p=0.905 n=4+5) _invalidBody-2 25.1k ± 3% 24.9k ± 2% ~ (p=0.548 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.86kB ± 0% 3.86kB ± 0% ~ (p=0.278 n=5+5) _directGzipHead-2 3.86kB ± 0% 3.86kB ± 0% ~ (p=0.683 n=5+5) _noDirectGzip-2 6.06kB ±20% 5.76kB ±18% ~ (p=0.310 n=5+5) _directGzip_decode-2 402kB ± 0% 402kB ± 0% ~ (p=0.651 n=5+5) _noDirectGzip_decode-2 5.24kB ± 4% 5.09kB ± 3% ~ (p=0.151 n=5+5) _jsonBody-2 11.7kB ± 0% 11.7kB ± 0% ~ (p=0.611 n=5+5) _jsonBodyValidation-2 18.2kB ± 0% 18.2kB ± 0% -0.03% (p=0.040 n=5+5) _outputHeaders-2 3.63kB ± 0% 3.63kB ± 0% ~ (p=0.992 n=5+5) _validation-2 16.2kB ± 0% 16.2kB ± 0% ~ (p=0.587 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 4.81kB ± 0% 4.81kB ± 0% ~ (p=0.190 n=5+5) _ok-2 4.72kB ± 0% 4.72kB ± 0% ~ (p=0.457 n=4+4) _invalidBody-2 8.62kB ± 0% 8.62kB ± 0% ~ (p=0.486 n=4+4) name old allocs/op new allocs/op delta pkg:github.com/swaggest/rest/_examples/advanced goos:linux goarch:amd64 _directGzip-2 40.0 ± 0% 40.0 ± 0% ~ (all equal) _directGzipHead-2 40.0 ± 0% 40.0 ± 0% ~ (all equal) _noDirectGzip-2 47.4 ± 3% 47.4 ± 3% ~ (p=1.000 n=5+5) _directGzip_decode-2 497 ± 0% 497 ± 0% ~ (all equal) _noDirectGzip_decode-2 48.0 ± 0% 48.0 ± 0% ~ (all equal) _jsonBody-2 103 ± 0% 103 ± 0% ~ (all equal) _jsonBodyValidation-2 144 ± 0% 144 ± 0% ~ (all equal) _outputHeaders-2 35.0 ± 0% 35.0 ± 0% ~ (all equal) _validation-2 131 ± 0% 131 ± 0% ~ (all equal) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 52.0 ± 0% 52.0 ± 0% ~ (all equal) _ok-2 48.0 ± 0% 48.0 ± 0% ~ (all equal) _invalidBody-2 99.0 ± 0% 99.0 ± 0% ~ (all equal) ```