postmanlabs / postman-app-support

Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.
https://www.postman.com
5.85k stars 839 forks source link

gRPC reflection doesn't support proto2 extension types #12372

Open jtimmons opened 1 year ago

jtimmons commented 1 year ago

Is there an existing issue for this?

Describe the Issue

Postman fails to load a gRPC API via reflection when the API leverages proto2 extension types with the error Could not load server reflection. Details: duplicate name '<field>' in Type <extended-message>

This is officially supported by the reflection spec and works in other reflection clients such as grpccurl and grpcui

Steps To Reproduce

This is currently failing in the sample server from the NestJS gRPC Reflection Module library that I maintain and can be reproduced by starting that server and attempting to reflect the API.

Start the server. Run from the nestjs-grpc-reflection-module repo

  1. Switch to node 20
  2. Install dependencies with npm install
  3. Start sample server with npm run start:dev

Reflect the exposed API in Postman

  1. Create a new gRPC request
  2. Enter localhost:5000 as the server URL
  3. Click the dropdown saying "select a method" and choose "Use Server Reflection"

As an alternative to running my server directly, it should be able to be replicated with the following minimal proto definition:

syntax = "proto2";

package vendor;

message CommonMessage {
  optional string common = 1;
  extensions 100 to 199;
}

extend CommonMessage {
  optional bool ext = 101;
}

Screenshots or Videos

image

Operating System

macOS

Postman Version

10.18.9

Postman Platform

Postman App

User Account Type

Signed In User

Additional Context?

No response

andoshin11 commented 8 months ago

Any update on this?