Skip to content

PascalCase support #89

Open
Open
@jameslan

Description

@jameslan

For a PascalCase field, betterproto uses the snake case in the class field, and can handle multiple cases in input json. However, it converts it to the camel case in output json, while protobuf requires a pascal case in the input. This makes the json incompatible.

For example,

message Test {
  int32 camelCase = 1;
  my_enum snake_case = 2;
  snake_case_message snake_case_message = 3;
  int32 PascalCase =4;
}

betterproto will output

{"camelCase": 1, "pascalCase": 3, "snakeCase": "ONE"}

but protobuf is expecting

{"PascalCase": 3, "camelCase": 1, "snakeCase": "ONE"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghigh prioritymediumMedium effort issue, can fit in a single PR

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions