Ed-XCF/protobuf2pydantic

Make use of message enum number instead of index.

Opened this issue · 0 comments

In the below reference, you make the value number in the generated Pydantic model equal to the index of the elements in enum. This can cause problems when enum set in the proto file is not in a running number.

It can be solved by placing value.number instead of value.index.

https://github.com/Ed-XCF/protobuf2pydantic/blob/d184c118eac463af22bc762519edf5086cb654ac/protobuf2pydantic/biz.py#L53C13-L53C78