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

Add example of global additionalProperties: false #70

Closed vearutop closed 2 years ago

vearutop commented 2 years ago

This PR adds an example of global schema interceptor to set additionalProperties: false for all relevant schemas.

    // An example of global schema override to disable additionalProperties for all object schemas.
    s.OpenAPICollector.Reflector().DefaultOptions = append(s.OpenAPICollector.Reflector().DefaultOptions, func(rc *jsonschema.ReflectContext) {
        it := rc.InterceptType
        rc.InterceptType = func(value reflect.Value, schema *jsonschema.Schema) (bool, error) {
            stop, err := it(value, schema)
            if err != nil {
                return stop, err
            }

            if schema.HasType(jsonschema.Object) && len(schema.Properties) > 0 && schema.AdditionalProperties == nil {
                schema.AdditionalProperties = (&jsonschema.SchemaOrBool{}).WithTypeBoolean(false)
            }

            return stop, nil
        }
    })
github-actions[bot] commented 2 years ago

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 98 6462 (+37) 4690 (+29) 429 (+2) 1343 (+6) 730 (+12) 156.2K (+1.4K)
JSON 3 1267 (+60) 1267 (+60) 0 0 0 51.7K (+2K)
Markdown 3 404 (+4) 312 (+3) 0 92 (+1) 0 13.9K (+392B)
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 #70 (0d37bb9) into master (ca614ae) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master      #70   +/-   ##
=======================================
  Coverage   76.81%   76.81%           
=======================================
  Files          27       27           
  Lines        1324     1324           
=======================================
  Hits         1017     1017           
  Misses        194      194           
  Partials      113      113           
Flag Coverage Δ
unittests 76.81% <ø> (ø)

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

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

github-actions[bot] commented 2 years ago

Go API Changes

# github.com/swaggest/rest/web
## compatible changes
Service.ResponseValidatorFactory: added

# summary
Inferred base version: v0.2.24
Suggested version: v0.3.0
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.79µs ± 4% 1.77µs ± 4% ~ (p=1.000 n=5+5) pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 906ns ± 2% 900ns ± 2% ~ (p=0.690 n=5+5) DecoderFunc_Decode-2 2.73µs ± 4% 2.51µs ± 3% -8.07% (p=0.008 n=5+5) Decoder_Decode_json-2 29.1µs ± 3% 26.7µs ± 1% -8.00% (p=0.008 n=5+5) Decoder_Decode_queryObject-2 5.88µs ± 2% 5.84µs ± 2% ~ (p=0.595 n=5+5) Decoder_Decode_jsonParam-2 2.14µs ± 1% 2.17µs ± 2% ~ (p=0.214 n=5+5) DecoderFactory_SetDecoderFunc-2 1.98µs ± 2% 1.95µs ± 2% ~ (p=0.206 n=5+5) pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 13.7µs ± 1% 14.2µs ± 6% ~ (p=0.690 n=5+5) Middleware_control-2 4.01µs ±14% 4.44µs ± 5% ~ (p=0.056 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.15kB ± 2% 1.16kB ± 4% ~ (p=0.310 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.77µs ± 4% pkg:github.com/swaggest/rest/request goos:linux goarch:amd64 Decoder_Decode-2 900ns ± 2% DecoderFunc_Decode-2 2.51µs ± 3% Decoder_Decode_json-2 26.7µs ± 1% Decoder_Decode_queryObject-2 5.84µs ± 2% Decoder_Decode_jsonParam-2 2.17µs ± 2% DecoderFactory_SetDecoderFunc-2 1.95µs ± 2% pkg:github.com/swaggest/rest/response/gzip goos:linux goarch:amd64 Middleware-2 14.2µs ± 6% Middleware_control-2 4.44µs ± 5% 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 ± 4% 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 27.0µs ± 1% 28.2µs ±10% ~ (p=0.063 n=4+5) _directGzipHead-2 28.2µs ± 7% 27.7µs ± 2% ~ (p=0.651 n=5+5) _noDirectGzip-2 152µs ± 2% 632µs ± 2% +317.05% (p=0.008 n=5+5) _directGzip_decode-2 537µs ± 1% 561µs ± 6% ~ (p=0.151 n=5+5) _noDirectGzip_decode-2 151µs ± 2% 682µs ± 8% +350.35% (p=0.008 n=5+5) _jsonBody-2 50.8µs ± 3% 52.2µs ± 2% +2.88% (p=0.016 n=5+5) _jsonBodyValidation-2 59.4µs ± 3% 59.4µs ± 2% ~ (p=0.841 n=5+5) _outputHeaders-2 27.0µs ± 1% 32.9µs ± 2% +21.95% (p=0.008 n=5+5) _requestResponseMapping-2 51.2µs ± 1% 51.0µs ± 2% ~ (p=0.310 n=5+5) _validation-2 54.5µs ± 2% 54.5µs ± 3% ~ (p=0.690 n=5+5) _noValidation-2 35.0µs ± 3% 44.4µs ± 3% +27.12% (p=0.008 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 27.4µs ± 1% 28.3µs ±13% ~ (p=0.730 n=4+5) _directGzipHead-2 27.9µs ± 3% 27.6µs ± 4% ~ (p=0.310 n=5+5) _noDirectGzip-2 156µs ±10% 626µs ± 2% +301.90% (p=0.008 n=5+5) _directGzip_decode-2 542µs ± 3% 533µs ± 2% ~ (p=0.151 n=5+5) _noDirectGzip_decode-2 152µs ± 2% 630µs ± 1% +313.41% (p=0.008 n=5+5) _jsonBody-2 52.5µs ± 1% 52.3µs ± 3% ~ (p=0.690 n=5+5) _jsonBodyValidation-2 59.9µs ± 1% 59.9µs ± 2% ~ (p=1.000 n=5+5) _outputHeaders-2 27.3µs ± 1% 32.3µs ± 2% +18.46% (p=0.008 n=5+5) _requestResponseMapping-2 51.7µs ± 3% 50.3µs ± 2% ~ (p=0.095 n=5+5) _validation-2 54.8µs ± 3% 55.2µs ± 2% ~ (p=0.548 n=5+5) _noValidation-2 35.6µs ± 2% 45.0µs ± 2% +26.51% (p=0.008 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 30.7µs ± 0% 31.1µs ± 1% +1.22% (p=0.008 n=5+5) _ok-2 31.3µs ± 1% 31.5µs ± 1% ~ (p=0.286 n=5+4) _invalidBody-2 44.9µs ± 0% 45.4µ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 35.9k ±12% 35.6k ±10% ~ (p=0.310 n=5+5) _directGzipHead-2 35.5k ± 7% 36.1k ± 2% ~ (p=0.690 n=5+5) _noDirectGzip-2 6.60k ± 2% 1.58k ± 2% -76.02% (p=0.008 n=5+5) _directGzip_decode-2 1.86k ± 1% 1.79k ± 6% ~ (p=0.151 n=5+5) _noDirectGzip_decode-2 6.60k ± 2% 1.47k ± 8% -77.76% (p=0.008 n=5+5) _jsonBody-2 19.7k ± 3% 19.2k ± 2% -2.83% (p=0.016 n=5+5) _jsonBodyValidation-2 16.8k ± 3% 16.8k ± 2% ~ (p=0.841 n=5+5) _outputHeaders-2 37.1k ± 1% 30.4k ± 2% -17.97% (p=0.008 n=5+5) _requestResponseMapping-2 19.5k ± 1% 19.6k ± 2% ~ (p=0.310 n=5+5) _validation-2 18.3k ± 2% 18.3k ± 3% ~ (p=0.690 n=5+5) _noValidation-2 28.6k ± 3% 22.5k ± 3% -21.32% (p=0.008 n=5+5) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 36.5k ± 1% 35.5k ±12% ~ (p=0.730 n=4+5) _directGzipHead-2 35.9k ± 3% 36.2k ± 4% ~ (p=0.310 n=5+5) _noDirectGzip-2 6.44k ± 9% 1.60k ± 2% -75.18% (p=0.008 n=5+5) _directGzip_decode-2 1.84k ± 3% 1.88k ± 2% ~ (p=0.151 n=5+5) _noDirectGzip_decode-2 6.57k ± 2% 1.59k ± 1% -75.81% (p=0.008 n=5+5) _jsonBody-2 19.0k ± 1% 19.1k ± 3% ~ (p=0.690 n=5+5) _jsonBodyValidation-2 16.7k ± 1% 16.7k ± 2% ~ (p=1.000 n=5+5) _outputHeaders-2 36.6k ± 1% 30.9k ± 2% -15.57% (p=0.008 n=5+5) _requestResponseMapping-2 19.4k ± 3% 19.9k ± 2% ~ (p=0.095 n=5+5) _validation-2 18.3k ± 3% 18.1k ± 2% ~ (p=0.548 n=5+5) _noValidation-2 28.1k ± 2% 22.2k ± 2% -20.94% (p=0.008 n=5+5) pkg:github.com/swaggest/rest/_examples/task-api/internal/infra/nethttp goos:linux goarch:amd64 _notFoundSrv-2 32.6k ± 0% 32.2k ± 1% -1.20% (p=0.008 n=5+5) _ok-2 31.9k ± 1% 31.7k ± 1% ~ (p=0.286 n=5+4) _invalidBody-2 22.3k ± 0% 22.0k ± 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.93kB ± 0% 3.92kB ± 0% ~ (p=0.143 n=5+4) _directGzipHead-2 3.92kB ± 0% 3.92kB ± 0% ~ (p=0.992 n=5+5) _noDirectGzip-2 6.53kB ±20% 388.04kB ± 2% +5845.56% (p=0.008 n=5+5) _directGzip_decode-2 403kB ± 0% 403kB ± 0% ~ (p=0.690 n=5+5) _noDirectGzip_decode-2 5.32kB ± 6% 386.68kB ± 1% +7163.17% (p=0.008 n=5+5) _jsonBody-2 13.2kB ± 0% 13.2kB ± 0% ~ (p=0.603 n=5+5) _jsonBodyValidation-2 19.0kB ± 0% 19.0kB ± 0% ~ (p=0.825 n=5+5) _outputHeaders-2 3.71kB ± 0% 6.54kB ± 0% +76.20% (p=0.016 n=4+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.825 n=5+5) _noValidation-2 6.15kB ± 0% 11.03kB ± 0% +79.47% (p=0.016 n=5+4) pkg:github.com/swaggest/rest/_examples/advanced-generic goos:linux goarch:amd64 _directGzip-2 3.94kB ± 0% 3.94kB ± 0% ~ (p=0.302 n=5+5) _directGzipHead-2 3.94kB ± 0% 3.94kB ± 0% -0.05% (p=0.000 n=5+4) _noDirectGzip-2 6.48kB ±15% 386.65kB ± 1% +5867.70% (p=0.008 n=5+5) _directGzip_decode-2 403kB ± 0% 403kB ± 0% ~ (p=0.841 n=5+5) _noDirectGzip_decode-2 5.62kB ±18% 382.11kB ± 1% +6694.92% (p=0.008 n=5+5) _jsonBody-2 13.3kB ± 0% 13.3kB ± 0% +0.02% (p=0.032 n=5+5) _jsonBodyValidation-2 19.0kB ± 0% 19.0kB ± 0% ~ (p=0.357 n=5+5) _outputHeaders-2 3.71kB ± 0% 6.54kB ± 0% +76.17% (p=0.008 n=5+5) _requestResponseMapping-2 16.7kB ± 0% 16.7kB ± 0% ~ (p=0.317 n=5+5) _validation-2 16.6kB ± 0% 16.6kB ± 0% +0.03% (p=0.048 n=5+5) _noValidation-2 6.18kB ± 0% 11.07kB ± 0% +79.04% (p=0.008 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.278 n=5+5) _ok-2 4.78kB ± 0% 4.78kB ± 0% ~ (p=0.229 n=4+4) _invalidBody-2 8.67kB ± 0% 8.67kB ± 0% ~ (p=0.971 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% 894.0 ± 0% +1695.18% (p=0.016 n=5+4) _directGzip_decode-2 501 ± 0% 501 ± 0% ~ (p=1.000 n=5+5) _noDirectGzip_decode-2 50.0 ± 0% 896.0 ± 0% +1692.00% (p=0.008 n=5+5) _jsonBody-2 127 ± 0% 127 ± 0% ~ (all equal) _jsonBodyValidation-2 183 ± 0% 183 ± 0% ~ (all equal) _outputHeaders-2 37.0 ± 0% 49.0 ± 0% +32.43% (p=0.008 n=5+5) _requestResponseMapping-2 123 ± 0% 123 ± 0% ~ (all equal) _validation-2 152 ± 0% 152 ± 0% ~ (all equal) _noValidation-2 72.0 ± 0% 106.0 ± 0% +47.22% (p=0.008 n=5+5) 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% 895.0 ± 0% +1661.81% (p=0.008 n=5+5) _directGzip_decode-2 502 ± 0% 502 ± 0% ~ (p=0.651 n=5+4) _noDirectGzip_decode-2 51.0 ± 0% 896.6 ± 0% +1658.04% (p=0.008 n=5+5) _jsonBody-2 128 ± 0% 128 ± 0% ~ (all equal) _jsonBodyValidation-2 184 ± 0% 184 ± 0% ~ (all equal) _outputHeaders-2 37.0 ± 0% 49.0 ± 0% +32.43% (p=0.008 n=5+5) _requestResponseMapping-2 124 ± 0% 124 ± 0% ~ (all equal) _validation-2 153 ± 0% 153 ± 0% ~ (all equal) _noValidation-2 73.0 ± 0% 107.0 ± 0% +46.58% (p=0.008 n=5+5) 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) ```