[Bug]: http-client-js expand guards use truthy check, dropping falsy values like false and 0
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
- #10965 @sugiruu による — マージされずにクローズ
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- typescript
- 領域
- api
調査の方向性
URI template expand キーが条件付きオブジェクトスプレッドを生成する http-client-js emitter から始めます。false、0、空文字列の値で問題を再現し、その後 guards を更新して定義済みの値が保持されるようにし、undefined の値が引き続き省略されることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
The http-client-js emitter generates truthy guards (&&) for URI template expand keys. This means falsy values like false, 0, and "" are silently dropped from the query string.
Reproduction
TypeSpec definition:
model ListParams {
@query isActive?: boolean;
@query page?: int32;
}
Generated code:
...(options?.isActive && { isActive: options.isActive }),
...(options?.page && { page: options.page }),
Calling with { isActive: false } or { page: 0 } drops the param entirely because false && { ... } and 0 && { ... } short-circuit.
Expected: Use nullish checks instead of truthy checks:
...(options?.isActive != undefined && { isActive: options.isActive }),
...(options?.page != undefined && { page: options.page }),
Versions: @typespec/[email protected], @typespec/[email protected]
Checklist
- Follow our Code of Conduct
- Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- The provided reproduction is a minimal reproducible example of the bug.
- 主要言語
- Java
- スター
- 5.9k
- フォーク
- 403
- 平均マージ
- 3日 8時間
- マージ済み PR(30日)
- 101
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/typespec のほかの issue
-
[Bug]: `@encode(string)` int64 default becomes `null`, and numeric examples ignore the encoding対応中かも @Om-singhaI が 16 日前に担当しました。 オープンbug compiler:core triaged:core
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoft/typespec#12059 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Http-client-js operation response on the client doesn't carry the return type対応中かも @reginaldalfret が 14 日前に担当しました。 オープンemitter:client:js
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
microsoft/typespec#11853 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: @terminalEvent on a model-payload variant emits an unconstrained oneOf branch in OpenAPI 3.2 SSE output対応中かも @Shubham-Padkonde が 25 日前に担当しました。 オープンbug emitter:openapi3 triaged:core
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
microsoft/typespec#11747 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: [http-server-csharp] Model with a `Record<unknown>[]` property generates C# that does not compile (missing `using System.Text.Json.Nodes;`)再び着手できるかも @nightcityblade が 44 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug emitter:service:csharp triaged:core
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
microsoft/typespec#11733 · コメント 2 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
emitter:client:java feature
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
microsoft/typespec#11076 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
microsoft/typespec の issue をすべて見る
似ている issue
-
:maddi-inspection-kotlin:test runs out of heap in a full maddi test run; exit 1 with no failing testオープンbuild/ci front-end:kotlin
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
uwolfer/gerrit-intellij-plugin#768 ·
メンテナーはふだん 1 日以内に返信
-
github_actions
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
hiero-ledger/hiero-consensus-node#27621 ·
メンテナーはふだん 1 日以内に返信
-
x:knowledge/elementary x:module/practice-exercise
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100