ProtoBufJsonConverter 0.0.2

ProtoBufJsonConverter

  • Convert a protobuf message to a JSON string using the proto definition file.
  • Convert a JSON string to a protobuf message using the proto definition file.

Usage

Proto Definition

syntax = "proto3";

// Package name
package greet;

// The greeting service definition.
service Greeter {
  rpc SayHello (HelloRequest) returns (HelloReply);
}

// The request message containing the user's name.
message HelloRequest {
  string name = 1;
}

// The response message containing the greetings
message HelloReply {
  string message = 1;
}

:one: Convert ProtoBuf byte[] to a JSON string

Code

var protoDefinition = "...". // See above

var bytes = Convert.FromBase64String("CgRzdGVm");

var convertToJsonRequest = new ConvertToJsonRequest(protoDefinition, "greet.Greeter.SayHello", bytes);

var converter = new Converter();

var json = converter.ConvertToJson(convertToJsonRequest);

JSON

{"name":"stef"}

:two: Convert JSON string to a ProtoBuf byte[]

Code

var protoDefinition = "...". // See above

var json = @"{""name"":""stef""}";

var convertToProtoBufRequest = new ConvertToProtoBufRequest(protoDefinition, "greet.Greeter.SayHello", json);

var converter = new Converter();

var protobuf = converter.ConvertToProtoBuf(convertToProtoBufRequest);

Showing the top 20 packages that depend on ProtoBufJsonConverter.

Packages Downloads
WireMock.Net
Lightweight Http Mocking Server for .Net, inspired by WireMock from the Java landscape.
22
WireMock.Net.ProtoBuf
ProtoBuf and gRPC support for WireMock.Net
18
WireMock.Net
Lightweight Http Mocking Server for .Net, inspired by WireMock from the Java landscape.
16
WireMock.Net.ProtoBuf
ProtoBuf and gRPC support for WireMock.Net
15
WireMock.Net
Lightweight Http Mocking Server for .Net, inspired by WireMock from the Java landscape.
15
WireMock.Net
Lightweight Http Mocking Server for .Net, inspired by WireMock from the Java landscape.
14
WireMock.Net.ProtoBuf
ProtoBuf and gRPC support for WireMock.Net
14
WireMock.Net.Minimal
Minimal version from the lightweight Http Mocking Server for .NET
14

See CHANGELOG.md

Version Downloads Last updated
0.11.0 21 09/30/2026
0.10.0.1 17 10/01/2026
0.10.0 14 10/01/2026
0.9.0 14 10/01/2026
0.8.0 16 10/01/2026
0.8.0-preview-01 15 10/01/2026
0.7.0 13 10/01/2026
0.7.0-preview-02 19 10/01/2026
0.7.0-preview-01 16 10/01/2026
0.6.0 15 10/01/2026
0.6.0-preview-03 13 10/01/2026
0.6.0-preview-02 16 10/01/2026
0.6.0-preview-01 14 10/01/2026
0.5.0 15 10/01/2026
0.4.0 13 10/01/2026
0.3.0 15 10/01/2026
0.2.0 18 10/01/2026
0.1.0 16 10/01/2026
0.0.6 15 10/01/2026
0.0.5 14 10/01/2026
0.0.4 12 10/01/2026
0.0.3 15 10/01/2026
0.0.2 16 10/01/2026