Skip to content

Enum doesn't get mapped on receive #157

@upcFrost

Description

@upcFrost

Hi,

Enums seem not to be mapped on init and receive and left as their integer values.

Example proto:

message TestRequest {
  Category category = 1;
}

enum Category {
  SOMETHING = 0;
  SOMETHING_ELSE = 1;
}

For TestRequest(), the Category value will be int 0 and not SOMETHING.
When receiving category = 1 over gRPC, it will be also left as int 1.

For deserialization it can be fixed easily by adding yet another branch to _postprocess_single. For plain init - I've tried tracing it down, but it seem to go somewhere deep into how dataclasses work

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug?Bug or feature?help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions