buf icon indicating copy to clipboard operation
buf copied to clipboard

Special-case (buf.validate.message).oneof for formatting

Open bufdev opened this issue 6 months ago • 0 comments

  • If len(fields) < 6, I want all fields to appear on one line.
  • If there is only fields and no required, I want the whole thing on one line.
  • If there is fields and required, and len(fields) < 6, I want fields on one line, required on another.
  • Otherwise, len(fields) >=6, and do the default formatting.

Examples:

option (buf.validate.message).oneof = { fields: ["id", "names"] };

option (buf.validate.message).oneof = {
  fields: ["id", "names"]
  required: true
};

bufdev avatar Jun 13 '25 16:06 bufdev