Repository navigation
Render field descriptions on $ref fields in swagger - #469
Merged
Merged
Conversation
aks-px
force-pushed
the
swagger-ref-descriptions
branch
from
November 2, 2026 10:42
3f1be5d to
bda1ef2
Compare
aks-px
force-pushed
the
swagger-ref-descriptions
branch
from
November 10, 2026 04:53
bda1ef2 to
ed0caaf
Compare
adasingh-px
approved these changes
Nov 27, 2026
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.
What this PR does / why we need it:
protoc-gen-swagger writes field docs next to
$ref:In Swagger 2.0 an object with
$refis replaced entirely by the thing itpoints to, so
description/titlenext to it are ignored. Scalar fields andmessage-level descriptions have no
$ref, so they were unaffected.protoc-gen-swagger v1.16.0 (which we pin to stay on grpc-gateway v1) has no
option to change this. The fix in protoc-gen-openapiv2 (
use_allof_for_refs)needs a toolchain migration.
Fix
Post-process the generated swagger in
make protowithjq, wrapping any$refthat has sibling keys in a single-item
allOf:Which issue(s) this PR fixes (optional)
Closes #
Special notes for your reviewer: