-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
✨ v3 (feature): request binding #2006
base: main
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
shoule we hide the original unmarshal message from |
I reviewed this a bit today and this way seems good to me but i have a little question. Why don't we support map binding? I think we can add map support when checking the type in |
And we don't need default validator i think. Playground validator has too much and big sized indirect dependencies (gin-gonic/gin#3165). But we can support custom validators by an struct validator interface. |
This comment was marked as outdated.
This comment was marked as outdated.
I think we can add old methods like |
This PR only add JSON and XML body type, The multipart and form body need a new decoder, I'll add them in the next PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some comments. Maybe i can add some comments more in next days. Looks like great PR 🚀🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw we can try to implement form, multipart form in this pr
@FGYFFFF how far are you ? |
I'll do it as soon as I can, maybe in two weeks. |
ok perfect, thx |
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
todos:
|
@coderabbitai can you suggest solutions for the open todos Can you also check the existing code |
Tip For best results, initiate chat on the files or code changes. @ReneWerner87, after running the script to search for relevant files, it appears there are multiple references to pointers, files, and nested structures within the codebase. This indicates that the codebase already has some handling for these concepts, but improvements or additional features might still be needed based on the open todos. Given the complexity and breadth of the codebase, here are more detailed suggestions for each open todo based on the script's findings:
For a more detailed review and specific code changes, it would be beneficial to closely examine the implementation of these features in the context of the current codebase and consider how they align with the project's overall architecture and design goals. If there are specific areas of the code or features you'd like me to focus on, please let me know, and I can provide more targeted advice or suggestions. Analysis chain@ReneWerner87, I've outlined potential solutions for the open todos:
To provide a more detailed review of the existing code, I've initiated a script to search for relevant files. I'll follow up with more specific insights or recommendations based on the findings. Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Check for the presence of files related to the todos mentioned in the comment.
# This includes looking for files that might be related to nested structs, pointer usage, and file support.
fd --type f --exec grep -E "nested struct|pointer|file" {}
Length of output: 28118 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2006 +/- ##
==========================================
+ Coverage 80.09% 82.34% +2.24%
==========================================
Files 117 116 -1
Lines 9035 8614 -421
==========================================
- Hits 7237 7093 -144
+ Misses 1369 1093 -276
+ Partials 429 428 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Please provide enough information so that others can review your pull request:
related to #1821 and #2002
Explain the details for making this change. What existing problem does the pull request solve?
this PR add a function decorator style bind method to provide high speed and low alloc request binding.this PR add a high performance and low alloc binding implement.
some changes:
data[]=john&data[]=doe
won't bind toquery:"data"
, only bind toquery:"data[]"
and can't bind query likedata[0]=john&data[1]=doe
TODO:
nested.and.age
, nested.age queriesdata.0.name
data.0.users.0.name
and queriesdata[0][name]
,nested[and][age]
queries (we can convert dots to square brackets or the opposite)TODO for Extra Enhancements: