protobuf_to_pydantic
protobuf_to_pydantic copied to clipboard
Generate a pydantic.BaseModel with parameter verification function from the Python Message object(by the Protobuf file).
The current step of converting `BaseModel` to `Protobuf Message` is tedious and has poor performance. e.g: ```python from google.protobuf.json_format import ParseDict from pydantic import BaseModel from demo_pb2 import DemoMessage class...
**Is your feature request related to a problem? Please describe.** When the field name in *.proto file is PascalCase or camelCase I want the p2p can convert the field name...
**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...
**Describe the bug** Seems the buf registry plugin doesn't exist. **To Reproduce** ```yaml - plugin: buf.build/python-pai/protobuf-to-pydantic:v0.2.1 opt: - plugin_config_py_code_base64=aW1wb3J0IGxvZ2dpbmcKCmxvZ2dpbmcuYmFzaWNDb25maWcoZm9ybWF0PSJbJShhc2N0aW1lKXMgJShsZXZlbG5hbWUpc10gJShtZXNzYWdlKXMiLCBkYXRlZm10PSIleS0lbS0lZCAlSDolTTolUyIsIGxldmVsPWxvZ2dpbmcuSU5GTykKCgpkZWYgZGVmYXVsdF9mdW5jKCkgLT4gaW50OgogICAgcmV0dXJuIDEKCmxvY2FsX2RpY3QgPSB7CiAgICAiZGVmYXVsdF9mdW5jIjogZGVmYXVsdF9mdW5jLAp9Cg - plugin_config_module_name=plugin_config ``` `Failure: plugin "buf.build/python-pai/protobuf-to-pydantic" was not found`
Plugin function cannot be used in Windows system
**Is your feature request related to a problem? Please describe.** The protobuf specification says that JSON should serialize enum values to string and accept integer or string values, see below....
Hi, I open this bug in relation with [this closed issue](https://github.com/so1n/protobuf_to_pydantic/issues/38). This issue has been solved by supposing the pydantic optional fields are the result of the proto's "optional" keyword....
**Is your feature request related to a problem? Please describe.** The current [check_one_of](https://github.com/so1n/protobuf_to_pydantic/blob/master/protobuf_to_pydantic/customer_validator/v2.py#L34) (PydanticV2 for instance) does not work if utilizing a field aliases. This is problematic if adding a...
**Describe the bug** The `_add_other_module_pkg` function in `protobuf_to_pydantic/plugin/field_desc_proto_to_code.py` has issues in some cases. Specifically, in cases where the top-level paths are different and the intermediate paths match, the generated relative...