Plugin schema and WsMessage json
This commit is contained in:
@@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"id",
|
||||||
|
"version",
|
||||||
|
"supported_versions",
|
||||||
|
"file",
|
||||||
|
"args"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique plugin identifier (recommended to be lowercase and use author/plugin format)",
|
||||||
|
"minLength": 1
|
||||||
|
},
|
||||||
|
"version": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Plugin version",
|
||||||
|
"pattern": "^\\d+\\.\\d+\\.\\d+$"
|
||||||
|
},
|
||||||
|
"supported_versions": {
|
||||||
|
"type": "array",
|
||||||
|
"description": "List of supported host versions",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"file": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Executable or runtime used to launch the plugin"
|
||||||
|
},
|
||||||
|
"args": {
|
||||||
|
"type": "array",
|
||||||
|
"description": "Arguments passed to the executable",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
@@ -129,6 +129,7 @@ pub mod message {
|
|||||||
|
|
||||||
/// WebSocket wrapper
|
/// WebSocket wrapper
|
||||||
#[derive(Debug, Clone, Serialize)]
|
#[derive(Debug, Clone, Serialize)]
|
||||||
|
#[serde(tag = "type", content = "params", rename_all = "snake_case")]
|
||||||
pub enum WsMessage<T: Serialize + for<'de> Deserialize<'de>> {
|
pub enum WsMessage<T: Serialize + for<'de> Deserialize<'de>> {
|
||||||
Message(T),
|
Message(T),
|
||||||
Binary(Vec<u8>),
|
Binary(Vec<u8>),
|
||||||
|
|||||||
Reference in New Issue
Block a user