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

Document how to convert objects between proto and pydantic and reverse #50

Open
jankatins opened this issue Apr 15, 2024 · 1 comment
Open

Comments

@jankatins
Copy link
Contributor

Is your feature request related to a problem? Please describe.

I tried to find if there is an easy way to convert objects form one format into another. The easiest I found is using dicts as a intermediate format.

Describe the solution you'd like

  • Something documented in the readme showcasing the conversion in both directions
  • Maybe: a nice <PydanticType>.from_proto(msg: <ProtoType>) -> <PydanticType> class method and <PydanticType>.to_proto() -> <ProtoType> method.

Describe alternatives you've considered

The dict method: convert proto/pydantic to dict, use that dict with two stars as input.

@so1n
Copy link
Owner

so1n commented Apr 15, 2024

@jankatins Are you talking about something similar to this Issue? #11

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

No branches or pull requests

2 participants