Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect typing of Struct.toJson() #1062

Closed
CharlieMartell opened this issue Apr 4, 2024 · 1 comment
Closed

Incorrect typing of Struct.toJson() #1062

CharlieMartell opened this issue Apr 4, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@CharlieMartell
Copy link

Describe the bug

Here: https://github.com/bufbuild/protobuf-es/blob/main/packages/protobuf/src/google/protobuf/struct_pb.ts#L72 we see that this function returns a JsonValue type but in the implementation it should return a JsonObject type. This means consuming applications need get type errors when doing anything like Object.entries(struct.toJson())

Environment (please complete the following information):

  • @connectrpc/connect-web version: 1.8.0
  • Frontend framework and version: react@18
  • Node.js version: node@20
  • Browser and version: Chrome
@CharlieMartell CharlieMartell added the bug Something isn't working label Apr 4, 2024
@srikrsna-buf
Copy link
Member

Hey! Can you open the issue in https://github.com/bufbuild/protobuf-es? But the tl;dr answer is it is done for symmetry and will likely be solved alongside bufbuild/protobuf-es#508

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants