Skip to content

Commit 311a39a

Browse files
Fix typos and messages in CEL examples (#459)
I found a few copy issues while documenting these examples. This PR fixes them. --------- Co-authored-by: Timo Stamm <ts@timostamm.de>
1 parent f903e5c commit 311a39a

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

examples/cel_field_selection.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ service ApartmentService {
2424

2525
message SearchApartmentRequest {
2626
option (buf.validate.message).cel = {
27-
id: "secondary_address_after_primary_address"
27+
id: "min_bedrooms_lte_max_bedrooms"
2828
message: "the minimum number of bedrooms cannot be higher than the maximum number"
2929
// In a message-level constraint, `this` refers to the message itself, the `SearchApartmentRequest`.
3030
// You can access a field with `this.field_name`.

examples/cel_repeated_field_exists_one.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ message TeamRoster {
2929

3030
message Player {
3131
string name = 1;
32-
uint32 jersy_number = 2;
32+
uint32 jersey_number = 2;
3333
}
3434

3535
repeated Player players = 1;

examples/cel_string_is_ip.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ service LocationService {
2424
message LocationForIpRequest {
2525
string ip_address = 1 [(buf.validate.field).cel = {
2626
id: "valid_address"
27-
message: "."
27+
message: "ip_address must be a valid IP address"
2828
// `some_string.isIp()` returns whether the string is a valid ip address.
2929
// `isIp(4)` returns whether a string is an ipv4 address.
3030
// `isIp(6)` returns whether a string is an ipv6 address.
@@ -41,7 +41,7 @@ message LocationForIpResponse {
4141
message LocationForIpPrefixRequest {
4242
string ip_prefix = 1 [(buf.validate.field).cel = {
4343
id: "valid_prefix"
44-
message: "."
44+
message: "ip_prefix must be a valid IP with prefix length"
4545
// `some_string.isIpPrefix()` returns whether the string is a valid ip with prefix length.
4646
// `isIpPrefix(4)` returns whether a string is an ipv4 with prefix length.
4747
// `isIpPrefix(6)` returns whether a string is an ipv6 with prefix length.

examples/cel_wrapper_type.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ message SearchStoreRequest {
4545
// term is the search term
4646
google.protobuf.StringValue term = 1 [(buf.validate.field).cel = {
4747
id: "search_term_length"
48-
message: "search term must be not exceed 100 characters"
48+
message: "search term must not exceed 100 characters"
4949
// This validates that _if_ term is specified, it must be shorter than 100
5050
// characters long.
5151
// This rule is only evaluated when this field is specified, because
@@ -69,8 +69,8 @@ message SearchStoreRequest {
6969
google.protobuf.BoolValue in_stock = 3;
7070
// min_price is the minimum price that the search results should have.
7171
google.protobuf.FloatValue min_price = 4 [(buf.validate.field).cel = {
72-
id: "min_price_finite"
73-
message: "min_price_must_be_positive"
72+
id: "min_price_positive"
73+
message: "minimum price must be positive"
7474
// This validates that _if_ min_price is specified, it must be greater than 0.
7575
// This rule is only evaluated when this field is specified, because
7676
// google.protobuf.FloatValue is a message type, and CEL rules are evaluated

0 commit comments

Comments
 (0)