feat: add support for custom fern.summary proto option#13
Merged
kennyderek merged 1 commit intomainfrom Nov 13, 2025
Merged
Conversation
- Add extensions/fern/options.proto defining custom summary option for RPC methods
- Generate Go code from options.proto
- Modify generator to read fern.summary option and set it as OpenAPI operation summary
- This allows users to explicitly set endpoint display names in gRPC proto files
Usage:
import "fern/options.proto";
rpc CreateComment(CreateCommentRequest) returns (CreateCommentResponse) {
option (google.api.http) = { post: "/comments" };
option (fern.summary) = "Add a Comment";
}
The custom summary will be emitted as the OpenAPI operation's summary field,
which Fern CLI uses as the endpoint display name.
Co-Authored-By: kenny@buildwithfern.com <kenny@buildwithfern.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
devin-ai-integration bot
added a commit
to fern-api/fern
that referenced
this pull request
Nov 13, 2025
Temporarily pin CI to use the modified protoc-gen-openapi that supports reading the custom fern.summary option. This allows the grpc-comments test to pass with the custom summary 'Add a Comment'. Once fern-api/protoc-gen-openapi#13 is merged and released, this should be updated to use @latest or a tagged release. Co-Authored-By: kenny@buildwithfern.com <kenny@buildwithfern.com>
devin-ai-integration bot
added a commit
to fern-api/fern
that referenced
this pull request
Nov 13, 2025
Update both ci.yml and bootstrap.sh to use the modified protoc-gen-openapi that supports reading the custom fern.summary option from proto files. This allows the grpc-comments test to pass with the custom summary 'Add a Comment' instead of the auto-generated 'Create Comment'. Once fern-api/protoc-gen-openapi#13 is merged and released, these should be updated to use @latest or a tagged release. Co-Authored-By: kenny@buildwithfern.com <kenny@buildwithfern.com>
3 tasks
kennyderek
approved these changes
Nov 13, 2025
kennyderek
added a commit
to fern-api/fern
that referenced
this pull request
Nov 14, 2025
* test: add gRPC fixture with comments service - Add grpc-comments fixture with proto configuration - Create comments.proto with CreateComment RPC using google.api.http annotations - Add test case to verify gRPC proto processing pipeline - Generate FDR snapshots for regression testing Co-Authored-By: kenny@buildwithfern.com <kenny@buildwithfern.com> * style: fix formatting in openapi-from-flag.test.ts Co-Authored-By: kenny@buildwithfern.com <kenny@buildwithfern.com> * style: fix YAML formatting in grpc-comments generators.yml Co-Authored-By: kenny@buildwithfern.com <kenny@buildwithfern.com> * feat(register): improve gRPC endpoint name display in FDR output Co-Authored-By: kenny@buildwithfern.com <kenny@buildwithfern.com> * fix(register): correct TypeReference property access for endpoint naming Co-Authored-By: kenny@buildwithfern.com <kenny@buildwithfern.com> * feat(cli): add support for custom fern.summary proto option - Add fern/options.proto defining custom summary option for RPC methods - Update grpc-comments fixture to use fern.summary option - Custom summary 'Add a Comment' now appears in FDR output - Remove unused grpc-gateway dependency from fixture This allows users to explicitly set endpoint display names in gRPC proto files using: option (fern.summary) = "Custom Name"; Requires protoc-gen-openapi to support reading the fern.summary option. Co-Authored-By: kenny@buildwithfern.com <kenny@buildwithfern.com> * chore: pin protoc-gen-openapi to PR #13 commit for fern.summary support Temporarily pin CI to use the modified protoc-gen-openapi that supports reading the custom fern.summary option. This allows the grpc-comments test to pass with the custom summary 'Add a Comment'. Once fern-api/protoc-gen-openapi#13 is merged and released, this should be updated to use @latest or a tagged release. Co-Authored-By: kenny@buildwithfern.com <kenny@buildwithfern.com> * chore: pin CI to use protoc-gen-openapi PR #13 commit Update both ci.yml and bootstrap.sh to use the modified protoc-gen-openapi that supports reading the custom fern.summary option from proto files. This allows the grpc-comments test to pass with the custom summary 'Add a Comment' instead of the auto-generated 'Create Comment'. Once fern-api/protoc-gen-openapi#13 is merged and released, these should be updated to use @latest or a tagged release. Co-Authored-By: kenny@buildwithfern.com <kenny@buildwithfern.com> * fix: bump CLI version to 0.123.0 for feat type change The changelog validator requires a minor version bump (0.122.1 -> 0.123.0) for 'feat' type changes per semver rules. Changed from 0.122.2 to 0.123.0. Co-Authored-By: kenny@buildwithfern.com <kenny@buildwithfern.com> * tmp rm versions.yml * test only --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: kenny@buildwithfern.com <kenny@buildwithfern.com> Co-authored-by: Kenny Derek <pickypulsars@gmail.com>
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.
feat: add support for custom fern.summary proto option
Summary
This PR adds support for a custom protobuf option
fern.summarythat allows users to explicitly set the display name for gRPC endpoints in their proto files. The custom summary is emitted as the OpenAPI operation'ssummaryfield, which Fern CLI uses as the endpoint display name.Usage example:
Changes:
extensions/fern/options.protodefining the custom option (field number 51001)generator.goto read thefern.summaryoption and set it on the OpenAPI operation's Summary fieldReview & Testing Checklist for Human
Verify option ordering is correct: The code reads
fern.summaryBEFORE merging the genericOperationannotation (line 765-770 vs 772-776). This means if both are set, the Operation annotation will override fern.summary. Is this the intended behavior, or should fern.summary take precedence?Confirm field number 51001 is appropriate: Custom protobuf extensions should use field numbers in specific ranges. Verify that 51001 is in the correct range and doesn't conflict with other extensions.
Test end-to-end: While this was tested through the Fern CLI test suite, please test manually with a real proto file to ensure:
Consider adding unit tests: This PR has no tests in the protoc-gen-openapi repo itself. Should we add tests for the new functionality?
Notes
extFernSummary.(string)) is safe because protobuf extensions are strongly typed, but we could add better error handling if needed.Devin session: https://app.devin.ai/sessions/35ba7fe604104e64afe342a676df4463
Requested by: kenny@buildwithfern.com