Error: strict mode: unknown keyword: "afterRequest"
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- node.js, typescript
調査の方向性
Issue に記載されているバージョンを使用し、ドキュメント化された基本例と httpsnippet example.json --target shell --client curl --output ./examples コマンドで失敗を再現します。package.json の依存関係の設定と CLI のエントリーポイントを調査し、その後、スタックトレースに示されているバリデーションパスを追跡します。完了条件は、ドキュメント化された両方の呼び出しパスが、未知の afterRequest キーワードによって失敗しなくなることです。
索引モデルが issue の本文から書いたものです。
説明
I am getting the below error when executing the basic example provided in the docs in my NodeJs project:
/Users/harsh/Desktop/http-snippet-demo/node_modules/ajv/dist/compile/index.js:120
throw e;
^
Error: strict mode: unknown keyword: "afterRequest"
at checkStrictMode (/Users/harsh/Desktop/http-snippet-demo/node_modules/ajv/dist/compile/util.js:174:15)
at checkUnknownRules (/Users/harsh/Desktop/http-snippet-demo/node_modules/ajv/dist/compile/util.js:32:13)
at checkKeywords (/Users/harsh/Desktop/http-snippet-demo/node_modules/ajv/dist/compile/validate/index.js:120:34)
at validateFunctionCode (/Users/harsh/Desktop/http-snippet-demo/node_modules/ajv/dist/compile/validate/index.js:19:9)
at Ajv.compileSchema (/Users/harsh/Desktop/http-snippet-demo/node_modules/ajv/dist/compile/index.js:80:45)
at Ajv.resolveSchema (/Users/harsh/Desktop/http-snippet-demo/node_modules/ajv/dist/compile/index.js:193:23)
at Ajv.getSchema (/Users/harsh/Desktop/http-snippet-demo/node_modules/ajv/dist/core.js:279:43)
at validateHarRequest (/Users/harsh/Desktop/http-snippet-demo/node_modules/httpsnippet/dist/helpers/har-validator.js:66:24)
at /Users/harsh/Desktop/http-snippet-demo/node_modules/httpsnippet/dist/httpsnippet.js:262:56
at Array.forEach (<anonymous>)
Example Code:
const express = require('express');
const { HTTPSnippet } = require('httpsnippet');
const app = express();
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);
const server = app.listen(8000, '0.0.0.0', () => {
console.log('Example app listening at http://%s:%s', server.address().address, server.address().port);
});
httpsnippet version in package.json file: ^3.0.1
NodeJs version: 18.17
I am getting the same error via CLI as well when executing the below command:
httpsnippet example.json --target shell --client curl --output ./examples
- 主要言語
- TypeScript
- スター
- 1.2k
- フォーク
- 245
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Kong/httpsnippet のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
Kong/httpsnippet#356 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
Kong/httpsnippet#397 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
Kong/httpsnippet#389 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
Kong/httpsnippet#383 ·
-
Bug: R Code Generation Does Not Quote Parameters with Special Characters (e.g., `codes[]`)対応中かも @abansal21 が 499 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
Kong/httpsnippet#379 ·
Kong/httpsnippet の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
rel: fix
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Deltares/fews-web-oc#2400 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
ardia-browser/ardia#4426 ·
メンテナーはふだん 1 日以内に返信
-
Bug report: isValidISODateDashOnly accepts text before or after the date-time対応中かも @bardrop が今日担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
pnp/cli-microsoft365#7713 ·
メンテナーはふだん 1 日以内に返信
-
Diagram: Journey Type: Bug / Error
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
mermaid-js/mermaid-v13#1293 ·
メンテナーはふだん 1 日以内に返信