[Schematics CLI] Numeric strings in schematics options
- 主要言語
- TypeScript
- スター
- 27k
- フォーク
- 11.8k
- 平均マージ
- 14時間 23分
- マージ済み PR(30日)
- 162
説明
### Command
generate
### Is this a regression?
- [ ] Yes, this behavior used to work in the previous version
### The previous version in which this bug was not present was
_No response_
### Description
From http://b/196605664.
Apparently you can't pass in a numeric value into a string argument in schematics. This appears to be interpreted as number and leads to a validation error.
### Minimal Reproduction
```
$ schematics run test --stringValue "1234"
Schematic input does not validate against the Schema: {"stringValue":1234}
Errors:
Data path ".stringValue" should be string.
```
Minimist seems to interpret "1234" as a number instead of a string, and schematics treats that as a type mismatch.
### Exception or Error
_No response_
### Your Environment
```text
See http://b/196605664.
```
### Anything else relevant?
_No response_
コントリビューションガイド
調査の方向性
generate コマンドのオプション解析と、レポートで説明されている minimist の処理から始め、次に --stringValue "1234" を指定してコマンドを再現します。引用符で囲まれた値が数値になる箇所を追跡し、string オプションに渡された数値のように見える値が、文字列としてスキーマ検証に到達することを確認してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- cli
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100