Closed lsdch closed 4 months ago
Attention: Patch coverage is 90.90909%
with 1 lines
in your changes are missing coverage. Please review.
Project coverage is 92.77%. Comparing base (
e1b7179
) to head (338653c
).
Files | Patch % | Lines |
---|---|---|
huma.go | 90.90% | 0 Missing and 1 partial :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
The changes in the huma.go
file involve replacing the scalar inputBodyIndex
with a slice and adding a boolean flag to track the presence of an input body. This refactoring enhances the handling of input body validation and conversion. In huma_test.go
, a new BodyContainer
struct is introduced for testing request body unmarshalling, and this struct is integrated within a test case for request body embedding.
Files | Change Summary |
---|---|
huma.go |
Replaced inputBodyIndex scalar with a slice, added hasInputBody flag, and adjusted related conditions. |
huma_test.go |
Introduced BodyContainer struct and integrated it within a test case for request body embedding. |
🐇 In code's garden, changes bloom, A slice now replaces the scalar's room. Flags of boolean, true or false, Guide the input body’s dance and waltz. Tests now hold a container bright, Ensuring requests are unmarshalled right. 🌸
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Stumbled on this bug while trying to refactor some handler inputs. When the request
Body
is defined within an embedded struct, unmarshaling of the request body does not work as expected, because the field is retrieved by index which points to the embedded struct, not itsBody
content.Small example to illustrate the issue :
Summary by CodeRabbit
Refactor
Tests
BodyContainer
struct.