Skip to content

Latest commit

 

History

History
47 lines (37 loc) · 1.36 KB

documentation.md

File metadata and controls

47 lines (37 loc) · 1.36 KB

Displaying Documentation

Both code-first and proto-first services support documentation. To enable documentation, your project will need to be setup to output documentation as XML. This can be done by adding this to the project file:

<PropertyGroup>    
  <GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

Once XML documentation has been generated, gRPC Browser will pick it up and display it.

Examples

Code-First

A service interface with the following summary comments on the interface and method:

/// <summary>
/// Place FX trade orders, stream and update FX rates.
/// </summary>
[Service]
public interface IFxApi
{
    /// <summary>
    /// Make an FX trade
    /// </summary>
    [Operation]
    Task<FxOrderResult> PlaceFxOrder(FxOrder request, CallContext context = default);

Gets displayed like this: codefirst_docs

Proto-First

A proto file with the following comments above the service and operation:

// Keeps track of the currency account balances
service AccountService {
  // Streams out the state of the currency account balances after a change. Make a trade to receive an update message
  rpc SubscribeAccountBalances (AccountBalanceRequest) returns (stream AccountBalanceUpdate);
}

Gets displayed like this: protofirst_docs