Skip to content

Make use of message enum number instead of index.  #6

@Shlomigreen

Description

@Shlomigreen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions