-
Notifications
You must be signed in to change notification settings - Fork 23
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
Validation of FileDescriptorSets #5
Comments
This is in preparation for adding more checks for parity with protoc itself. (see #5)
Known error cases which we could check for but currently don't:
|
I found that some of the work you've done on this item has caused the 0.10.x revisions to break for my use case. The validation fails on DuplicateFieldJsonName being the empty string.
It's a huge spam of seemingly every field in the proto. My understanding of the spec is that if a JSON field name is not specified it should default to the proto field name lowerCamelCase. |
@mrpopogod How are you generating the FileDescriptorSet? With protoc 3.19.1, it sets the json_name field in the descriptor even if the name isn't set explicitly in the .proto file |
In my case it's being generated by a schema registry owned by another team; you pass in a plaintext file and it will generate the FileDescriptorSet itself. I want to say it might still be proto2, but with no support for required fields (those get validated out). |
@mrpopogod I've published 0.10.2 which should resolve this by setting the json_name to the camel-cased field name if it isn't set |
Awesome, no longer getting the build error and my generated .rs files look good. Appreciate the fix. |
Currently
FileDescriptor::new
performs some sanity checking on the FileDescriptorSet, for example checking that all referenced types can be resolved. However there are many checks that protoc does and we do not.The text was updated successfully, but these errors were encountered: