Skip to content

[Feature Request] Native Kotlin Support #342

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

Open
kjkondratuk opened this issue Mar 31, 2025 · 0 comments
Open

[Feature Request] Native Kotlin Support #342

kjkondratuk opened this issue Mar 31, 2025 · 0 comments
Labels
Language Support Interest in adding support for another language

Comments

@kjkondratuk
Copy link

Feature description:
Extend the capabilities of the protovalidate library to include support for performing runtime validation of Protocol Buffers messages in Kotlin projects, for example native Android mobile applications, using native Kotlin constructs instead of the available Java implementation.

Problem it solves or use case:
A Java implementation is available, but the current lack of native Kotlin support in the protovalidate library poses challenges for developers who work with Protocol Buffers and Kotlin--an example would be native Android clients. By introducing native Kotlin support, developers can easily leverage protovalidate with all the conventionally available language features Kotlin developers love--some examples being null safety and abstractions like data classes.

Proposed implementation or solution:
The proposed solution involves extending the existing protovalidate library to incorporate native Kotlin bindings and compatibility. This includes defining Kotlin structures or classes that mirror Protocol Buffers message structures, and implementing runtime validation functions that align with Kotlin's primary language features (eg. null-safety, data classes, etc.).

CEL Interpreter
Unlike the Swift support proposed in #71 , a Java CEL interpreter does exist that may make implementing this solution easier.

Contribution:
I am not a professional Kotlin developer myself (though I've written a little in the past), and am submitting this on behalf of my team, but am happy to contribute by facilitating communication with our Android team, who would be our primary use-case for this tool.

Examples or references:
An applicable example of an ergonomic protobuf codebase in Kotlin that might be used for reference is: square/wire

Additional context:
Related to #71 regarding expanded support for mobile use-cases.

@kjkondratuk kjkondratuk added the Feature New feature or request label Mar 31, 2025
@rodaine rodaine added Language Support Interest in adding support for another language and removed Feature New feature or request labels Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language Support Interest in adding support for another language
Projects
None yet
Development

No branches or pull requests

2 participants