Skip to content

Commit

Permalink
add "required" to each oneOf
Browse files Browse the repository at this point in the history
  • Loading branch information
lorennorman committed Nov 8, 2023
1 parent 77c5a8a commit d4040c2
Showing 1 changed file with 34 additions and 21 deletions.
55 changes: 34 additions & 21 deletions boards/magic_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,36 +46,49 @@
"type": "array",
"items": {
"type": "object",
"required": [ "name", "type" ],
"additionalProperties": false,
"oneOf": [
{ "required": [ "isPin", "name", "type" ],
{ "required": [ "isPin" ],
"properties": {
"isPin": { "type": "boolean", "const": true },
"name": { "type": "string" },
"type": { "type": "string" },
"pinName": { "type": "string" },
"mode": { "type": "string" },
"direction": { "type": "string" }
},
"additionalProperties": false
}
},
{ "properties": {
"isPixel": { "type": "boolean", "const": true }
}},
{ "properties": {
"isI2C": { "type": "boolean", "const": true }
}},
{ "properties": {
"isPWM": { "type": "boolean", "const": true }
}},
{ "properties": {
"isServo": { "type": "boolean", "const": true }
}},
{ "properties": {
"isUART": { "type": "boolean", "const": true }
}},
{ "properties": {
"isDS18X20": { "type": "boolean", "const": true }
}}
{ "required": [ "isPixel" ],
"properties": {
"isPixel": { "type": "boolean", "const": true }
}
},
{ "required": [ "isI2C" ],
"properties": {
"isI2C": { "type": "boolean", "const": true }
}
},
{ "required": [ "isPWM" ],
"properties": {
"isPWM": { "type": "boolean", "const": true }
}
},
{ "required": [ "isServo" ],
"properties": {
"isServo": { "type": "boolean", "const": true }
}
},
{ "required": [ "isUART" ],
"properties": {
"isUART": { "type": "boolean", "const": true }
}
},
{ "required": [ "isDS18X20" ],
"properties": {
"isDS18X20": { "type": "boolean", "const": true }
}
}
]
}
}
Expand Down

0 comments on commit d4040c2

Please sign in to comment.