-
Notifications
You must be signed in to change notification settings - Fork 581
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
Enum validation fails when enum defined in sibling package with same name #387
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Probably would be good if this wasn't marked stale just because no one has had time to look at it at all yet. :) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hiya - I think this is still an issue |
I can confirm this is an issue -- no imports for enums defined in a different package. |
I can confirm it too #585 |
I just saw something that looks similar to #321, but in golang and with an incorrect package prefix rather than no prefix. This seems different enough to open a new issue, but I'm happy to merge if you'd like.
We include an enum from another package and set
enum.defined_only
constraint on it.But the generated code looks like this:
Note that it says
v1
instead of an import alias forkafka.core.v1
. There's no import forkafka/core/v1
in the.pb.validate.go
, andv1
is invalid since its not imported either.More Details
This could have something to do with how we structure our proto files.
We use a proto monorepo which includes files with a layout like this
Each proto package is nested in a
v1
,v2
, etc directory andgo_path
is declared in the format likegithub.aaakk.us.kg/example/some/package/v1;v1
.The file
kafka/marketplace/v1/marketplace.proto
includesThis references the file
kafka/core/v1/core.proto
, which includesThe generated
marketplace.pb.validate.go
includesNote the fieldmask/strcase imports come from #366 but they shouldn't have anything to do with this issue.
We can see in the generated
.pb.validate.go
that we don't have any external enum imports at all.The text was updated successfully, but these errors were encountered: