protobuf_to_pydantic icon indicating copy to clipboard operation
protobuf_to_pydantic copied to clipboard

make the model field to snake_case

Open hokor opened this issue 1 year ago • 1 comments

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 to snake_case when generate python file.

Describe the solution you'd like Add some cli option or plugin , so I can given the output filed case.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

hokor avatar Apr 20 '24 11:04 hokor

@hokor Can you describe your needs more specifically? From what I understand, Protobuf's field naming rules are similar to Python. Also the MessageToDict function of google.protobuf.json_format provides a preserving_proto_field_name option, which converts the field name to lowerCamelCase in the transformation.

so1n avatar Apr 20 '24 17:04 so1n