An open API service indexing awesome lists of open source software.

https://github.com/scisharp/protobuf.text

Text format support for protobuf
https://github.com/scisharp/protobuf.text

Last synced: about 1 year ago
JSON representation

Text format support for protobuf

Awesome Lists containing this project

README

          

# Google Protobuf for TextFormat
Protobuf is not supporting text-format in the Google.Protobuf C# implementation at this moment. This project provides text format support for [protobuf](https://github.com/protocolbuffers/protobuf) in C#.

[![Join the chat at https://gitter.im/publiclab/publiclab](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/sci-sharp/community) [![NuGet](https://img.shields.io/nuget/dt/Protobuf.Text.svg)](https://www.nuget.org/packages/Protobuf.Text)

```shell
PM> Install-Package Protobuf.Text
```

**How to use:**

```csharp
// parse from text
TestAllTypes parsedFromText = TestAllTypes.Parser.ParseText(text);

// serialize to text
var text = parsedFromText.ToText();

// config
var config = File.ReadAllText("PATH");
var parsed = TextParser.Default.Parse(config);
```

Related [issue](https://github.com/protocolbuffers/protobuf/issues/6654) on Protobuf repo.