protovalidate
protovalidate copied to clipboard
[Feature Request] Ruby Support
Any plan to support Ruby or do you accept ruby support PR?
Thanks for the awesome project!
I'm super excited to use this when and where I can. We're gradually moving towards a microservice architecture where all the APIs are defined in protobuf (which is amazing) but ofc each service has to do message validation on it's own :/
Ruby support isn't planned, but we will be glad to review any PRs adding support. The best place to start is creating the test harness for ruby and then working out from there.
Feature description:
Extend the capabilities of the protovalidate
library to include support for performing runtime validation of Protocol Buffers messages in Ruby projects.
Problem it solves or use case:
The current absence of Ruby support in the protovalidate
library poses a challenge for developers who work with Protocol Buffers and Ruby. By introducing Ruby support, developers will have the ability to validate Protocol Buffers messages at runtime within their Ruby applications. This enhancement will improve data integrity and mitigate potential issues related to data validation.
Proposed implementation or solution:
The proposed solution involves enhancing the protovalidate
library to encompass Ruby bindings and compatibility. This includes defining Ruby classes or modules that correspond to Protocol Buffers message structures and implementing runtime validation functions that are in sync with Ruby's dynamic typing.
Contribution: I'm enthusiastic about contributing to this feature by actively participating in discussions, helping to define Ruby class structures, and collaborating on the implementation of runtime validation functions that work well within Ruby projects. If needed, I can also assist in writing tests and documentation to ensure thorough coverage and comprehensive guidance.
Ruby CEL Interpreter:
It's worth noting that this feature might also require the implementation of a Ruby interpreter for CEL (Common Expression Language), which is used by the protovalidate
library to define validation rules. I am open to contributing to discussions around designing and implementing this interpreter if it's a requirement for enabling Ruby support.
Examples or references:
While protovalidate
does not currently offer Ruby support, other libraries like protobuf-ruby
could serve as reference points for integrating Protocol Buffers messages and validation into Ruby projects.
Additional context:
Incorporating Ruby support into the protovalidate
library will cater to developers who use Protocol Buffers in Ruby-based applications, allowing them to perform runtime validation without relying on external code generation. This aligns well with the principle of leveraging Ruby's dynamic features and flexibility in modern software development.