Skip to content

Commit

Permalink
Changed around examples
Browse files Browse the repository at this point in the history
  • Loading branch information
geraintluff committed Jan 30, 2013
1 parent eb805c7 commit 033b0e8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,25 @@
"content": [
"Any schema in the list that matches the current instance also describes that instance. If this property is defined in the schema, the instance is only considered valid with regards to the containing schema if it is valid with regards to at least one of the schemas in the list.",
"Jsonary makes this list of schemas available using the <code>orSchemas()</code> method of schemas / schema lists.",
"The example below uses \"allOf\" to switch between two schemas depending on the value of the \"conditionalProperty\" property in the instance."
"The example below uses \"anyOf\" to specify that at least one of \"A\" and \"B\" must be specified."
],
"exampleSchema": {
"type": "object",
"properties": {
"conditionalProperty": {"type": "boolean"}
"A": {"type": "boolean"},
"B": {"type": "boolean"}
},
"required": ["conditionalProperty"],
"additionalProperties": false,
"anyOf": [
{
"title": "Condition ON",
"properties": {
"conditionalProperty": {
"enum": [true]
}
}
"title": "A required",
"required": ["A"]
},
{
"title": "Condition OFF",
"properties": {
"conditionalProperty": {
"enum": [false]
}
}
"title": "B required",
"required": ["B"]
}
]
},
"exampleData": {"conditionalProperty": true}
"exampleData": {"A": true}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,28 @@
"exampleSchema": {
"type": "object",
"properties": {
"numberProperty": {"type": "integer"}
"conditionalProperty": {"type": "boolean"}
},
"required": ["numberProperty"],
"required": ["conditionalProperty"],
"additionalProperties": false,
"oneOf": [
{
"title": "Less than 5",
"title": "Condition ON",
"properties": {
"numberProperty": {
"maximum": 5,
"exclusiveMaximum": true
"conditionalProperty": {
"enum": [true]
}
}
},
{
"title": "More than 0",
"title": "Condition OFF",
"properties": {
"numberProperty": {
"minimum": 0,
"exclusiveMinimum": true
"conditionalProperty": {
"enum": [false]
}
}
}
]
},
"exampleData": {"numberProperty": 10}
"exampleData": {"conditionalProperty": true}
}

0 comments on commit 033b0e8

Please sign in to comment.