-
-
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
📝 Update: Add JSONDecoder to config #1489
Conversation
Let me know if everything is fine. |
Could you please add a test for the configuration possibility and a part in the docs repository. |
Sure 👍 |
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.
See the possibility to define the decoder, but no use within the framework/library, then shouldn't we use somewhere the method which was configured?
Yes, I was thinking to add this to methods in ctx.go with using app.config's Encoder and Decoder.
|
thought rather that the decoder should be used in the bodyParser or everywhere where we directly use the json unmarshal i wouldn't provide an extra method in the context because it doesn't really have any reference to it and the one who sets the decoders and encoders from the outside in the config can use them from the outside capsule too the only benefit i can think of is that you exchange the internal usages |
@pd-pranay could you change all the usages for the unmarshall method |
@ReneWerner87 can you help me with references where I should be changing usages of unmarshal method ? |
@pd-pranay Yes, that should be the only |
For docs what type should I define JSONDecoder ? |
https://docs.gofiber.io/api/fiber#config it should just show up here so users know they can customize it, maybe you can add the doc for JSONEncode as well |
@pd-pranay can you add JSONEncode and JSONDecode to the documentation ? |
Please provide enough information so that others can review your pull request:
Explain the details for making this change. What existing problem does the pull request solve?
Add json decoder to config
This pull request is in reference to #1452
Commit formatting
Use emojis on commit messages so it provides an easy way of identifying the purpose or intention of a commit. Check out the emoji cheatsheet here: https://gitmoji.carloscuesta.me/