Closed vearutop closed 1 year ago
Language | Files | Lines | Code | Comments | Blanks | Complexity | Bytes |
---|---|---|---|---|---|---|---|
Go | 104 (+3) | 7178 (+174) | 5208 (+122) | 482 (+16) | 1488 (+36) | 866 (+19) | 173.5K (+4.1K) |
Go (test) | 47 (+1) | 4981 (+122) | 3809 (+67) | 182 (+32) | 990 (+23) | 178 (+4) | 138.2K (+3.1K) |
JSON | 3 | 1440 (+98) | 1440 (+98) | 0 | 0 | 0 | 58.7K (+3.4K) |
# github.com/swaggest/rest/nethttp ## compatible changes IsWrapperChecker: added MiddlewareIsWrapper: added # summary Inferred base version: v0.2.33 Suggested version: v0.3.0
total: (statements) 83.9% changed lines: (statements) 100.0%
Merging #97 (27e995d) into master (18cad16) will increase coverage by
0.45%
. The diff coverage is97.36%
.
@@ Coverage Diff @@
## master #97 +/- ##
==========================================
+ Coverage 77.57% 78.02% +0.45%
==========================================
Files 27 28 +1
Lines 1436 1470 +34
==========================================
+ Hits 1114 1147 +33
- Misses 207 208 +1
Partials 115 115
Flag | Coverage Δ | |
---|---|---|
unittests | 78.02% <97.36%> (+0.45%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Impacted Files | Coverage Δ | |
---|---|---|
nethttp/wrapper.go | 87.50% <87.50%> (ø) |
|
chirouter/wrapper.go | 100.00% <100.00%> (ø) |
|
nethttp/handler.go | 85.22% <100.00%> (+0.34%) |
:arrow_up: |
nethttp/openapi.go | 94.20% <100.00%> (+0.35%) |
:arrow_up: |
nethttp/usecase.go | 84.61% <100.00%> (+2.79%) |
:arrow_up: |
request/middleware.go | 88.37% <100.00%> (+1.19%) |
:arrow_up: |
response/middleware.go | 87.50% <100.00%> (+1.78%) |
:arrow_up: |
response/validator.go | 81.81% <100.00%> (+1.81%) |
:arrow_up: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
Fixes #96.
Separation of
Wrap
andUse
/With
introduced in #76 led to an opposite limitation: wrappers that are configured in sub-routers have no effect as they are passed to the originalchi
router that does not know how to deal with them.This PR implements a hacky compromise, that some middlewares in
Use
/With
can be considered handler wrappers, but for that they need to exhibit particular indicative behavior.Then wrappers would go to wrappers (not going to chi), and middlewares would go to chi (not going to wrappers).