feat: add definition for overridable json engine#1121
Conversation
|
Thanks for opening this pull request! 🎉 Please check out our contributing guidelines. If you need help or want to chat with us, join us on Discord https://gofiber.io/discord |
05fe030 to
0ed1f27
Compare
|
Would appreciate suggestions on naming throughout this PR. Any and all feedback is more than welcomed. |
0ed1f27 to
2267f0f
Compare
|
Thanks for the PR, |
|
@Fenny After a bit of pondering on this, what do y'all think about having the definition of the interface as Thoughts? I pushed my commit to lay out what I described above. |
4c99bb2 to
6fa63b2
Compare
6fa63b2 to
63a6d0c
Compare
|
@yquansah, I do agree that your solution is more fitting for a more flexible approach if we add a json decoder in the future. But I highly doubt we will add that because we think that is not the responsibility of a web framework. I still suggest simplifying it by using the STD json marshal signatures ( we can always add JSONMarshal func(interface{}) ([]byte, error)
// JSONUnmarshal func([]byte, interface{}) error |
functionality we define
63a6d0c to
5941c8c
Compare
|
@Fenny Yeah I was thinking about that too, I do not think there will be a use case of doing json decoding, and if there is then it shouldn't be too hard to add. Let me know if my changes address what you are talking about. |
|
@ReneWerner87 @Fenny Hey y'all just wanted to check in and see if there is anything left to do on this PR? |
There was a problem hiding this comment.
@yquansah
code looks good
can you add some words in
https://github.com/gofiber/docs/blob/master/api/fiber.md
-> PR in the docs repository
|
LGTM! Thanks! |
|
Congrats on merging your first pull request! 🎉 We here at Fiber are proud of you! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord |
Please provide enough information so that others can review your pull request:
The intention of this PR is to address the issue raised here: #1108
It allows for configuration of the underlying JSON marshaller/unmarshaller by clients of fiber. It will just default to the
encoding/jsonimplementation if one isn't provided a client.Explain the details for making this change. What existing problem does the pull request solve?
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/