-
Notifications
You must be signed in to change notification settings - Fork 578
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
Options on external enum constants are not linked #2748
Comments
I think this works as expected, doesn't it? /**
* If true, the schema loader will load the whole graph, including files and types not used by
* anything in the source path.
*/
var loadExhaustively: Boolean In the source path, the option you're trying to fetch isn't used. Does it mean that |
I think it kind of depends on how to interpret "being used". The type containing the options is being used, but the options on that type aren't preserved. That seems like something that I would expect to be preserved, since there's not an obvious other way besides what I'd call "workarounds", but that opinion based mostly on my use case.
That's right, and having that option would definitely help.
That's an option as well though I haven't totally explored it yet. It would require filtering on the generators, though. |
The way Wire sees things is that |
Gotcha, thanks - that makes sense. I'll look into that. It seems that this is WAI, so you can feel free to close this issue. (Aside from the lack of ability to set |
I'd be down to add it if this solves a problem that couldn't otherwise be addressed. |
This might be a more general issue than just enum constants, and I also might be "holding it wrong", but I can't figure out if it's intentional that options on external enum constants are not linked.
The use case I have in mind is to encode metadata about particular enum constants directly in protobuf, and use this in a custom
SchemaHandler
. This doesn't seem to be possible unless I add some kind of stub to force Wire to link those types.A test for
OptionsLinkingTest.kt
:This test passes if we add
loader.loadExhaustively = true
toloadAndLinkSchema
, but fails without this flag:The fact that in a test this manifests as a
NullPointerException
in a test indicates to me that it is likely not intended behavior, and it was expected for the types in question to have been linked.The text was updated successfully, but these errors were encountered: