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

Using top-level wildcard for kotlin_package_mapping should not rewrite well-known type package #286

Open
darronschall opened this issue Sep 12, 2024 · 0 comments

Comments

@darronschall
Copy link

If I use the kotlin_package_mapping feature with a top-level wildcard (to move all of the proto packages underneath my own top-level package), like this:

kotlin_package_mapping="*->com.exampleapp.api.*"

The generated code will convert well-known-types incorrectly. That is, it converts google.protobuf.Timestamp to com.exampleapp.api.pbandk.wkt.Timestamp. The results in a compiler error; the pbandk.wkt.Timestamp is provided by the PBandK library itself and not available at the mapped package.

The workaround is to preserve the well-known-type package mapping, like this:

kotlin_package_mapping="google.protobuf->pbandk.wkt;*->com.exampleapp.api.*"

At first I thought this was a bug, but considering I did ask every package to be rewritten to a new top-level package, maybe it's working as designed? I figured I'd log it just in case.

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