Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support array literals in text_proto format #678

Open
Nick-Mazuk opened this issue Jul 1, 2023 · 0 comments
Open

Support array literals in text_proto format #678

Nick-Mazuk opened this issue Jul 1, 2023 · 0 comments

Comments

@Nick-Mazuk
Copy link

Currently, array literals are not parsed in the text_proto format.

For instance, consider the following message:

message Greetings {
    repeated string greetings = 1;
}

If you try to parse the following textproto with parse_from_str, you will get an error:

greetings: ["hello", "hi"]
ParseError { error: TokenizerError(ExpectStrLit), loc: Loc { line: 1, col: 12 } }

Instead, parse_from_str expects you to use string literals and repeat the field multiple times.

greetings: "hello"
greetings: "hi"

Array literals are valid in textproto format and should be supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant