fullstorydev / grpcurl

Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers
MIT License
10.75k stars 502 forks source link

How to serialize using protojson #305

Open shenqidebaozi opened 2 years ago

shenqidebaozi commented 2 years ago

The jsonpb package has been discarded and protojson is recommended, but I found that protojson is not compatible with grpcurl. Is it considered to replace it with protojson? https://github.com/golang/protobuf/blob/master/jsonpb/json.go

// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Package jsonpb provides functionality to marshal and unmarshal between a
// protocol buffer message and JSON. It follows the specification at
// https://developers.google.com/protocol-buffers/docs/proto3#json.
//
// Do not rely on the default behavior of the standard encoding/json package
// when called on generated message types as it does not operate correctly.
//
// Deprecated: Use the "google.golang.org/protobuf/encoding/protojson"
// package instead.
shenqidebaozi commented 2 years ago

@jhump I'm very sorry to bother you. Can you take a look at it for me https://github.com/golang/protobuf/issues/1443