title: How to convert protobuf wireformat to JSON with just a message descriptor?
body: <p>Normally, to convert a protobuf message from wire format to JSON, you simply unmarshal the wire format into a <code>proto.Message</code> whose dynamic type is a concrete Go type (generated by protoc-gen-go), and then unmarshal that to JSON with the <code>protojson</code> package.</p>
  <p>I would like to know how to do the same if you <em>don't</em> have a concrete Go type, but a <code>protoreflect.MessageDescriptor</code> instead. The descriptor should have all the information necessary to parse the wire format and construct a JSON (or other formats) from it, but I can't seem to find an API for that. It seems like I need something like the following:</p>
  <pre class="lang-golang prettyprint-override"><code>func UnmarshalFromWire(b []byte, desc protoreflect.MessageDescriptor) (protoreflect.Message, error)
  
  func MarshalToJSON(m protoreflect.Message) ([]byte, error)
  </code></pre>
  <p>Is there an API like that or similar?</p>