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

[Question] Carrying Patches from protoc-gen-validate #195

Closed
rsylim804 opened this issue Apr 11, 2024 · 1 comment
Closed

[Question] Carrying Patches from protoc-gen-validate #195

rsylim804 opened this issue Apr 11, 2024 · 1 comment
Labels
Question Questions about the project or libraries

Comments

@rsylim804
Copy link

We are trying to migrate from protoc-gen-validate but we also apply a few patches such as validation on (google.api.field_behavior) = required, etc. Affected files that we patch in the protoc-gen-validate repository are included under templates/go/... templates/goshared/... and templates/shared/....

More specifically within the protovalidate repository is there an equivalent file that exists under protoc-gen-openapi like for templates/shared/functions.go? And generally patches that applied under these files in protoc-gen-validate is there equivalent files in the protovalidate repository?

@rsylim804 rsylim804 added the Feature New feature or request label Apr 11, 2024
@rodaine rodaine added Question Questions about the project or libraries and removed Feature New feature or request labels Apr 12, 2024
@rodaine
Copy link
Member

rodaine commented Apr 12, 2024

Hi, @rsylim804! While protoc-gen-validate (PGV) relied on code generation to provide validation methods, protovalidate does its job entirely at runtime with zero code generation. The only information used is what's included in your proto files themselves. The standard constraints provided by protovalidate are a superset of those you're familiar with from PGV, but also adds support for custom constraints via CEL expressions. There's work underway to make this more ergonomic for rules that are often repeated/shared across multiple fields.

@rodaine rodaine closed this as completed Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Questions about the project or libraries
Projects
None yet
Development

No branches or pull requests

2 participants