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

Introduce MessageReflector to enable alternative protobuf runtimes #132

Closed

Conversation

andrewparmet
Copy link

@andrewparmet andrewparmet commented May 12, 2024

see #80

see open-toast/protokt@0cd3157 for what the implementation looks like given this PR

@CLAassistant
Copy link

CLAassistant commented May 12, 2024

CLA assistant check
All committers have signed the CLA.

@andrewparmet andrewparmet changed the title introduce MessageLike to enable alternative protobuf runtimes Introduce MessageLike to enable alternative protobuf runtimes May 30, 2024
@andrewparmet andrewparmet force-pushed the enable-lazy-protokt-evaluation branch 3 times, most recently from 35bf1b7 to 7928e60 Compare May 30, 2024 04:21
return clazz.cast(value);
@Nullable
public <T> T jvmValue(Class<T> clazz) {
return null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this not used by anyone? Could we not keep it returning the underlying Message as before?

Do we need to make smaller interfaces and only implement jvmValue on Value types that provide a valid implementation?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, this is not used. jvmValue is used for fields that protovalidate-java validates directly itself, like enums (as opposed to passing into CEL), and right now it does not do any validation on message types.

See also the changed doc on Value.jvmValue.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But even if it did, it doesn't make much sense to cast the message type to anything, does it? This hints at the narrower interface you mention.

@andrewparmet andrewparmet changed the title Introduce MessageLike to enable alternative protobuf runtimes Introduce MessageReflector to enable alternative protobuf runtimes Jun 22, 2024
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

Successfully merging this pull request may close these issues.

3 participants