Skip to content

gsoc containing json serialization handler and dubbo codec #51

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

aditya0yadav
Copy link

What is the purpose of the change

ISSUE: #issue_number

Brief changelog

Verifying this change

Checklist

  • Make sure there is a GitHub_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GitHub issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist.
  • Add some description to dubbo-website project if you are requesting to add a feature.
  • GitHub Actions works fine on your own branch.
  • If this contribution is large, please follow the Software Donation Guide.

@aditya0yadav
Copy link
Author

Pull Request Summary

This pull request includes the complete implementation based on previous discussions and feedback. It also incorporates suggestions from @cnzakii, who has been mentoring and guiding the direction.

🔑 Key Highlights

  • ✅ Introduced support for advanced types such as frozenset, datetime, UUID, and more.
  • ⚙️ Added handling for params_types and return_type for better control over serialization.
  • 🔁 Improved codec design to ensure compatibility with various complex data structures.
  • 🧪 Added realistic test data for broader type coverage:
self.users_db = [
    User(
        id=1,
        name="Alice",
        email="[email protected]",
        age=30,
        login_history=[
            LoginRecord(timestamp=datetime.utcnow() - timedelta(days=1), ip_address="192.168.1.10"),
            LoginRecord(timestamp=datetime.utcnow(), ip_address="192.168.1.11")
        ],
        meta=UserMeta(tags=frozenset(["admin", "beta"]), scores=(88, 92, 85))
    ),
    User(
        id=2,
        name="Bob",
        email="[email protected]",
        age=25,
        login_history=[
            LoginRecord(timestamp=datetime.utcnow() - timedelta(hours=2), ip_address="192.168.1.20")
        ],
        meta=UserMeta(tags=frozenset(["tester"]), scores=(75, 80, 70))
    )
]

@aditya0yadav
Copy link
Author

@cnzakii check this out

@aditya0yadav
Copy link
Author

@cnzakii in this repo i have a code from which i run the server and client
https://github.com/aditya0yadav/gsoc-test-file


from typing import Any, Callable, Optional, Union,Type
from abc import ABC, abstractmethod
from pydantic import BaseModel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This place will still cause strong dependency on pydantic

ModelT = TypeVar('ModelT', bound=BaseModel)


class CustomJSONEncoder(json.JSONEncoder):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add high-coverage unit tests to validate your code.

arg_serialization=(request_serializer, None),
return_serialization=(None, response_deserializer),
rpc_type=RpcTypes.CLIENT_STREAM.value,
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also hope to see the implementation on the server side

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cnzakii
If you don't mind can you explain me about this

like most of the work of server can be handle by the rpc handler

or
Am i missing something ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can review the proposal I sent in Slack, which also contains the corresponding Server interface design. You should also implement the construction method descriptors on the Server side, select the serialization method, and so on.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok
Now i understand
Thx for clarification

@aditya0yadav
Copy link
Author

@cnzakii
ok
Let me resolve them

@cnzakii
Copy link
Member

cnzakii commented Jul 10, 2025

@aditya0yadav While it lacks some generality, the overall work is good. Please make optimizations based on my comments, complete the remaining tasks, and submit the relevant code.

@aditya0yadav
Copy link
Author

aditya0yadav commented Jul 10, 2025

@cnzakii ok sir
based on your comment , I will optimize the code
Thanks for the depth review

@aditya0yadav
Copy link
Author

@cnzakii, then there's no need for an RPC method handler, right?
Should I encapsulate and abstract the RPC method handler inside server.py's handler, or create something new similar to how it's done on the client side?

@aditya0yadav
Copy link
Author

@cnzakii
I fixed the error
Please take a look

@aditya0yadav aditya0yadav changed the title gsoc pull request containing json serialization handler gsoc containing json serialization handler and dubbo codec Jul 22, 2025
@aditya0yadav
Copy link
Author

@cnzakii Please check out the pull request , sir

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.

2 participants