UNPKG

@nju33/json-schema

Version:

[![@nju33/json-schema](https://badgen.net/npm/v/@nju33/json-schema?icon=npm)](https://www.npmjs.com/package/@nju33/json-schema)

54 lines (49 loc) 786 B
{ "$schema": "http://json-schema.org/draft-07/schema", "title": "JSON schema for test", "type": "object", "properties": { "var": { "type": "string", "enum": ["foo", "hoge"], "default": "foo" } }, "allOf": [ { "if": { "properties": { "var": { "const": "foo" } } }, "then": { "properties": { "foo": { "type": "string" } } } }, { "if": { "properties": { "var": { "const": "hoge" } } }, "then": { "properties": { "hoge": { "type": "string" } } } } ], "dependencies": { "foo": ["var"] } }