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

Remove unused field, update deps and CI #77

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 98 6672 (-2) 4835 (-2) 452 1385 775 161.6K (-44B)
YAML 10 677 (+2) 594 (+2) 46 37 0 21.3K (+363B)
github-actions[bot] commented 2 years ago

Unit Test Coverage

total: (statements) 82.9%

Coverage diff with base branch ```diff ```
github-actions[bot] commented 2 years ago

Go API Changes

# summary
Inferred base version: v0.2.28
Suggested version: v0.3.0
codecov[bot] commented 2 years ago

Codecov Report

Merging #77 (88aef39) into master (ee3e4a9) will increase coverage by 0.20%. The diff coverage is n/a.

@@            Coverage Diff             @@
##           master      #77      +/-   ##
==========================================
+ Coverage   76.85%   77.06%   +0.20%     
==========================================
  Files          27       27              
  Lines        1387     1347      -40     
==========================================
- Hits         1066     1038      -28     
+ Misses        207      200       -7     
+ Partials      114      109       -5     
Flag Coverage Δ
unittests 77.06% <ø> (+0.20%) :arrow_up:

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

Impacted Files Coverage Δ
response/gzip/middleware.go 85.41% <ø> (+7.00%) :arrow_up:

: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.24µs ± 5% 1.31µs ±19% ~ (p=0.452 n=5+5) pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 672ns ± 5% 682ns ± 7% ~ (p=0.690 n=5+5) DecoderFunc_Decode-2 1.93µs ± 6% 1.97µs ± 6% ~ (p=0.421 n=5+5) Decoder_Decode_json-2 22.4µs ±27% 21.4µs ± 4% ~ (p=0.841 n=5+5) Decoder_Decode_queryObject-2 4.73µs ± 3% 4.57µs ± 4% ~ (p=0.151 n=5+5) Decoder_Decode_jsonParam-2 1.74µs ± 2% 1.70µs ± 4% ~ (p=0.310 n=5+5) DecoderFactory_SetDecoderFunc-2 1.60µs ± 3% 1.63µs ± 1% ~ (p=1.000 n=5+5) pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 10.6µs ± 5% 10.8µs ± 3% ~ (p=0.222 n=5+5) Middleware_control-2 3.17µs ± 0% 3.11µs ± 2% ~ (p=0.095 n=4+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.14kB ± 2% 1.19kB ± 3% +4.17% (p=0.008 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.31µs ±19% pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 682ns ± 7% DecoderFunc_Decode-2 1.97µs ± 6% Decoder_Decode_json-2 21.4µs ± 4% Decoder_Decode_queryObject-2 4.57µs ± 4% Decoder_Decode_jsonParam-2 1.70µs ± 4% DecoderFactory_SetDecoderFunc-2 1.63µs ± 1% pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 10.8µs ± 3% Middleware_control-2 3.11µ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.19kB ± 3% 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 26.6µs ±15% 27.3µs ± 4% ~ (p=0.151 n=5+5) _directGzipHead-2 25.8µs ± 3% 27.1µs ± 3% +5.11% (p=0.008 n=5+5) _noDirectGzip-2 137µs ± 1% 142µs ± 0% +4.11% (p=0.008 n=5+5) _directGzip_decode-2 491µs ± 1% 525µs ± 3% +6.92% (p=0.008 n=5+5) _noDirectGzip_decode-2 134µs ± 1% 149µs ± 7% +11.71% (p=0.008 n=5+5) _jsonBody-2 48.1µs ± 3% 51.2µs ± 2% +6.54% (p=0.008 n=5+5) _jsonBodyValidation-2 58.7µs ± 3% 59.2µs ± 2% ~ (p=0.841 n=5+5) _outputHeaders-2 26.8µs ± 1% 27.0µs ± 1% ~ (p=0.310 n=5+5) _requestResponseMapping-2 50.4µs ± 5% 52.0µs ± 4% ~ (p=0.095 n=5+5) _validation-2 54.4µs ± 3% 55.7µs ± 3% ~ (p=0.222 n=5+5) _noValidation-2 38.6µs ± 1% 39.8µs ± 4% ~ (p=0.222 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 27.8µs ±12% 28.2µs ±12% ~ (p=0.548 n=5+5) _directGzipHead-2 27.1µs ± 1% 25.7µs ± 2% -5.11% (p=0.008 n=5+5) _noDirectGzip-2 143µs ± 2% 139µs ± 4% ~ (p=0.151 n=5+5) _directGzip_decode-2 524µs ± 2% 522µs ± 1% ~ (p=1.000 n=5+5) _noDirectGzip_decode-2 142µs ± 1% 143µs ± 1% ~ (p=0.310 n=5+5) _jsonBody-2 49.7µs ± 2% 49.3µs ± 2% ~ (p=0.310 n=5+5) _jsonBodyValidation-2 57.5µs ± 2% 57.7µs ± 2% ~ (p=0.690 n=5+5) _outputHeaders-2 26.2µs ± 1% 25.0µs ± 2% -4.53% (p=0.008 n=5+5) _requestResponseMapping-2 49.9µs ± 2% 49.6µs ± 3% ~ (p=0.548 n=5+5) _validation-2 53.8µs ± 5% 51.3µs ± 1% -4.71% (p=0.008 n=5+5) _noValidation-2 38.5µs ± 2% 37.2µs ± 2% -3.42% (p=0.008 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 29.8µs ± 1% 29.5µs ±12% ~ (p=0.190 n=4+5) _ok-2 30.0µs ± 3% 29.3µs ± 3% ~ (p=0.222 n=5+5) _invalidBody-2 41.2µs ± 2% 41.8µs ± 2% ~ (p=0.095 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 37.8k ±13% 36.7k ± 4% ~ (p=0.151 n=5+5) _directGzipHead-2 38.8k ± 3% 36.9k ± 3% -4.88% (p=0.008 n=5+5) _noDirectGzip-2 7.31k ± 1% 7.02k ± 0% -3.96% (p=0.008 n=5+5) _directGzip_decode-2 2.03k ± 1% 1.90k ± 3% -6.44% (p=0.008 n=5+5) _noDirectGzip_decode-2 7.49k ± 1% 6.71k ± 7% -10.37% (p=0.008 n=5+5) _jsonBody-2 20.8k ± 3% 19.5k ± 2% -6.18% (p=0.008 n=5+5) _jsonBodyValidation-2 17.1k ± 3% 16.9k ± 2% ~ (p=0.841 n=5+5) _outputHeaders-2 37.3k ± 1% 37.0k ± 1% ~ (p=0.310 n=5+5) _requestResponseMapping-2 19.8k ± 5% 19.2k ± 4% ~ (p=0.095 n=5+5) _validation-2 18.4k ± 3% 18.0k ± 3% ~ (p=0.222 n=5+5) _noValidation-2 25.9k ± 1% 25.1k ± 4% ~ (p=0.222 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 36.0k ±11% 35.6k ±11% ~ (p=0.548 n=5+5) _directGzipHead-2 36.9k ± 1% 38.9k ± 2% +5.38% (p=0.008 n=5+5) _noDirectGzip-2 7.00k ± 2% 7.21k ± 4% ~ (p=0.151 n=5+5) _directGzip_decode-2 1.91k ± 2% 1.91k ± 1% ~ (p=1.000 n=5+5) _noDirectGzip_decode-2 7.03k ± 1% 6.99k ± 1% ~ (p=0.310 n=5+5) _jsonBody-2 20.1k ± 1% 20.3k ± 2% ~ (p=0.310 n=5+5) _jsonBodyValidation-2 17.4k ± 2% 17.3k ± 2% ~ (p=0.690 n=5+5) _outputHeaders-2 38.2k ± 1% 40.0k ± 2% +4.75% (p=0.008 n=5+5) _requestResponseMapping-2 20.1k ± 2% 20.2k ± 3% ~ (p=0.548 n=5+5) _validation-2 18.6k ± 5% 19.5k ± 1% +4.88% (p=0.008 n=5+5) _noValidation-2 26.0k ± 2% 26.9k ± 2% +3.54% (p=0.008 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 33.5k ± 1% 34.0k ±11% ~ (p=0.190 n=4+5) _ok-2 33.4k ± 3% 34.2k ± 3% ~ (p=0.222 n=5+5) _invalidBody-2 24.3k ± 2% 23.9k ± 2% ~ (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.92kB ± 0% 3.92kB ± 0% ~ (p=0.571 n=5+5) _directGzipHead-2 3.92kB ± 0% 3.92kB ± 0% ~ (p=0.056 n=5+5) _noDirectGzip-2 6.69kB ±21% 6.87kB ±14% ~ (p=1.000 n=5+5) _directGzip_decode-2 403kB ± 0% 403kB ± 0% ~ (p=0.889 n=5+5) _noDirectGzip_decode-2 5.62kB ± 4% 5.81kB ± 8% ~ (p=0.421 n=5+5) _jsonBody-2 13.2kB ± 0% 13.2kB ± 0% ~ (p=0.357 n=5+5) _jsonBodyValidation-2 19.0kB ± 0% 19.0kB ± 0% ~ (p=0.810 n=5+5) _outputHeaders-2 3.71kB ± 0% 3.71kB ± 0% ~ (p=0.325 n=5+5) _requestResponseMapping-2 16.7kB ± 0% 16.7kB ± 0% ~ (p=0.143 n=5+5) _validation-2 16.6kB ± 0% 16.6kB ± 0% ~ (p=0.738 n=5+5) _noValidation-2 7.88kB ± 0% 7.88kB ± 0% ~ (p=0.262 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 3.94kB ± 0% 3.94kB ± 0% ~ (p=0.143 n=5+5) _directGzipHead-2 3.94kB ± 0% 3.94kB ± 0% ~ (p=0.921 n=5+5) _noDirectGzip-2 6.95kB ±28% 6.68kB ±24% ~ (p=1.000 n=5+5) _directGzip_decode-2 403kB ± 0% 403kB ± 0% ~ (p=0.421 n=5+5) _noDirectGzip_decode-2 5.72kB ± 4% 6.00kB ± 6% ~ (p=0.095 n=5+5) _jsonBody-2 13.4kB ± 0% 13.4kB ± 0% ~ (p=0.706 n=5+5) _jsonBodyValidation-2 19.1kB ± 0% 19.1kB ± 0% ~ (p=0.238 n=5+5) _outputHeaders-2 3.71kB ± 0% 3.71kB ± 0% ~ (p=1.000 n=4+5) _requestResponseMapping-2 16.7kB ± 0% 16.7kB ± 0% ~ (p=0.825 n=5+5) _validation-2 16.6kB ± 0% 16.6kB ± 0% ~ (p=0.063 n=5+5) _noValidation-2 7.92kB ± 0% 7.92kB ± 0% ~ (p=0.206 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.587 n=5+5) _ok-2 4.78kB ± 0% 4.78kB ± 0% ~ (p=0.086 n=4+4) _invalidBody-2 8.67kB ± 0% 8.67kB ± 0% ~ (p=0.657 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 501 ± 0% 501 ± 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 43.0 ± 0% 43.0 ± 0% ~ (all equal) _directGzipHead-2 43.0 ± 0% 43.0 ± 0% ~ (all equal) _noDirectGzip-2 50.8 ± 4% 50.6 ± 3% ~ (p=1.000 n=5+5) _directGzip_decode-2 502 ± 0% 501 ± 0% ~ (p=0.095 n=4+5) _noDirectGzip_decode-2 51.0 ± 0% 51.0 ± 0% ~ (all equal) _jsonBody-2 131 ± 0% 131 ± 0% ~ (all equal) _jsonBodyValidation-2 187 ± 0% 187 ± 0% ~ (all equal) _outputHeaders-2 37.0 ± 0% 37.0 ± 0% ~ (all equal) _requestResponseMapping-2 127 ± 0% 127 ± 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 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) ```