Skip to content

[BREAKING CHANGE] Reusing Custom Validation Rules #51

@justmumu

Description

@justmumu

Feature description:
I don't know it is possible. But reusing validation rules would be nice.

Problem it solves or use case:
A validation rule may be suitable for multiple fields.
Currently, same custom cel expression duplicated to all fields. This makes harder to maintain custom validation rules.

Proposed implementation or solution:
I don't know if there is a way to extend the rules. But if we could extend the rules, we could apply the rule to the field as normal standard constraint.

For Example;

string xxx = 1 [(buf.validate.field) = {string.<custom_cel_id>: true}];

Contribution:

Examples or references:

Additional context:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Breaking ChangeDescribes a breaking change to the protovalidate APIFeatureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions