bufbuild/es: enable json_types=true in generated SDKs

オープン
#2,890 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

  • #2891 @saefty による — マージされずにクローズ

評価

難易度
1/5
見積もり時間
1〜3時間
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
typescript

調査の方向性

Find the bufbuild/es plugin configuration that sets registry.opts for generated npm SDKs and read the surrounding versioning conventions. Add json_types=true as proposed, then verify the next generated SDK's .d.ts files include JSON message types while .js output stays unchanged. Pull request #2891 is already open for this issue.

索引モデルが issue の本文から書いたものです。

説明

The generated npm SDKs of buf.build/bufbuild/es are built with registry.opts: [import_extension=js]. protoc-gen-es v2 also has the option json_types=true, which adds a type for the JSON form of every message. Users of the generated SDKs cannot set plugin options, so they never get these types.

Use case: HTTP APIs that use the protobuf JSON mapping instead of gRPC. A client that only needs types for the JSON it receives has to derive them itself or run buf generate.

Effect: The .js output does not change. The .d.ts files gain the JSON types. toJson() without options returns the message's JSON type instead of JsonValue, so code that annotates the result as JsonValue may no longer compile.

Proposed change: add json_types=true to registry.opts of the next bufbuild/es version.

主要言語
Dockerfile
スター
75
フォーク
27
平均マージ
5時間 35分
マージ済み PR(30日)
52

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bufbuild/plugins のほかの issue

bufbuild/plugins の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。