Skip to content
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]: Support custom json codec at runtime #3391

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

timandy
Copy link

@timandy timandy commented Nov 10, 2022

Extract out an interface api.JsonApi to define all serialization and deserialization behaviors.

Developers only need to implement the interface and set the value of json.API to custom json codec.

In the future, we can define api.XmlApi in the same way.

Solved #3217

@timandy
Copy link
Author

timandy commented Nov 10, 2022

@appleboy Please take a look, thanks~

@codecov
Copy link

codecov bot commented Apr 26, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.19%. Comparing base (3dc1cd6) to head (2118c7c).
Report is 63 commits behind head on master.

Current head 2118c7c differs from pull request most recent head eeaa150

Please upload reports for the commit eeaa150 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3391      +/-   ##
==========================================
- Coverage   99.21%   99.19%   -0.03%     
==========================================
  Files          42       43       +1     
  Lines        3182     2722     -460     
==========================================
- Hits         3157     2700     -457     
+ Misses         17       12       -5     
- Partials        8       10       +2     
Flag Coverage Δ
?
-tags "sonic avx" 99.18% <100.00%> (?)
-tags go_json 99.18% <100.00%> (?)
-tags nomsgpack 99.17% <100.00%> (?)
go-1.18 ?
go-1.19 ?
go-1.20 ?
go-1.21 99.19% <100.00%> (-0.03%) ⬇️
go-1.22 99.19% <100.00%> (?)
macos-latest 99.19% <100.00%> (-0.03%) ⬇️
ubuntu-latest 99.19% <100.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@timandy timandy force-pushed the master branch 3 times, most recently from 965e7b1 to 0b20d8b Compare April 27, 2023 08:34
@aohanhongzhi
Copy link

good job! I need the feature.

@appleboy
Copy link
Member

appleboy commented Apr 1, 2024

@timandy We move to the next milestone v1.11

@fifsky
Copy link
Contributor

fifsky commented Apr 1, 2024

I recommend removing all third-party JSON packages after defining the JsonApi to reduce dependencies.
Related discussion: #3653 (comment)

We should not piling json libraries

@devhaozi
Copy link

devhaozi commented May 7, 2024

I recommend removing all third-party JSON packages after defining the JsonApi to reduce dependencies. Related discussion: #3653 (comment)

We should not piling json libraries

Agree with this, I don't want to see four different json implementations in one web framework.

@appleboy
Copy link
Member

appleboy commented May 7, 2024

@timandy Can you create a new PR? I can't handle this PR (maybe no permission to trigger CI testing)

@timandy
Copy link
Author

timandy commented May 8, 2024

@appleboy All right, I will rebase on the latest commit.

@appleboy
Copy link
Member

appleboy commented May 8, 2024

@timandy Thanks.

@timandy
Copy link
Author

timandy commented May 8, 2024

@aohanhongzhi I have rebased it, Please tabke a look.

@appleboy
Copy link
Member

appleboy commented May 9, 2024

related: #3766

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants