From 73ff6a08e11ec93a03bf3f265b0fb7f844315793 Mon Sep 17 00:00:00 2001 From: haixuanTao Date: Mon, 20 May 2024 19:05:21 +0200 Subject: [PATCH] Add schemars skip on unstable features --- libraries/core/dora-schema.json | 84 +--------------------------- libraries/core/src/descriptor/mod.rs | 5 ++ 2 files changed, 6 insertions(+), 83 deletions(-) diff --git a/libraries/core/dora-schema.json b/libraries/core/dora-schema.json index 32a0426b..476ebf2b 100644 --- a/libraries/core/dora-schema.json +++ b/libraries/core/dora-schema.json @@ -7,27 +7,6 @@ "nodes" ], "properties": { - "_unstable_deploy": { - "default": { - "machine": null - }, - "allOf": [ - { - "$ref": "#/definitions/Deploy" - } - ] - }, - "communication": { - "default": { - "_unstable_local": "Tcp", - "_unstable_remote": "tcp" - }, - "allOf": [ - { - "$ref": "#/definitions/CommunicationConfig" - } - ] - }, "nodes": { "type": "array", "items": { @@ -37,20 +16,6 @@ }, "additionalProperties": true, "definitions": { - "CommunicationConfig": { - "type": "object", - "properties": { - "_unstable_local": { - "default": "Tcp", - "type": "string" - }, - "_unstable_remote": { - "default": "tcp", - "type": "string" - } - }, - "additionalProperties": true - }, "CustomNode": { "type": "object", "required": [ @@ -81,7 +46,7 @@ } }, "inputs": { - "description": "Inputs for the nodes as a map from input ID to input configuration\n\ne.g.\n\ninputs:\n\nexample_input: example_node/example_output1", + "description": "Inputs for the nodes as a map from input ID to `/`.\n\ne.g.\n\ninputs:\n\nexample_input: example_node/example_output1", "default": {}, "type": "object", "additionalProperties": true @@ -111,18 +76,6 @@ "DataId": { "type": "string" }, - "Deploy": { - "type": "object", - "properties": { - "machine": { - "type": [ - "string", - "null" - ] - } - }, - "additionalProperties": true - }, "Duration": { "type": "object", "required": [ @@ -262,17 +215,6 @@ "id" ], "properties": { - "_unstable_deploy": { - "description": "Unstable machine deployment configuration", - "default": { - "machine": null - }, - "allOf": [ - { - "$ref": "#/definitions/Deploy" - } - ] - }, "description": { "description": "Description of the node", "type": [ @@ -334,18 +276,6 @@ }, "additionalProperties": true - }, - { - "type": "object", - "required": [ - "wasm" - ], - "properties": { - "wasm": { - "type": "string" - } - }, - "additionalProperties": true } ], "required": [ @@ -439,18 +369,6 @@ }, "additionalProperties": true - }, - { - "type": "object", - "required": [ - "wasm" - ], - "properties": { - "wasm": { - "type": "string" - } - }, - "additionalProperties": true } ], "properties": { diff --git a/libraries/core/src/descriptor/mod.rs b/libraries/core/src/descriptor/mod.rs index 8d83b153..0f2d0b16 100644 --- a/libraries/core/src/descriptor/mod.rs +++ b/libraries/core/src/descriptor/mod.rs @@ -20,9 +20,12 @@ pub const SHELL_SOURCE: &str = "shell"; /// Dataflow description #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] #[serde(deny_unknown_fields)] +#[schemars(title = "dora-rs specification")] pub struct Descriptor { + #[schemars(skip)] #[serde(default)] pub communication: CommunicationConfig, + #[schemars(skip)] #[serde(default, rename = "_unstable_deploy")] pub deploy: Deploy, pub nodes: Vec, @@ -139,6 +142,7 @@ pub struct Node { pub env: Option>, /// Unstable machine deployment configuration + #[schemars(skip)] #[serde(default, rename = "_unstable_deploy")] pub deploy: Deploy, @@ -266,6 +270,7 @@ pub struct OperatorConfig { pub enum OperatorSource { SharedLibrary(String), Python(PythonSource), + #[schemars(skip)] Wasm(String), } #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]