Skip to content

ProtoDecoder fails to decode messages with optional fields #147

@rakshith-porter

Description

@rakshith-porter

schema_registry_converter = { version = "4.6.1", features = ["easy", "proto_decoder", "proto_raw"] }

Using schema_registry_converter::async_impl::proto_decoder::ProtoDecoder

Error faced:

Failed to decode message: Error: Error creating proto context, was cause by Parsing error:  --> 9:9
  |
9 |   oneof _initiator {
  |         ^---
  |
  = expected ident, it's retriable: false, it's cached: false

the corresponding proto file:

syntax = "proto3";

package in.abc.event_entities;

option java_outer_classname = "EventSourceProto";

message EventSource {
  message Actor {
    enum UserEntity {
      USER_ENTITY_UNSPECIFIED = 0;
      USER_ENTITY_ADMIN = 1;
    }

    UserEntity entity = 1; // the user type
    uint32 id = 2; // unique identifier of the user entity
  }
  string system = 1; // the system from where the order event originated from
  optional Actor initiator = 2; // the user that initiated the change to the order
  optional Actor proxy = 3; // the user that executed the change on behalf of another user
  optional string reason = 4; // reason for change to the order
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions