Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Protobuf Serializer #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,30 @@ def custom_convert(value):

convert(value, custom_serializer=custom_convert)
```

## Proto File Generation

[Protocol Buffers](https://developers.google.com/protocol-buffers/docs/proto) are a powerful tool
to describe structured data. In addition to the undocument json serialization it is useful to add
a proto serialization which can be used in many other contexts such as API client generation or
docs generation.

You can try it out via

```python
python3 example.py > sample.proto
```

> A prerequisite is to install []() and [`protoc`](). This is an example install command for mac:
> ```shell
> brew install protobuf
> go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest
> ```

And then generate the docs via
```shell
protoc --doc_out=./docs --doc_opt=html,docs.html sample.proto
protoc --doc_out=./docs --doc_opt=markdown,docs.md sample.proto
```

Check out the docs in the [`/docs`](/docs) directory.
Loading