Repository navigation
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
This was referenced Nov 13, 2026
Author
|
recheck |
Expose custom bytes, string and repeated-field rules through the plugin. Validate representation paths without rejecting qualified associated types or parentheses, clarify unmatched extension rules and single-invocation requirements, and compile-test preserved configurations in CI.
vanderbr
force-pushed
the
plugin-custom-types
branch
from
November 17, 2026 14:04
5c5074f to
de1667d
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #822.
protoc-gen-buffacan now select the custom owned bytes, string and repeated-field representations already available throughbuffa-build, so Buf workflows can use these types without editing generated sources.bytes_type_custom_in=<proto_path>=<rust_type>string_type_custom_in=<proto_path>=<rust_type>repeated_type_custom_in=<proto_path>=<template>*is the element typeThe options are repeatable and preserve the existing normalization, prefix matching and last-match-wins ordering.
.selects every field. Malformed rules produce option-specific errors. Codegen rejects unsupported non-path representations such as_,(), arrays, references andimpl Traitin the plugin response, while preserving valid qualified associated-type paths and parenthesized type paths. Whether the named type exists and implements the required traits remains a consumer compile-time check.Unmatched-rule diagnostics now work for both front ends and distinguish extension-only matches from fields in files generated by another invocation. Tests cover imported files, package-less extensions and diagnostic precedence.
The guide documents when Buf needs
strategy: allto avoid duplicate generated element-trait implementations: custom bytes used as repeated elements or map values with JSON or vtable reflection, and custom strings in those positions with vtable reflection. Per-directory generation does not coordinate these implementations; this PR documents the supported single-invocation setup.Validation:
Contributed by ReallyMe Technologies Limited.