Created
January 9, 2019 18:13
-
-
Save mediawrangler/5613ed6fda78208a0736fbafbaf43d44 to your computer and use it in GitHub Desktop.
React JSON Schema Form - Conditionals (Schema Dependency)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[jsonschema] | |
title = "A registration form" | |
description = "A simple form example." | |
type = "object" | |
[jsonschema.properties] | |
[jsonschema.properties.hasMiddleName] | |
type = "boolean" | |
title = "Has Middle Name?" | |
[jsonschema.properties.lastName] | |
type = "string" | |
title = "Last Name" | |
default = "Lynch" | |
[jsonschema.properties.firstName] | |
type = "string" | |
title = "First Name" | |
default = "Travis" | |
[jsonschema.dependencies] | |
[jsonschema.dependencies.hasMiddleName] | |
[[jsonschema.dependencies.hasMiddleName.oneOf]] | |
[jsonschema.dependencies.hasMiddleName.oneOf.properties] | |
[jsonschema.dependencies.hasMiddleName.oneOf.properties.hasMiddleName] | |
enum = [true] | |
[jsonschema.dependencies.hasMiddleName.oneOf.properties.middleName] | |
type = "string" | |
title = "Middle Name" | |
[[jsonschema.dependencies.hasMiddleName.oneOf]] | |
[jsonschema.dependencies.hasMiddleName.oneOf.properties] | |
[jsonschema.dependencies.hasMiddleName.oneOf.properties.hasMiddleName] | |
enum = [false] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment