Skip to content

Commit

Permalink
update schema structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddykasp committed Oct 9, 2024
1 parent e186312 commit df3cd18
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 83 deletions.
2 changes: 1 addition & 1 deletion schema/klighd/actions/setSyntheses.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "setSyntheses",
"type": "object",
"allOf": [{"$ref": "../../sprotty/messages/diagramAccept.json#/definitions/action"}],
"allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/sprotty/action.json"}],
"properties": {
"kind": {
"type": "string",
Expand Down
28 changes: 16 additions & 12 deletions schema/klighd/actions/updateOptions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "updateOptions",
"type": "object",
"allOf": [{"$ref": "../../sprotty/messsages/diagramAccept.json#/definitions/action"}],
"allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/sprotty/action.json"}],
"properties": {
"kind": {
"type": "string",
Expand All @@ -12,7 +12,7 @@
"valuedSynthesisOptions": {
"type": "array",
"items": {
"$ref": "#/definitions/SynthesisOption"
"$ref": "#/definitions/ValuedSynthesisOption"
}
},
"layoutOptions": {
Expand All @@ -26,7 +26,7 @@
}
},
"definitions": {
"SynthesisOption": {
"ValuedSynthesisOption": {
"type": "object",
"properties": {
"synthesisOption": {
Expand All @@ -35,15 +35,16 @@
{"$ref": "#/definitions/choiceSynthesisOption"},
{"$ref": "#/definitions/rangeSynthesisOption"},
{"$ref": "#/definitions/textSynthesisOption"},
{"$ref": "#/definitions/separatorSynthesisOption"}
{"$ref": "#/definitions/separatorSynthesisOption"},
{"$ref": "#/definitions/categorySynthesisOption"}
]
},
"currentValue": {
"type": ["string", "number", "boolean"]
}
}
},
"generalSynthesisOption": {
"SynthesisOption": {
"type": "object",
"properties": {

Expand All @@ -60,7 +61,7 @@
"type": "string"
},
"category": {
"$ref": "#/definitions/SynthesisCategory"
"$ref": "#/definitions/categorySynthesisOption"
},
"sourceHash": {
"type": "string"
Expand All @@ -69,7 +70,7 @@
}
},
"checkSynthesisOption": {
"allOf": [{"$ref": "#/definitions/generalSynthesisOption"}],
"allOf": [{"$ref": "#/definitions/SynthesisOption"}],
"properties": {
"type": {
"type": "number",
Expand All @@ -81,7 +82,7 @@
}
},
"choiceSynthesisOption": {
"allOf": [{"$ref": "#/definitions/generalSynthesisOption"}],
"allOf": [{"$ref": "#/definitions/SynthesisOption"}],
"properties": {
"type": {
"type": "number",
Expand All @@ -99,7 +100,7 @@
}
},
"rangeSynthesisOption": {
"allOf": [{"$ref": "#/definitions/generalSynthesisOption"}],
"allOf": [{"$ref": "#/definitions/SynthesisOption"}],
"properties": {
"type": {
"type": "number",
Expand All @@ -125,7 +126,7 @@
}
},
"textSynthesisOption": {
"allOf": [{"$ref": "#/definitions/generalSynthesisOption"}],
"allOf": [{"$ref": "#/definitions/SynthesisOption"}],
"properties": {
"type": {
"type": "number",
Expand All @@ -137,7 +138,7 @@
}
},
"separatorSynthesisOption": {
"allOf": [{"$ref": "#/definitions/generalSynthesisOption"}],
"allOf": [{"$ref": "#/definitions/SynthesisOption"}],
"properties": {
"type": {
"type": "number",
Expand All @@ -146,11 +147,14 @@
}
},
"categorySynthesisOption": {
"allOf": [{"$ref": "#/definitions/generalSynthesisOption"}],
"allOf": [{"$ref": "#/definitions/SynthesisOption"}],
"properties": {
"type": {
"type": "number",
"enum": [5]
},
"initialValue": {
"type": "boolean"
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions schema/sprotty/actions/action.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/sprotty/actions/action.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "action",
"type": "object",
"properties": {
"kind": {
"type": "string"
}
}
}
6 changes: 3 additions & 3 deletions schema/sprotty/actions/requestBounds.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/sprotty/messages/requestBounds.json",
"$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/sprotty/actions/requestBounds.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "requestBounds",
"type": "object",
"allOf": [{"$ref": "../../sprotty/messages/diagramAccept.json#/definitions/action"}],
"allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/sprotty/actions/action.json"}],
"properties": {
"kind": {
"type": "string",
Expand All @@ -25,7 +25,7 @@
"children": {
"type": "array",
"items": {
"$ref": "../../klighd/SKGraphSchema#/definitions/SKGraph"
"$ref": "/kieler/klighd-vscode/tree/main/schema/klighd/SKGraphSchema#/definitions/SKGraph"
}
}
}
Expand Down
34 changes: 34 additions & 0 deletions schema/sprotty/actions/requestModel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/sprotty/actions/requestModel.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "requestBounds",
"type": "object",
"allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/sprotty/actions/action.json"}],
"properties": {
"kind": {
"type": "string",
"enum": ["requestModel"]
},
"options": {
"type": "object",
"properties": {
"needsClientLayout": {
"type": "boolean"
},
"needsServerLayout": {
"type": "boolean"
},
"sourceUri": {
"type": "string"
},
"diagramType": {
"type": "string",
"enum": ["keith-diagram"]
}
}
},
"requestId": {
"type": "string"
}
}
}
27 changes: 27 additions & 0 deletions schema/sprotty/diagramAccept.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/sprotty/messages/diagramAccept.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "diagram/accept",
"type": "object",
"properties": {
"jsonrpc": {
"type": "string"
},
"method": {
"type": "string",
"enum": ["diagram/accept"]
},
"params": {
"type": "object",
"properties": {
"clientId": {
"type": "string",
"enum": ["sprotty"]
},
"action": {
"$ref": "./actions/action.json#action"
}
}
}
}
}
67 changes: 0 additions & 67 deletions schema/sprotty/messages/diagramAccept.json

This file was deleted.

0 comments on commit df3cd18

Please sign in to comment.