Protovalidate rules import as validation constraints
A .proto that declares its valid values with Protovalidate now keeps
them on import. (buf.validate.field).string.min_len = 3 becomes minLength: 3 on the catalog item,
exactly as if an OpenAPI schema had said so. Before, Apiome read no buf.validate option at all.
- Standard rules become constraints.
required, string lengths, patterns and well-known formats, numeric ranges,constandin, and repeated item counts and uniqueness are read into the same constraints an OpenAPI schema fills. The full table is on Read a catalog item's format details. - The JSON Schema export carries them.
minLength,pattern,minimum,enumandrequiredare written as keywords. Rules with no JSON Schema keyword (string.prefix, timestamp bounds) are listed in the fidelity report as not carried, instead of disappearing. - A Protobuf export writes them back. Exporting to Protocol Buffers (proto3) or Connect
RPC writes every rule it read, and writes constraints from other sources as rules too: an OpenAPI
minLength: 3becomes(buf.validate.field).string.min_len = 3. The new Protovalidate rules option is on by default; untick it for a.protowith no Protovalidate dependency. See Validation rules in a Protobuf or Connect RPC export. - Contract suites use them. A gRPC suite now generates request messages that satisfy the rules,
and adds a negative case for each field Protovalidate marks
required. - CEL is recorded, not evaluated. A
celrule, acel_expressionand a message-levelcelare kept and written back on a Protobuf export. The import's coverage ledger lists each one asunsupported_constraintwith the expression text. Predefined rules are not read. - You do not supply
validate.proto. Apiome providesbuf/validate/validate.proto(Protovalidate 1.2.2) when a file imports it.
Not in this release: the hosted mock does not check requests against these rules yet. That arrives with the Connect route on the mock.
