Skip to content

Commit 01eaa74

Browse files
kennyderekdevalog
andauthored
Update with Fern gRPC custom options (#2032)
Co-authored-by: Devin Logan <devinannlogan@gmail.com>
1 parent 4c247a6 commit 01eaa74

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

fern/products/api-def/grpc-pages/services/grpc-services.mdx

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,4 +416,33 @@ service NotificationService {
416416
}
417417
```
418418

419-
gRPC services provide a strongly-typed, high-performance foundation for building distributed systems with clear contracts between clients and servers.
419+
gRPC services provide a strongly-typed, high-performance foundation for building distributed systems with clear contracts between clients and servers.
420+
421+
## Custom options
422+
423+
Fern provides custom Protocol Buffer options to enhance your API Reference documentation and generated code.
424+
425+
### API navigation name
426+
427+
Use the `fern.summary` option to set an explicit display name for endpoints that's more user-friendly than the default RPC method name.
428+
429+
<CodeBlock title="services.proto">
430+
```protobuf
431+
// Import Fern custom options
432+
import "fern/options.proto";
433+
434+
service CommentsService {
435+
// Description of the endpoint
436+
rpc CreateComment(CreateCommentRequest) returns (CreateCommentResponse) {
437+
option (google.api.http) = {
438+
post: "/comments/v1/comments"
439+
response_body: "comment"
440+
body: "*"
441+
};
442+
443+
// Display name shown in navigation
444+
option (fern.summary) = "Create your comment";
445+
}
446+
}
447+
```
448+
</CodeBlock>

0 commit comments

Comments
 (0)