Skip to content

Commit

Permalink
Add documentation on descriptor set
Browse files Browse the repository at this point in the history
  • Loading branch information
chokoswitch committed Aug 25, 2023
1 parent af78c2b commit 1ed61aa
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,22 @@ by the registered handler, proxied through the docs handler.

Also see a full example [here](./examples/grpc).

### Descriptor Set

The docs handler can utilize a serialized descriptor set to augment documentation with the comments
from a proto source file. It is strongly recommended to do this to make the documentation more
useful.

A descriptor set can be generated by protoc together with any other code. Source info and imports must
be included.

```bash
protoc --descriptor_set_out=descriptors.pb --include_source_info --include_imports --proto_path=. --go_out=. greet.proto
```

The serialized descriptors can be loaded with the `WithSerializedDescriptors` option when initializing a
plugin. It is recommended to `go:embed` them into the binary to ensure they are accessible.

[0]: https://armeria.dev
[1]: https://connectrpc.com/docs/go
[2]: https://github.com/grpc/grpc-go

0 comments on commit 1ed61aa

Please sign in to comment.