json
1{ 2 "$defs":{ 3 "animals":{ 4 "enum":["cat","dog"] 5 } 6 }, 7 "type":"object", 8 "properties":{ 9 "pet":{ 10 "$ref":"#/$defs/animals", 11 "enum":["cat","bird"] 12 } 13 } 14}
このschemaによる検証はいずれが正しいのでしょうか?
値 | A | B | C |
---|---|---|---|
{"pet":"cat"} | ○ | ○ | ○ |
{"pet":"dog"} | × | ○ | × |
{"pet":"bird"} | ○ | × | × |
react-jsonschema-formはA
vscodeの入力補助はB
ChatGPTに聞いたところではCでした。
あなたの回答
tips
プレビュー