Skip to content

Commit

Permalink
Do not make $refs having siblings, which are generally ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
mmouchous-ledger committed Dec 5, 2024
1 parent 380f5ed commit 0593f90
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 19 deletions.
6 changes: 5 additions & 1 deletion config_schema/camera.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@
"description": "A Camera responding to a Rest API."
}
},
"$ref": "rest.schema.json"
"allOf": [
{
"$ref": "rest.schema.json"
}
]
},
{
"properties": {
Expand Down
20 changes: 16 additions & 4 deletions config_schema/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,24 @@
"type": "object",
"properties": {
"camera": {
"$ref": "camera.schema.json",
"description": "The main camera of the setup."
"allOf": [
{
"$ref": "camera.schema.json"
},
{
"description": "The main camera of the setup."
}
]
},
"stage": {
"$ref": "stage.schema.json",
"description": "The main stage of the setup."
"allOf": [
{
"$ref": "stage.schema.json"
},
{
"description": "The main stage of the setup."
}
]
},
"lasers": {
"type": "array",
Expand Down
6 changes: 5 additions & 1 deletion config_schema/laser.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
],
"oneOf": [
{
"allOf": [
{
"$ref": "serial.schema.json"
}
],
"properties": {
"type": {
"const": "PDM",
Expand All @@ -25,7 +30,6 @@
"description": "The index of the PDM device"
}
},
"$ref": "serial.schema.json",
"required": [
"num"
]
Expand Down
42 changes: 29 additions & 13 deletions config_schema/stage.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Stage",
"type": "object",
"description": "A Stage.",
"allOf": [
{
"$ref": "instrument.schema.json"
Expand All @@ -22,21 +21,34 @@
},
"oneOf": [
{
"properties": {
"type": {
"const": "Corvus",
"description": "Corvus Stage."
"allOf": [
{
"properties": {
"type": {
"const": "Corvus",
"description": "A Corvus Stage."
}
}
},
{
"$ref": "serial.schema.json"
}
},
"$ref": "serial.schema.json"
]
},
{
"properties": {
"type": {
"const": "CNC",
"description": "CNC Stage."
"allOf": [
{
"properties": {
"type": {
"const": "CNC",
"description": "A CNC Stage."
}
}
},
{
"$ref": "serial.schema.json"
}
}
]
},
{
"properties": {
Expand All @@ -53,7 +65,11 @@
"description": "A Stage responding to a Rest API."
}
},
"$ref": "rest.schema.json"
"allOf": [
{
"$ref": "rest.schema.json"
}
]
}
],
"required": [
Expand Down

0 comments on commit 0593f90

Please sign in to comment.