Resource.get(query) receives a RequestTarget: plain property access is silently undefined
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 90/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, typescript
調査の方向性
get(query) について説明されている reference/resources/resource-api.md から始め、次に resources/RequestTarget.ts で直接宣言されている framework プロパティを確認します。既存の target.get('param1') の例をコンテキストとして使用します。reference が RequestTarget が URLSearchParams を拡張していることを明示し、カスタムパラメーターには query.get('name') を使用し、単純なプロパティへのアクセスでは undefined になることを説明し、直接のプロパティを列挙していれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Document that a custom Resource.get(query) receives a RequestTarget, so plain property access is silently undefined
The trap
In a custom Resource handler, query is a RequestTarget, which extends URLSearchParams:
static async get(query) {
const ids = query.ids; // undefined, always, for a custom param
const ids = query.get('ids'); // correct
}
resources/RequestTarget.ts:5 — class RequestTarget extends URLSearchParams — declares only a
fixed set of framework properties (conditions, limit, select, sort, … ~:24-100). Arbitrary
query parameters are never assigned as own properties: resources/search.ts:1370's
NEEDS_PARSER = /[()[\]|!<>.]|(=\w*=)/ gates the FIQL parser, so a plain ?ids=1,2,3 (no special
characters) takes parseQuery's else branch (search.ts:1381-1406) and simply returns query
untouched.
So query.ids is undefined and there is no error — the handler quietly behaves as if the caller
sent nothing.
Why it's worth a doc callout rather than a code change
It fails silently, and it fails the same way for everyone writing their first custom Resource. It
already bit our own QA fixture: a DirectHistory test resource read query.ids and the bug stayed
invisible only because that parameter's value happened to equal the handler's default.
HarperFast/documentation reference/resources/resource-api.md:67 already shows the right form
(target.get('param1')) in an example, but nowhere states that the plain-property form silently
yields undefined. An example a reader can copy correctly is not the same as a warning a reader can
avoid; the failure mode needs naming.
Ask
In the resource-api reference, where get(query) is described:
- State that
queryis aRequestTarget extends URLSearchParams. - State that custom query parameters must be read with
query.get('name'), and that plain property
access returnsundefinedwithout error. - Note which properties are available directly (the declared framework set:
conditions,limit,
select,sort, …), so the distinction is learnable rather than a rule to memorize.
Not this
HarperFast/harper#135 ("A target should have parsed query properties in static REST methods") is
CLOSED (2026-04-15, PR #124 "Immediately parse search/queries in URLs provided to RequestTarget").
That fix made the declared special-purpose properties parse eagerly in the constructor; it never
made arbitrary custom parameter names land as own properties, and was not intended to. So this is not
covered by #135's closure — re-verified on main 6d725818c.
— Claude Opus 5.5
- 主要言語
- MDX
- スター
- 9
- フォーク
- 9
- 平均マージ
- 1日 20時間
- マージ済み PR(30日)
- 16
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
HarperFast/documentation のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
HarperFast/documentation#677 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 88/100
HarperFast/documentation#675 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
HarperFast/documentation#665 ·
メンテナーはふだん 2 日以内に返信
-
content
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
HarperFast/documentation#478 ·
メンテナーはふだん 2 日以内に返信
-
content
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
HarperFast/documentation#399 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
HarperFast/documentation の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
microsoft/onnxruntime#33018 ·
メンテナーはふだん 2 日以内に返信
-
missing content writing algorithms
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
QuantConnect/Documentation#2739 ·
メンテナーはふだん 1 日以内に返信
-
:watch: Not Triaged dotnet-target-version
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
copilot documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
lichess-org/api#678 ·