Kong / Kong/httpsnippet

Typescript error when `postData` is missing

オープン
#325 コメント 3 件 リアクション 3 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
1.2k
フォーク
242
PR マージ指標
30日以内にマージされた PR はありません

説明

From the example:
```
const snippet = new HTTPSnippet({
method: 'GET',
url: 'http://mockbin.com/request',
});

const options = { indent: '\t' };
const output = snippet.convert('shell', 'curl', options);
console.log(output);
```

I get a typescript error

```
Argument of type '{ method: string; url: string; }' is not assignable to parameter of type 'HarRequest | HarEntry'.
Type '{ method: string; url: string; }' is not assignable to type 'HarRequest'.
Property 'postData' is missing in type '{ method: string; url: string; }' but required in type '{ postData: any; }'.ts(2345)
httpsnippet.d.ts(19, 5): 'postData' is declared here.
```

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start with the TypeScript declaration referenced in the error, httpsnippet.d.ts, and compare its HarRequest definition with the example that constructs HTTPSnippet without postData. Verify the corrected typing by compiling the shown example and confirming that the missing-postData error is gone.

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

評価

技術スタック
typescript
領域
developer-experience
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
48/100

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

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