GoogleCloudPlatform / proto-gen-md-diagrams

A utility for generating Markdown documentation for Protocol Buffers that include Mermaid UML Diagrams.
Apache License 2.0
55 stars 16 forks source link

Correct RpcVisitor to recognize the absence of `stream` in the Service return parameter #4

Closed mmizutani closed 1 year ago

mmizutani commented 1 year ago

Currently, given a proto definition of a Unary (non-Stream) RPC call,

service SomeService {
  rpc UnaryMethod(SomeRequest) returns (/* stream */SomeResponse) {}
}

proto-gen-md-diagrams emits a Mermaid.js diagram and a table showing that the type of the return parameter is not Unary but Stream, :

classDiagram
direction LR
class SomeService {
  <<service>>
  +UnaryMethod(SomeRequest) Stream~SomeResponse~
}
Method Parameter (In) Parameter (Out) Description
UnaryMethod SomeRequest Stream\<SomeResponse> ...

This PR corrects RpcVisitor.Visit() to property handle the absence of a stream option in Service return parameters.

rmcguinness commented 1 year ago

Sincerely, thank you for the PR.