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

Unable to convert proto3 file to avrotize when enum is present #11

Open
agustinbonelli opened this issue Jan 23, 2025 · 0 comments
Open

Comments

@agustinbonelli
Copy link

When trying to convert the following proto file:

syntax = "proto3";

enum Corpus {
CORPUS_UNSPECIFIED = 0;
CORPUS_UNIVERSAL = 1;
CORPUS_WEB = 2;
CORPUS_IMAGES = 3;
CORPUS_LOCAL = 4;
CORPUS_NEWS = 5;
CORPUS_PRODUCTS = 6;
CORPUS_VIDEO = 7;
}

The following error is encountered:

Error: Error trying to process rule "enumbody":

'NoneType' object has no attribute 'data'

Using version: Avrotize 2.6.0

Note: The proto definition should be valid protobuf syntax according to the docs (https://protobuf.dev/programming-guides/proto3/#enum)

The same proto definition but with syntax = "proto2" works properly and writes the schema:

[
{
"name": "Corpus",
"type": "enum",
"namespace": "Avrotest",
"symbols": [
"CORPUS_UNSPECIFIED",
"CORPUS_UNIVERSAL",
"CORPUS_WEB",
"CORPUS_IMAGES",
"CORPUS_LOCAL",
"CORPUS_NEWS",
"CORPUS_PRODUCTS",
"CORPUS_VIDEO"
],
"ordinals": {
"CORPUS_UNSPECIFIED": 0,
"CORPUS_UNIVERSAL": 1,
"CORPUS_WEB": 2,
"CORPUS_IMAGES": 3,
"CORPUS_LOCAL": 4,
"CORPUS_NEWS": 5,
"CORPUS_PRODUCTS": 6,
"CORPUS_VIDEO": 7
}
}
]

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