zazuko / kopflos

kopflos - Linked Data APIs
MIT License
14 stars 6 forks source link

refactor: bodies #168

Closed tpluscode closed 2 months ago

tpluscode commented 2 months ago

Since express has no easy way to determine if a body is present in a request, I changed the behavior to always create the body in handler args and let the implementors worry about checking if RDF is present in the message.

For other kids of payloads, I change body.raw so that it can be used with co-body to parse in user code when necessary. This avoids baking in express body-parser but we may still revisit what we do here when it comes to multi-part bodies

changeset-bot[bot] commented 2 months ago

🦋 Changeset detected

Latest commit: ad64d10b63da3043c1bfd890a4714ef1c36fe851

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages | Name | Type | | -------------------- | ----- | | @kopflos-cms/express | Patch | | @kopflos-cms/core | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 68.75000% with 5 lines in your changes missing coverage. Please review.

Project coverage is 96.90%. Comparing base (67bd393) to head (ad64d10). Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
packages/express/BodyWrapper.ts 58.33% 5 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #168 +/- ## ========================================== - Coverage 97.26% 96.90% -0.36% ========================================== Files 19 19 Lines 767 775 +8 Branches 79 80 +1 ========================================== + Hits 746 751 +5 - Misses 19 22 +3 Partials 2 2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.