You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
proto3 optional causes the field to be treated as a oneof. From what I can tell this is caused by protoreflectadding synthetic oneofs to descriptors for proto3 optional fields.
Environment details
Programming language: protobuf
OS: macos
Language runtime version: 3
Package version: 1.59.1
Steps to reproduce
Use proto3 optional on a field that must not be oneof. page_token and page_size are easy repro cases.
Run linter and observe errors stating that the field must not be a oneof
messageListBooksRequest {
// The parent, which owns this collection of books.// Format: publishers/{publisher}stringparent=1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "library.googleapis.com/Book"
}];
// The maximum number of books to return. The service may return fewer than// this value.// If unspecified, at most 50 books will be returned.// The maximum value is 1000; values above 1000 will be coerced to 1000.optionalint32page_size=2 [(google.api.field_behavior) = OPTIONAL];
// A page token, received from a previous `ListBooks` call.// Provide this to retrieve the subsequent page.//// When paginating, all other parameters provided to `ListBooks` must match// the call that provided the page token.optionalstringpage_token=3 [(google.api.field_behavior) = OPTIONAL];
}
> The `page_token` field should not be a oneof field. https://linter.aip.dev/158/request-page-token-field
> The `page_size` field should not be a oneof field. https://linter.aip.dev/158/request-page-size-field
The text was updated successfully, but these errors were encountered:
proto3
optional causes the field to be treated as aoneof
. From what I can tell this is caused byprotoreflect
adding synthetic oneofs to descriptors for proto3 optional fields.Environment details
Steps to reproduce
optional
on a field that must not beoneof
.page_token
andpage_size
are easy repro cases.oneof
The text was updated successfully, but these errors were encountered: