๊ณค์ถฉ
color-schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"validColors": {
"enum": ["Red"]
}
}
schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"color": { "$ref": "color-schema.json#/validColors" }
},
"required": ["color"]
}
test.json
{
"$schema": "./schema.json",
"color": "Red"
}
schema.json
๋ณ๊ฒฝ ์ฌํญ์ ์๋ฆฝ๋๋ค.ํ๋กํผํฐ ์ด๋ฆ ๋ฐ๊พธ๊ธฐ color
์ colorx
์์ schema.json
์์> (ํ์ํ) ์ค๋ฅ - test.json
: Missing property "colorx".
: heavy_check_mark : ์์ ์ ๋๋ค!
color-schema.json
๋ณ๊ฒฝ ์ฌํญ์ ์ธ์ํ์ง ๋ชปํฉ๋๋ค.๋ณ๊ฒฝ Red
์ Yellow
์์ color-schema.json
-> ์ค๋ฅ์์ด!
VSCode๋ฅผ ๋ค์ ์์ํ๋ฉด test.json
: Value is not accepted. Valid values: "Yellow".
์์ ์ํ๋ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
: x : ์๋ํ์ง ์์ต๋๋ค! (์ฆ ์ ์ด๋ ๊ฐ ์คํค๋ง ์ข ์์ฑ ๋ณ๊ฒฝ ํ VSCode๋ฅผ ๋ค์ ์์ํ์ง ์์)
VS ์ฝ๋ ๋ฒ์ : ์ฝ๋ 1.20.1 (f88bbf9137d24d36d968ea6b2911786bfe103002, 2018-02-13T15 : 31 : 21.019Z)
OS ๋ฒ์ : Linux x64 4.13.0-36-generic
์์คํ
์ ๋ณด
| ํญ๋ชฉ | ๊ฐ |
| --- | --- |
| CPU | Intel (R) Core (TM) i5-5200U CPU @ 2.20GHz (4 x 2194) |
|๋ก๋ (ํ๊ท ) | 1, 1, 1 |
| ๋ฉ๋ชจ๋ฆฌ (์์คํ
) | 7.71GB (1.54GB ๋ฌด๋ฃ) |
| Process Argv | / usr / share / code / code --unity-launch |
| ์คํฌ๋ฆฐ ๋ฆฌ๋ | no |
| VM | 0 % |
ํ์ฅ ๊ธฐ๋ฅ (6)
ํ์ฅ | ์์ฑ์ (์๋ฆผ) | ๋ฒ์
--- | --- | ---
๊ณ์ฐ | aca | 2.0.0
QML | bbe | 1.0.0
Kotlin | mat | 1.5.0
cpptools | ms- | 0.15.0
vetur | oct | 0.11.7
์ด๊ฑฐ ์ | swi | 0.0.6
ํ์ฅ์์ด ์ฌํ
๋ค์ ์์ํ ํ์๋ ์์ง๋ง schema.json
๋ณ๊ฒฝํ๋ฉด ๊ตฌ์ฑํ๊ฐ ์
๋ฐ์ดํธ๋ฉ๋๋ค.
ํ์ง๋ง ๋ค, ๋ฒ๊ทธ์
๋๋ค.
@aeschli : schema.json
๋ณ๊ฒฝํด๋ ์ข
์์ฑ์ด ๋ค์๋ก๋๋์ง ์๋๋ค๋ ๊ฒ์ ์์์ต๋๋ค. ์ด๋ฅผ ์ํํ๋ ์ ์ผํ ๋ฐฉ๋ฒ์ $ref
ํ๊ทธ๋ฅผ ํธ์งํ๋ ๊ฒ์
๋๋ค.
์ด ์ฃผ์ ์ ๋ํ ์ ๋ฐ์ดํธ๊ฐ ์์ต๋๊น?
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์ด ์ฃผ์ ์ ๋ํ ์ ๋ฐ์ดํธ๊ฐ ์์ต๋๊น?