@@ -1432,7 +1432,7 @@ <h2>Table of Contents</h2>
14321432
14331433
14341434 <li>
1435- <a href="#metalstack%2fapi%2fv2%2fmethods .proto">metalstack/api/v2/methods .proto</a>
1435+ <a href="#metalstack%2fapi%2fv2%2fmethod .proto">metalstack/api/v2/method .proto</a>
14361436 <ul>
14371437
14381438 <li>
@@ -2700,10 +2700,9 @@ <h3 id="buf.validate.FieldRules">FieldRules</h3>
27002700
27012701```proto
27022702message UpdateRequest {
2703- // The uri rule only applies if the field is populated and not an empty
2704- // string.
2705- optional string url = 1 [
2706- (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE,
2703+ // The uri rule only applies if the field is not an empty string.
2704+ string url = 1 [
2705+ (buf.validate.field).ignore = IGNORE_IF_ZERO_VALUE,
27072706 (buf.validate.field).string.uri = true
27082707 ];
27092708}
@@ -3815,21 +3814,6 @@ <h3 id="buf.validate.MessageRules">MessageRules</h3>
38153814 </thead>
38163815 <tbody>
38173816
3818- <tr>
3819- <td>disabled</td>
3820- <td><a href="#bool">bool</a></td>
3821- <td>optional</td>
3822- <td><p>`disabled` is a boolean flag that, when set to true, nullifies any validation rules for this message.
3823- This includes any fields within the message that would otherwise support validation.
3824-
3825- ```proto
3826- message MyMessage {
3827- // validation will be bypassed for this message
3828- option (buf.validate.message).disabled = true;
3829- }
3830- ``` </p></td>
3831- </tr>
3832-
38333817 <tr>
38343818 <td>cel</td>
38353819 <td><a href="#buf.validate.Rule">Rule</a></td>
@@ -3874,7 +3858,7 @@ <h3 id="buf.validate.MessageRules">MessageRules</h3>
38743858 silently ignored when unmarshalling, with only the last field being set when
38753859 unmarshalling completes.
38763860
3877- Note that adding a field to a `oneof` will also set the IGNORE_IF_UNPOPULATED on the fields. This means
3861+ Note that adding a field to a `oneof` will also set the IGNORE_IF_ZERO_VALUE on the fields. This means
38783862only the field that is set will be validated and the unset fields are not validated according to the field rules.
38793863This behavior can be overridden by setting `ignore` against a field.
38803864
@@ -6076,77 +6060,22 @@ <h3 id="buf.validate.Ignore">Ignore</h3>
60766060 </tr>
60776061
60786062 <tr>
6079- <td>IGNORE_IF_UNPOPULATED </td>
6063+ <td>IGNORE_IF_ZERO_VALUE </td>
60806064 <td>1</td>
6081- <td><p>Ignore rules if the field is unset, also for fields that don't track
6082- presence.
6083-
6084- In proto3, repeated fields, map fields, and fields with scalar types don't
6085- track presence. Consequently, the following fields are only validated if
6086- they are set:
6087-
6088- ```proto
6089- syntax="proto3";
6090-
6091- message RulesApplyIfSet {
6092- // `string.email` is ignored for the empty string.
6093- string link = 1 [
6094- (buf.validate.field).string.email = true,
6095- (buf.validate.field).ignore = IGNORE_IF_UNPOPULATED
6096- ];
6097- // `int32.gte` is ignored for the zero value.
6098- int32 age = 2 [
6099- (buf.validate.field).int32.gte = 21,
6100- (buf.validate.field).ignore = IGNORE_IF_UNPOPULATED
6101- ];
6102- // `repeated.min_items` is ignored if the list is empty.
6103- repeated string labels = 3 [
6104- (buf.validate.field).repeated.min_items = 3,
6105- (buf.validate.field).ignore = IGNORE_IF_UNPOPULATED
6106- ];
6107- }
6108- ```
6109-
6110- For fields that don't track presence, the field's value determines
6111- whether the field is set and rules apply:
6112-
6113- - For string and bytes, an empty value is ignored.
6114- - For bool, false is ignored.
6115- - For numeric types, zero is ignored.
6116- - For enums, the first defined enum value is ignored.
6117- - For repeated fields, an empty list is ignored.
6118- - For map fields, an empty map is ignored.
6119- - For message fields, absence of the message (typically a null-value) is
6120- ignored.
6065+ <td><p>Ignore rules if the field is unset, or set to the zero value.
6066+
6067+ The zero value depends on the field type:
6068+ - For strings, the zero value is the empty string.
6069+ - For bytes, the zero value is empty bytes.
6070+ - For bool, the zero value is false.
6071+ - For numeric types, the zero value is zero.
6072+ - For enums, the zero value is the first defined enum value.
6073+ - For repeated fields, the zero is an empty list.
6074+ - For map fields, the zero is an empty map.
6075+ - For message fields, absence of the message (typically a null-value) is considered zero value.
61216076
61226077For fields that track presence (e.g. adding the `optional` label in proto3),
6123- behavior is the same as the default `IGNORE_UNSPECIFIED`.
6124-
6125- To learn which fields track presence, see the
6126- [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat).</p></td>
6127- </tr>
6128-
6129- <tr>
6130- <td>IGNORE_IF_DEFAULT_VALUE</td>
6131- <td>2</td>
6132- <td><p>Ignore rules if the field is unset, or set to the default value.
6133-
6134- The default value depends on the field type:
6135- - For strings, the default value is the empty string.
6136- - For bytes, the default value is empty bytes.
6137- - For bool, the default value is false.
6138- - For numeric types, the default value is zero.
6139- - For enums, the default value is the first defined enum value.
6140- - For repeated fields, the default is an empty list.
6141- - For map fields, the default is an empty map.
6142- - For message fields, Protovalidate treats the empty message as the
6143- default value. All rules of the referenced message are ignored as well.
6144-
6145- For some fields, the default value can be overridden with the Protobuf
6146- `default` option.
6147-
6148- For fields that don't track presence and don't have the `default` option,
6149- behavior is the same as the default `IGNORE_UNSPECIFIED`.</p></td>
6078+ this a no-op and behavior is the same as the default `IGNORE_UNSPECIFIED`.</p></td>
61506079 </tr>
61516080
61526081 <tr>
@@ -6159,7 +6088,7 @@ <h3 id="buf.validate.Ignore">Ignore</h3>
61596088
61606089```proto
61616090message MyMessage {
6162- // The field's rules will always be ignored, including any validation's
6091+ // The field's rules will always be ignored, including any validations
61636092 // on value's fields.
61646093 MyOtherMessage value = 1 [
61656094 (buf.validate.field).ignore = IGNORE_ALWAYS];
@@ -14163,7 +14092,7 @@ <h3 id="metalstack.api.v2.HealthService">HealthService</h3>
1416314092
1416414093
1416514094 <div class="file-heading">
14166- <h2 id="metalstack/api/v2/methods .proto">metalstack/api/v2/methods .proto</h2><a href="#title">Top</a>
14095+ <h2 id="metalstack/api/v2/method .proto">metalstack/api/v2/method .proto</h2><a href="#title">Top</a>
1416714096 </div>
1416814097 <p></p>
1416914098
0 commit comments