-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/patch2 rebased #812
Feature/patch2 rebased #812
Conversation
Codecov Report
@@ Coverage Diff @@
## master #812 +/- ##
==========================================
- Coverage 53.3% 49.66% -3.65%
==========================================
Files 30 39 +9
Lines 3371 3725 +354
==========================================
+ Hits 1797 1850 +53
- Misses 1399 1697 +298
- Partials 175 178 +3
Continue to review full report at Codecov.
|
Hi @razamiDev, thanks for putting this together. I just had one quick idea - do you think you could put together a couple of little examples of requests this translates and compile it into a helpful page for the documentation (/docs)? I'd love for us to make great features like this more visible to the users. What do you think? |
@johanbrandhorst I added some documentation. Let me know if that is what you had in mind. |
This is fantastic @razamiDev, thank you so much! I can't wait to merge this. Lets see what CI thinks :). |
Actually, just a quick thought, maybe add some |
@johanbrandhorst good idea! I added some examples for curl :) |
Fantastic, let's merge this thing! |
Congrats @razamiDev and @dmacthedestroyer on finally getting this in, we've all been very excited for this! |
* Updated Patch behavior * Patch update with regenerated BUILD files * Added documentation for PATCH usage * Added some curl examples for PATCH
This PR is a cleaner version of PR #806
This was a collaborative effort by @razamiDev and @dmacthedestroyer
this addresses #379
If a binding is mapped to patch and the request message has exactly one FieldMask message in it, additional code is rendered for the gateway handler that will populate the FieldMask based on the request body.
This handles two scenarios: The FieldMask is hidden from the REST request (as in the UpdateV2 example). In this case, the FieldMask is updated from the request body and set in the gRPC request message.
The FieldMask is exposed to the REST request (as in the PatchWithFieldMaskInBody example). For this case, a check is made as to whether the FieldMask is nil/empty prior to populating with the request body. If it's not nil, then it converts the FieldMask paths from the REST (snake_case) to gRPC (PascalCase) format. Otherwise, it acts like the previous case.
Additional comments of interest are inline on this PR.