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 redundant packages from rest-fasthttp #87

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 90 (-9) 5414 (-1384) 3918 (-1011) 378 (-79) 1118 (-294) 531 (-269) 133.3K (-31.1K)
Go (test) 36 (-8) 3511 (-1137) 2669 (-904) 124 (-21) 718 (-212) 95 (-25) 100.4K (-28.9K)
JSON 3 1319 1319 0 0 0 54.1K (+72B)
Markdown 2 (-1) 448 (-6) 344 (-4) 0 104 (-2) 0 15.7K (-139B)
github-actions[bot] commented 2 years ago

Go API Changes

gorelease: could not find base version. Consider setting -version=v0.1.0 if this is a first release, or explicitly set -base=none: could not load versions for github.com/swaggest/rest-fasthttp: go: module github.com/swaggest/rest-fasthttp: git ls-remote -q origin in /home/runner/go/pkg/mod/cache/vcs/7a394171f84701982d42bf65d4c04a042f9aeede6129f270586b164a097305a4: exit status 128:
    fatal: could not read Username for 'https://github.com': terminal prompts disabled
Confirm the import path was entered correctly.
If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.
github-actions[bot] commented 2 years ago

Unit Test Coverage

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

Coverage of changed lines | File | Function | Coverage | |--------------------------------|------------------------------|----------| | Total | | 89.2% | | chirouter/path_decoder.go | | 83.3% | | chirouter/path_decoder.go:11 | PathToURLValues | 83.3% | | chirouter/wrapper.go | | 97.1% | | chirouter/wrapper.go:12 | NewWrapper | 100.0% | | chirouter/wrapper.go:32 | copy | 100.0% | | chirouter/wrapper.go:53 | Use | 100.0% | | chirouter/wrapper.go:59 | With | 100.0% | | chirouter/wrapper.go:67 | Group | 100.0% | | chirouter/wrapper.go:78 | Route | 100.0% | | chirouter/wrapper.go:91 | Mount | 100.0% | | chirouter/wrapper.go:98 | Handle | 100.0% | | chirouter/wrapper.go:105 | Method | 100.0% | | chirouter/wrapper.go:112 | Connect | 100.0% | | chirouter/wrapper.go:117 | Delete | 100.0% | | chirouter/wrapper.go:122 | Get | 100.0% | | chirouter/wrapper.go:127 | Head | 100.0% | | chirouter/wrapper.go:132 | Options | 100.0% | | chirouter/wrapper.go:137 | Patch | 100.0% | | chirouter/wrapper.go:142 | Post | 100.0% | | chirouter/wrapper.go:147 | Put | 100.0% | | chirouter/wrapper.go:152 | Trace | 100.0% | | chirouter/wrapper.go:160 | captureHandler | 100.0% | | chirouter/wrapper.go:164 | prepareHandler | 100.0% | | chirouter/wrapper.go:48 | Wrap | 0.0% | | fhttp/handler.go | | 96.8% | | fhttp/handler.go:86 | decodeRequest | 100.0% | | fhttp/handler.go:102 | ServeHTTP | 100.0% | | fhttp/handler.go:135 | handleErrResponseDefault | 100.0% | | fhttp/handler.go:162 | handleDecodeError | 100.0% | | fhttp/handler.go:221 | HandlerWithRouteMiddleware | 100.0% | | fhttp/handler.go:150 | handleErrResponse | 75.0% | | fhttp/openapi.go | | 100.0% | | fhttp/openapi.go:13 | OpenAPIMiddleware | 100.0% | | fhttp/openapi.go:40 | SecurityMiddleware | 100.0% | | fhttp/openapi.go:63 | HTTPBasicSecurityMiddleware | 100.0% | | fhttp/openapi.go:82 | HTTPBearerSecurityMiddleware | 100.0% | | fhttp/openapi.go:105 | AnnotateOpenAPI | 100.0% | | fhttp/openapi.go:141 | securityMiddleware | 100.0% | | fhttp/options.go | | 100.0% | | fhttp/options.go:13 | OptionsMiddleware | 100.0% | | fhttp/usecase.go | | 100.0% | | fhttp/usecase.go:11 | UseCaseMiddlewares | 100.0% | | fhttp/wrap.go | | 66.7% | | fhttp/wrap.go:15 | WrapHandler | 100.0% | | fhttp/wrap.go:40 | HandlerAs | 50.0% | | gzip/container.go | | 100.0% | | gzip/container.go:29 | WriteCompressedBytes | 100.0% | | request/b2s_unsafe.go | | 100.0% | | request/b2s_unsafe.go:57 | b2s | 100.0% | | request/decoder.go | | 100.0% | | request/decoder.go:58 | makeDecoder | 100.0% | | request/decoder.go:91 | Decode | 100.0% | | request/decoder.go:116 | formDataToURLValues | 100.0% | | request/decoder.go:132 | headerToURLValues | 100.0% | | request/decoder.go:142 | queryToURLValues | 100.0% | | request/decoder.go:152 | cookiesToURLValues | 100.0% | | request/factory.go | | 100.0% | | request/factory.go:72 | SetDecoderFunc | 100.0% | | request/factory.go:94 | MakeDecoder | 100.0% | | request/factory.go:234 | makeDefaultDecoder | 100.0% | | request/file.go | | 84.0% | | request/file.go:21 | decodeFiles | 100.0% | | request/file.go:62 | setFile | 83.3% | | request/file.go:27 | decodeFilesInStruct | 60.0% | | request/jsonbody.go | | 100.0% | | request/jsonbody.go:20 | decodeJSONBody | 100.0% | | request/middleware.go | | 90.0% | | request/middleware.go:20 | DecoderMiddleware | 100.0% | | request/middleware.go:58 | ValidatorMiddleware | 100.0% | | request/middleware.go:89 | Decode | 0.0% | | response/encoder.go | | 65.6% | | response/encoder.go:344 | setHeaders | 100.0% | | response/encoder.go:363 | Write | 100.0% | | response/encoder.go:272 | whiteHeader | 72.7% | | response/encoder.go:194 | WriteErrResponse | 72.2% | | response/encoder.go:308 | MakeOutput | 66.7% | | response/encoder.go:227 | WriteSuccessfulResponse | 60.0% | | response/encoder.go:131 | writeJSONResponse | 52.4% | | response/gzip/middleware.go | | 100.0% | | response/gzip/middleware.go:11 | Middleware | 100.0% | | response/middleware.go | | 80.0% | | response/middleware.go:15 | EncoderMiddleware | 80.0% | | response/validator.go | | 100.0% | | response/validator.go:17 | ValidatorMiddleware | 100.0% | | web/service.go | | 100.0% | | web/service.go:24 | DefaultService | 100.0% | | web/service.go:92 | Delete | 100.0% | | web/service.go:97 | Get | 100.0% | | web/service.go:102 | Head | 100.0% | | web/service.go:107 | Options | 100.0% | | web/service.go:112 | Patch | 100.0% | | web/service.go:117 | Post | 100.0% | | web/service.go:122 | Put | 100.0% | | web/service.go:127 | Trace | 100.0% | | web/service.go:141 | Docs | 100.0% |
Coverage diff with base branch | File | Function | Base Coverage | Current Coverage | |---------------------------------------------------------------|-------------------------------|---------------|------------------| | Total | | 83.2% | 87.2% (+4.0%) | | github.com/swaggest/rest-fasthttp/chirouter/path_decoder.go | PathToURLValues | no function | 83.3% | | github.com/swaggest/rest-fasthttp/chirouter/wrapper.go | Connect | no function | 100.0% | | github.com/swaggest/rest-fasthttp/chirouter/wrapper.go | Delete | no function | 100.0% | | github.com/swaggest/rest-fasthttp/chirouter/wrapper.go | Get | no function | 100.0% | | github.com/swaggest/rest-fasthttp/chirouter/wrapper.go | Group | no function | 100.0% | | github.com/swaggest/rest-fasthttp/chirouter/wrapper.go | Handle | no function | 100.0% | | github.com/swaggest/rest-fasthttp/chirouter/wrapper.go | Head | no function | 100.0% | | github.com/swaggest/rest-fasthttp/chirouter/wrapper.go | Method | no function | 100.0% | | github.com/swaggest/rest-fasthttp/chirouter/wrapper.go | Mount | no function | 100.0% | | github.com/swaggest/rest-fasthttp/chirouter/wrapper.go | NewWrapper | no function | 100.0% | | github.com/swaggest/rest-fasthttp/chirouter/wrapper.go | Options | no function | 100.0% | | github.com/swaggest/rest-fasthttp/chirouter/wrapper.go | Patch | no function | 100.0% | | github.com/swaggest/rest-fasthttp/chirouter/wrapper.go | Post | no function | 100.0% | | github.com/swaggest/rest-fasthttp/chirouter/wrapper.go | Put | no function | 100.0% | | github.com/swaggest/rest-fasthttp/chirouter/wrapper.go | Route | no function | 100.0% | | github.com/swaggest/rest-fasthttp/chirouter/wrapper.go | Trace | no function | 100.0% | | github.com/swaggest/rest-fasthttp/chirouter/wrapper.go | Use | no function | 100.0% | | github.com/swaggest/rest-fasthttp/chirouter/wrapper.go | With | no function | 100.0% | | github.com/swaggest/rest-fasthttp/chirouter/wrapper.go | Wrap | no function | 0.0% | | github.com/swaggest/rest-fasthttp/chirouter/wrapper.go | captureHandler | no function | 100.0% | | github.com/swaggest/rest-fasthttp/chirouter/wrapper.go | copy | no function | 100.0% | | github.com/swaggest/rest-fasthttp/chirouter/wrapper.go | prepareHandler | no function | 100.0% | | github.com/swaggest/rest-fasthttp/chirouter/wrapper.go | resolvePattern | no function | 100.0% | | github.com/swaggest/rest-fasthttp/fhttp/handler.go | HandlerWithRouteMiddleware | no function | 100.0% | | github.com/swaggest/rest-fasthttp/fhttp/handler.go | NewHandler | no function | 83.3% | | github.com/swaggest/rest-fasthttp/fhttp/handler.go | RouteMethod | no function | 100.0% | | github.com/swaggest/rest-fasthttp/fhttp/handler.go | RoutePattern | no function | 100.0% | | github.com/swaggest/rest-fasthttp/fhttp/handler.go | ServeHTTP | no function | 92.9% | | github.com/swaggest/rest-fasthttp/fhttp/handler.go | SetRequestDecoder | no function | 100.0% | | github.com/swaggest/rest-fasthttp/fhttp/handler.go | SetResponseEncoder | no function | 100.0% | | github.com/swaggest/rest-fasthttp/fhttp/handler.go | SetUseCase | no function | 100.0% | | github.com/swaggest/rest-fasthttp/fhttp/handler.go | UseCase | no function | 100.0% | | github.com/swaggest/rest-fasthttp/fhttp/handler.go | decodeRequest | no function | 71.4% | | github.com/swaggest/rest-fasthttp/fhttp/handler.go | handleDecodeError | no function | 100.0% | | github.com/swaggest/rest-fasthttp/fhttp/handler.go | handleErrResponse | no function | 75.0% | | github.com/swaggest/rest-fasthttp/fhttp/handler.go | handleErrResponseDefault | no function | 100.0% | | github.com/swaggest/rest-fasthttp/fhttp/handler.go | setupInputBuffer | no function | 100.0% | | github.com/swaggest/rest-fasthttp/fhttp/handler.go | setupOutputBuffer | no function | 100.0% | | github.com/swaggest/rest-fasthttp/fhttp/openapi.go | AnnotateOpenAPI | no function | 100.0% | | github.com/swaggest/rest-fasthttp/fhttp/openapi.go | HTTPBasicSecurityMiddleware | no function | 100.0% | | github.com/swaggest/rest-fasthttp/fhttp/openapi.go | HTTPBearerSecurityMiddleware | no function | 100.0% | | github.com/swaggest/rest-fasthttp/fhttp/openapi.go | OpenAPIMiddleware | no function | 75.0% | | github.com/swaggest/rest-fasthttp/fhttp/openapi.go | SecurityMiddleware | no function | 100.0% | | github.com/swaggest/rest-fasthttp/fhttp/openapi.go | SecurityResponse | no function | 100.0% | | github.com/swaggest/rest-fasthttp/fhttp/openapi.go | securityMiddleware | no function | 100.0% | | github.com/swaggest/rest-fasthttp/fhttp/options.go | AnnotateOperation | no function | 100.0% | | github.com/swaggest/rest-fasthttp/fhttp/options.go | OptionsMiddleware | no function | 100.0% | | github.com/swaggest/rest-fasthttp/fhttp/options.go | RequestMapping | no function | 100.0% | | github.com/swaggest/rest-fasthttp/fhttp/options.go | ResponseHeaderMapping | no function | 77.8% | | github.com/swaggest/rest-fasthttp/fhttp/options.go | SuccessStatus | no function | 0.0% | | github.com/swaggest/rest-fasthttp/fhttp/options.go | SuccessfulResponseContentType | no function | 100.0% | | github.com/swaggest/rest-fasthttp/fhttp/usecase.go | UseCaseMiddlewares | no function | 90.9% | | github.com/swaggest/rest-fasthttp/fhttp/wrap.go | HandlerAs | no function | 81.8% | | github.com/swaggest/rest-fasthttp/fhttp/wrap.go | String | no function | 0.0% | | github.com/swaggest/rest-fasthttp/fhttp/wrap.go | WrapHandler | no function | 83.3% | | github.com/swaggest/rest-fasthttp/gzip/container.go | ETag | no function | 100.0% | | github.com/swaggest/rest-fasthttp/gzip/container.go | GzipCompressedJSON | no function | 100.0% | | github.com/swaggest/rest-fasthttp/gzip/container.go | JSONWriteTo | no function | 100.0% | | github.com/swaggest/rest-fasthttp/gzip/container.go | MarshalJSON | no function | 83.3% | | github.com/swaggest/rest-fasthttp/gzip/container.go | PackJSON | no function | 83.3% | | github.com/swaggest/rest-fasthttp/gzip/container.go | UnmarshalJSON | no function | 77.8% | | github.com/swaggest/rest-fasthttp/gzip/container.go | UnpackJSON | no function | 100.0% | | github.com/swaggest/rest-fasthttp/gzip/container.go | WriteCompressedBytes | no function | 90.0% | | github.com/swaggest/rest-fasthttp/request/b2s_unsafe.go | b2s | no function | 100.0% | | github.com/swaggest/rest-fasthttp/request/decoder.go | Decode | no function | 100.0% | | github.com/swaggest/rest-fasthttp/request/decoder.go | cookiesToURLValues | no function | 100.0% | | github.com/swaggest/rest-fasthttp/request/decoder.go | decodeValidate | no function | 76.9% | | github.com/swaggest/rest-fasthttp/request/decoder.go | formDataToURLValues | no function | 100.0% | | github.com/swaggest/rest-fasthttp/request/decoder.go | headerToURLValues | no function | 100.0% | | github.com/swaggest/rest-fasthttp/request/decoder.go | makeDecoder | no function | 91.7% | | github.com/swaggest/rest-fasthttp/request/decoder.go | queryToURLValues | no function | 100.0% | | github.com/swaggest/rest-fasthttp/request/factory.go | MakeDecoder | no function | 96.2% | | github.com/swaggest/rest-fasthttp/request/factory.go | NewDecoderFactory | no function | 100.0% | | github.com/swaggest/rest-fasthttp/request/factory.go | RegisterFunc | no function | 0.0% | | github.com/swaggest/rest-fasthttp/request/factory.go | SetDecoderFunc | no function | 100.0% | | github.com/swaggest/rest-fasthttp/request/factory.go | jsonParams | no function | 85.7% | | github.com/swaggest/rest-fasthttp/request/factory.go | makeCustomMappingDecoder | no function | 93.3% | | github.com/swaggest/rest-fasthttp/request/factory.go | makeDefaultDecoder | no function | 100.0% | | github.com/swaggest/rest-fasthttp/request/factory.go | prepareCustomMapping | no function | 100.0% | | github.com/swaggest/rest-fasthttp/request/file.go | decodeFiles | no function | 100.0% | | github.com/swaggest/rest-fasthttp/request/file.go | decodeFilesInStruct | no function | 81.2% | | github.com/swaggest/rest-fasthttp/request/file.go | setFile | no function | 75.7% | | github.com/swaggest/rest-fasthttp/request/jsonbody.go | decodeJSONBody | no function | 100.0% | | github.com/swaggest/rest-fasthttp/request/jsonbody.go | readJSON | no function | 100.0% | | github.com/swaggest/rest-fasthttp/request/middleware.go | Decode | no function | 0.0% | | github.com/swaggest/rest-fasthttp/request/middleware.go | DecoderMiddleware | no function | 90.9% | | github.com/swaggest/rest-fasthttp/request/middleware.go | ValidatorMiddleware | no function | 85.7% | | github.com/swaggest/rest-fasthttp/request/reflect.go | hasFileFields | no function | 100.0% | | github.com/swaggest/rest-fasthttp/response/encoder.go | MakeOutput | no function | 77.8% | | github.com/swaggest/rest-fasthttp/response/encoder.go | SetupOutput | no function | 82.4% | | github.com/swaggest/rest-fasthttp/response/encoder.go | Write | no function | 85.7% | | github.com/swaggest/rest-fasthttp/response/encoder.go | WriteErrResponse | no function | 72.2% | | github.com/swaggest/rest-fasthttp/response/encoder.go | WriteSuccessfulResponse | no function | 57.1% | | github.com/swaggest/rest-fasthttp/response/encoder.go | addressable | no function | 100.0% | | github.com/swaggest/rest-fasthttp/response/encoder.go | setHeaders | no function | 88.9% | | github.com/swaggest/rest-fasthttp/response/encoder.go | whiteHeader | no function | 84.2% | | github.com/swaggest/rest-fasthttp/response/encoder.go | writeJSONResponse | no function | 65.6% | | github.com/swaggest/rest-fasthttp/response/gzip/middleware.go | Middleware | no function | 100.0% | | github.com/swaggest/rest-fasthttp/response/middleware.go | EncoderMiddleware | no function | 87.5% | | github.com/swaggest/rest-fasthttp/response/validator.go | ValidatorMiddleware | no function | 83.3% | | github.com/swaggest/rest-fasthttp/web/service.go | DefaultService | no function | 100.0% | | github.com/swaggest/rest-fasthttp/web/service.go | Delete | no function | 100.0% | | github.com/swaggest/rest-fasthttp/web/service.go | Docs | no function | 100.0% | | github.com/swaggest/rest-fasthttp/web/service.go | Get | no function | 100.0% | | github.com/swaggest/rest-fasthttp/web/service.go | Head | no function | 100.0% | | github.com/swaggest/rest-fasthttp/web/service.go | Options | no function | 100.0% | | github.com/swaggest/rest-fasthttp/web/service.go | Patch | no function | 100.0% | | github.com/swaggest/rest-fasthttp/web/service.go | Post | no function | 100.0% | | github.com/swaggest/rest-fasthttp/web/service.go | Put | no function | 100.0% | | github.com/swaggest/rest-fasthttp/web/service.go | Trace | no function | 100.0% | | github.com/swaggest/rest/chirouter/path_decoder.go | PathToURLValues | 85.7% | no function | | github.com/swaggest/rest/chirouter/wrapper.go | Connect | 100.0% | no function | | github.com/swaggest/rest/chirouter/wrapper.go | Delete | 100.0% | no function | | github.com/swaggest/rest/chirouter/wrapper.go | Get | 100.0% | no function | | github.com/swaggest/rest/chirouter/wrapper.go | Group | 100.0% | no function | | github.com/swaggest/rest/chirouter/wrapper.go | Handle | 100.0% | no function | | github.com/swaggest/rest/chirouter/wrapper.go | Head | 100.0% | no function | | github.com/swaggest/rest/chirouter/wrapper.go | Method | 100.0% | no function | | github.com/swaggest/rest/chirouter/wrapper.go | MethodFunc | 100.0% | no function | | github.com/swaggest/rest/chirouter/wrapper.go | Mount | 100.0% | no function | | github.com/swaggest/rest/chirouter/wrapper.go | NewWrapper | 100.0% | no function | | github.com/swaggest/rest/chirouter/wrapper.go | Options | 100.0% | no function | | github.com/swaggest/rest/chirouter/wrapper.go | Patch | 100.0% | no function | | github.com/swaggest/rest/chirouter/wrapper.go | Post | 100.0% | no function | | github.com/swaggest/rest/chirouter/wrapper.go | Put | 100.0% | no function | | github.com/swaggest/rest/chirouter/wrapper.go | Route | 100.0% | no function | | github.com/swaggest/rest/chirouter/wrapper.go | Trace | 100.0% | no function | | github.com/swaggest/rest/chirouter/wrapper.go | Use | 100.0% | no function | | github.com/swaggest/rest/chirouter/wrapper.go | With | 100.0% | no function | | github.com/swaggest/rest/chirouter/wrapper.go | Wrap | 0.0% | no function | | github.com/swaggest/rest/chirouter/wrapper.go | captureHandler | 100.0% | no function | | github.com/swaggest/rest/chirouter/wrapper.go | copy | 100.0% | no function | | github.com/swaggest/rest/chirouter/wrapper.go | prepareHandler | 100.0% | no function | | github.com/swaggest/rest/chirouter/wrapper.go | resolvePattern | 100.0% | no function | | github.com/swaggest/rest/error.go | Err | 95.0% | no function | | github.com/swaggest/rest/error.go | Error | 66.7% | no function | | github.com/swaggest/rest/error.go | HTTPStatusFromCanonicalCode | 100.0% | no function | | github.com/swaggest/rest/error.go | Unwrap | 100.0% | no function | | github.com/swaggest/rest/gzip/container.go | ETag | 100.0% | no function | | github.com/swaggest/rest/gzip/container.go | GzipCompressedJSON | 100.0% | no function | | github.com/swaggest/rest/gzip/container.go | JSONWriteTo | 100.0% | no function | | github.com/swaggest/rest/gzip/container.go | MarshalJSON | 83.3% | no function | | github.com/swaggest/rest/gzip/container.go | PackJSON | 83.3% | no function | | github.com/swaggest/rest/gzip/container.go | UnmarshalJSON | 77.8% | no function | | github.com/swaggest/rest/gzip/container.go | UnpackJSON | 100.0% | no function | | github.com/swaggest/rest/gzip/container.go | WriteCompressedBytes | 88.9% | no function | | github.com/swaggest/rest/jsonschema/validator.go | AddSchema | 90.9% | no function | | github.com/swaggest/rest/jsonschema/validator.go | ForbidUnknownParams | 100.0% | no function | | github.com/swaggest/rest/jsonschema/validator.go | HasConstraints | 0.0% | no function | | github.com/swaggest/rest/jsonschema/validator.go | MakeRequestValidator | 80.0% | no function | | github.com/swaggest/rest/jsonschema/validator.go | MakeResponseValidator | 71.4% | no function | | github.com/swaggest/rest/jsonschema/validator.go | NewFactory | 100.0% | no function | | github.com/swaggest/rest/jsonschema/validator.go | ValidateData | 93.5% | no function | | github.com/swaggest/rest/jsonschema/validator.go | ValidateJSONBody | 83.3% | no function | | github.com/swaggest/rest/jsonschema/validator.go | appendError | 75.0% | no function | | github.com/swaggest/rest/jsonschema/validator.go | checkRequired | 100.0% | no function | | github.com/swaggest/rest/nethttp/handler.go | HandlerWithRouteMiddleware | 100.0% | no function | | github.com/swaggest/rest/nethttp/handler.go | NewHandler | 83.3% | no function | | github.com/swaggest/rest/nethttp/handler.go | RouteMethod | 100.0% | no function | | github.com/swaggest/rest/nethttp/handler.go | RoutePattern | 100.0% | no function | | github.com/swaggest/rest/nethttp/handler.go | ServeHTTP | 87.5% | no function | | github.com/swaggest/rest/nethttp/handler.go | SetRequestDecoder | 100.0% | no function | | github.com/swaggest/rest/nethttp/handler.go | SetResponseEncoder | 100.0% | no function | | github.com/swaggest/rest/nethttp/handler.go | SetUseCase | 100.0% | no function | | github.com/swaggest/rest/nethttp/handler.go | UseCase | 100.0% | no function | | github.com/swaggest/rest/nethttp/handler.go | closeMultipartForm | 0.0% | no function | | github.com/swaggest/rest/nethttp/handler.go | decodeRequest | 71.4% | no function | | github.com/swaggest/rest/nethttp/handler.go | handleDecodeError | 100.0% | no function | | github.com/swaggest/rest/nethttp/handler.go | handleErrResponse | 75.0% | no function | | github.com/swaggest/rest/nethttp/handler.go | handleErrResponseDefault | 100.0% | no function | | github.com/swaggest/rest/nethttp/handler.go | setupInputBuffer | 100.0% | no function | | github.com/swaggest/rest/nethttp/handler.go | setupOutputBuffer | 100.0% | no function | | github.com/swaggest/rest/nethttp/openapi.go | AnnotateOpenAPI | 100.0% | no function | | github.com/swaggest/rest/nethttp/openapi.go | HTTPBasicSecurityMiddleware | 100.0% | no function | | github.com/swaggest/rest/nethttp/openapi.go | HTTPBearerSecurityMiddleware | 100.0% | no function | | github.com/swaggest/rest/nethttp/openapi.go | OpenAPIMiddleware | 75.0% | no function | | github.com/swaggest/rest/nethttp/openapi.go | SecurityMiddleware | 100.0% | no function | | github.com/swaggest/rest/nethttp/openapi.go | SecurityResponse | 100.0% | no function | | github.com/swaggest/rest/nethttp/openapi.go | securityMiddleware | 100.0% | no function | | github.com/swaggest/rest/nethttp/options.go | AnnotateOperation | 100.0% | no function | | github.com/swaggest/rest/nethttp/options.go | OptionsMiddleware | 100.0% | no function | | github.com/swaggest/rest/nethttp/options.go | RequestMapping | 100.0% | no function | | github.com/swaggest/rest/nethttp/options.go | ResponseHeaderMapping | 77.8% | no function | | github.com/swaggest/rest/nethttp/options.go | SuccessStatus | 0.0% | no function | | github.com/swaggest/rest/nethttp/options.go | SuccessfulResponseContentType | 100.0% | no function | | github.com/swaggest/rest/nethttp/usecase.go | UseCaseMiddlewares | 90.9% | no function | | github.com/swaggest/rest/nethttp/wrap.go | HandlerAs | 81.8% | no function | | github.com/swaggest/rest/nethttp/wrap.go | String | 0.0% | no function | | github.com/swaggest/rest/nethttp/wrap.go | WrapHandler | 83.3% | no function | | github.com/swaggest/rest/openapi/collector.go | Annotate | 100.0% | no function | | github.com/swaggest/rest/openapi/collector.go | Collect | 70.4% | no function | | github.com/swaggest/rest/openapi/collector.go | ProvideRequestJSONSchemas | 53.8% | no function | | github.com/swaggest/rest/openapi/collector.go | ProvideResponseJSONSchemas | 68.4% | no function | | github.com/swaggest/rest/openapi/collector.go | Reflector | 100.0% | no function | | github.com/swaggest/rest/openapi/collector.go | ServeHTTP | 77.8% | no function | | github.com/swaggest/rest/openapi/collector.go | processExpectedErrors | 84.0% | no function | | github.com/swaggest/rest/openapi/collector.go | processUseCase | 100.0% | no function | | github.com/swaggest/rest/openapi/collector.go | provideFormDataSchemas | 0.0% | no function | | github.com/swaggest/rest/openapi/collector.go | provideHeaderSchemas | 66.7% | no function | | github.com/swaggest/rest/openapi/collector.go | provideParametersJSONSchemas | 72.7% | no function | | github.com/swaggest/rest/openapi/collector.go | setRequestMapping | 100.0% | no function | | github.com/swaggest/rest/openapi/collector.go | setupInput | 87.5% | no function | | github.com/swaggest/rest/openapi/collector.go | setupOutput | 66.7% | no function | | github.com/swaggest/rest/request.go | Error | 100.0% | no function | | github.com/swaggest/rest/request.go | Fields | 100.0% | no function | | github.com/swaggest/rest/request/decoder.go | Decode | 100.0% | no function | | github.com/swaggest/rest/request/decoder.go | cookiesToURLValues | 100.0% | no function | | github.com/swaggest/rest/request/decoder.go | decodeValidate | 76.9% | no function | | github.com/swaggest/rest/request/decoder.go | formDataToURLValues | 66.7% | no function | | github.com/swaggest/rest/request/decoder.go | headerToURLValues | 100.0% | no function | | github.com/swaggest/rest/request/decoder.go | makeDecoder | 85.7% | no function | | github.com/swaggest/rest/request/decoder.go | queryToURLValues | 100.0% | no function | | github.com/swaggest/rest/request/factory.go | MakeDecoder | 96.2% | no function | | github.com/swaggest/rest/request/factory.go | NewDecoderFactory | 100.0% | no function | | github.com/swaggest/rest/request/factory.go | RegisterFunc | 0.0% | no function | | github.com/swaggest/rest/request/factory.go | SetDecoderFunc | 100.0% | no function | | github.com/swaggest/rest/request/factory.go | jsonParams | 85.7% | no function | | github.com/swaggest/rest/request/factory.go | makeCustomMappingDecoder | 93.3% | no function | | github.com/swaggest/rest/request/factory.go | makeDefaultDecoder | 100.0% | no function | | github.com/swaggest/rest/request/factory.go | prepareCustomMapping | 100.0% | no function | | github.com/swaggest/rest/request/file.go | decodeFiles | 100.0% | no function | | github.com/swaggest/rest/request/file.go | decodeFilesInStruct | 81.2% | no function | | github.com/swaggest/rest/request/file.go | setFile | 78.6% | no function | | github.com/swaggest/rest/request/jsonbody.go | decodeJSONBody | 100.0% | no function | | github.com/swaggest/rest/request/jsonbody.go | readJSON | 100.0% | no function | | github.com/swaggest/rest/request/middleware.go | Decode | 0.0% | no function | | github.com/swaggest/rest/request/middleware.go | DecoderMiddleware | 90.9% | no function | | github.com/swaggest/rest/request/middleware.go | ValidatorMiddleware | 85.7% | no function | | github.com/swaggest/rest/request/reflect.go | hasFileFields | 100.0% | no function | | github.com/swaggest/rest/response/encoder.go | MakeOutput | 77.8% | no function | | github.com/swaggest/rest/response/encoder.go | SetupOutput | 82.4% | no function | | github.com/swaggest/rest/response/encoder.go | Write | 85.7% | no function | | github.com/swaggest/rest/response/encoder.go | WriteErrResponse | 70.6% | no function | | github.com/swaggest/rest/response/encoder.go | WriteSuccessfulResponse | 57.1% | no function | | github.com/swaggest/rest/response/encoder.go | addressable | 100.0% | no function | | github.com/swaggest/rest/response/encoder.go | setHeaders | 88.9% | no function | | github.com/swaggest/rest/response/encoder.go | whiteHeader | 83.3% | no function | | github.com/swaggest/rest/response/encoder.go | writeJSONResponse | 64.5% | no function | | github.com/swaggest/rest/response/gzip/middleware.go | Close | 83.3% | no function | | github.com/swaggest/rest/response/gzip/middleware.go | Flush | 62.5% | no function | | github.com/swaggest/rest/response/gzip/middleware.go | GzipWrite | 75.0% | no function | | github.com/swaggest/rest/response/gzip/middleware.go | Middleware | 87.5% | no function | | github.com/swaggest/rest/response/gzip/middleware.go | Write | 100.0% | no function | | github.com/swaggest/rest/response/gzip/middleware.go | WriteHeader | 100.0% | no function | | github.com/swaggest/rest/response/gzip/middleware.go | getBufWriter | 100.0% | no function | | github.com/swaggest/rest/response/gzip/middleware.go | getGzipWriter | 88.9% | no function | | github.com/swaggest/rest/response/gzip/middleware.go | isTrivialNetworkError | 0.0% | no function | | github.com/swaggest/rest/response/gzip/middleware.go | maybeGzipResponseWriter | 100.0% | no function | | github.com/swaggest/rest/response/gzip/middleware.go | putBufWriter | 100.0% | no function | | github.com/swaggest/rest/response/gzip/middleware.go | putGzipWriter | 100.0% | no function | | github.com/swaggest/rest/response/gzip/middleware.go | writeHeader | 100.0% | no function | | github.com/swaggest/rest/response/middleware.go | EncoderMiddleware | 87.5% | no function | | github.com/swaggest/rest/response/validator.go | ValidatorMiddleware | 83.3% | no function | | github.com/swaggest/rest/resttest/client.go | NewClient | 0.0% | no function | | github.com/swaggest/rest/resttest/server.go | NewServerMock | 0.0% | no function | | github.com/swaggest/rest/trait.go | OutputHasNoContent | 88.9% | no function | | github.com/swaggest/rest/trait.go | RequestMapping | 100.0% | no function | | github.com/swaggest/rest/trait.go | RestHandler | 100.0% | no function | | github.com/swaggest/rest/validator.go | Error | 0.0% | no function | | github.com/swaggest/rest/validator.go | Fields | 0.0% | no function | | github.com/swaggest/rest/validator.go | HasConstraints | 0.0% | no function | | github.com/swaggest/rest/validator.go | ValidateData | 0.0% | no function | | github.com/swaggest/rest/validator.go | ValidateJSONBody | 0.0% | no function | | github.com/swaggest/rest/web/service.go | DefaultService | 100.0% | no function | | github.com/swaggest/rest/web/service.go | Delete | 100.0% | no function | | github.com/swaggest/rest/web/service.go | Docs | 100.0% | no function | | github.com/swaggest/rest/web/service.go | Get | 100.0% | no function | | github.com/swaggest/rest/web/service.go | Head | 100.0% | no function | | github.com/swaggest/rest/web/service.go | Options | 100.0% | no function | | github.com/swaggest/rest/web/service.go | Patch | 100.0% | no function | | github.com/swaggest/rest/web/service.go | Post | 100.0% | no function | | github.com/swaggest/rest/web/service.go | Put | 100.0% | no function | | github.com/swaggest/rest/web/service.go | Trace | 100.0% | no function |
codecov[bot] commented 2 years ago

Codecov Report

Merging #87 (a43de34) into master (594b2d2) will increase coverage by 4.10%. The diff coverage is 86.26%.

@@            Coverage Diff             @@
##           master      #87      +/-   ##
==========================================
+ Coverage   77.21%   81.31%   +4.10%     
==========================================
  Files          27       20       -7     
  Lines        1413      883     -530     
==========================================
- Hits         1091      718     -373     
+ Misses        207      102     -105     
+ Partials      115       63      -52     
Flag Coverage Δ
unittests 81.31% <86.26%> (+4.10%) :arrow_up:

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

Impacted Files Coverage Δ
fhttp/wrap.go 59.37% <0.00%> (ø)
request/file.go 59.61% <53.33%> (-5.51%) :arrow_down:
response/encoder.go 65.69% <61.76%> (+0.81%) :arrow_up:
response/middleware.go 85.71% <66.66%> (ø)
chirouter/path_decoder.go 83.33% <75.00%> (-2.39%) :arrow_down:
request/middleware.go 87.17% <90.00%> (ø)
fhttp/handler.go 89.02% <92.85%> (ø)
chirouter/wrapper.go 97.87% <100.00%> (-0.05%) :arrow_down:
fhttp/openapi.go 93.84% <100.00%> (ø)
fhttp/options.go 86.84% <100.00%> (ø)
... and 10 more

: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 ``` ```
Benchmark result ``` name time/op pkg:github.com/swaggest/rest-fasthttp/request goos:linux goarch:amd64 Decoder_Decode-2 685ns ± 1% DecoderFunc_Decode-2 1.74µs ± 3% Decoder_Decode_json-2 21.6µs ± 3% Decoder_Decode_queryObject-2 4.09µs ± 0% Decoder_Decode_jsonParam-2 1.42µs ± 4% DecoderFactory_SetDecoderFunc-2 1.34µs ± 1% pkg:github.com/swaggest/rest-fasthttp/response/gzip goos:linux goarch:amd64 Middleware-2 15.7µs ± 5% Middleware_control-2 2.63µs ± 5% name alloc/op pkg:github.com/swaggest/rest-fasthttp/request goos:linux goarch:amd64 Decoder_Decode-2 56.0B ± 0% DecoderFunc_Decode-2 192B ± 0% Decoder_Decode_json-2 12.1kB ± 0% Decoder_Decode_queryObject-2 1.20kB ± 0% Decoder_Decode_jsonParam-2 312B ± 0% DecoderFactory_SetDecoderFunc-2 288B ± 0% pkg:github.com/swaggest/rest-fasthttp/response/gzip goos:linux goarch:amd64 Middleware-2 16.6kB ±26% Middleware_control-2 16.4kB ± 0% name allocs/op pkg:github.com/swaggest/rest-fasthttp/request goos:linux goarch:amd64 Decoder_Decode-2 3.00 ± 0% DecoderFunc_Decode-2 8.00 ± 0% Decoder_Decode_json-2 184 ± 0% Decoder_Decode_queryObject-2 32.0 ± 0% Decoder_Decode_jsonParam-2 10.0 ± 0% DecoderFactory_SetDecoderFunc-2 13.0 ± 0% pkg:github.com/swaggest/rest-fasthttp/response/gzip goos:linux goarch:amd64 Middleware-2 7.00 ± 0% Middleware_control-2 2.00 ± 0% ```
github-actions[bot] commented 2 years ago

Examples Benchmark Result

Benchmark diff with base branch ``` ```