Browse Source

Add documentation about additional property fix

tags/v0.3.5-fix4
haixuanTao 1 year ago
parent
commit
1b35346f24
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      libraries/core/src/bin/generate_schema.rs

+ 5
- 1
libraries/core/src/bin/generate_schema.rs View File

@@ -7,6 +7,11 @@ fn main() -> () {
let schema = schema_for!(Descriptor);
let raw_schema =
serde_json::to_string_pretty(&schema).expect("Could not serialize schema to json");

// Add additional properties to True, as #[derive(transparent)] of enums are not well handled.
//
// 'OneOf' such as Custom Nodes, Operators and Single Operators overwrite property values of the initial struct `Nodes`.`
// which make the original properties such as `id` and `name` not validated by IDE extensions.
let raw_schema = raw_schema.replace(
"\"additionalProperties\": false",
"\"additionalProperties\": true",
@@ -25,7 +30,6 @@ fn main() -> () {
}",
"true",
);
let raw_schema = raw_schema.replace("Descriptor", "dora-rs specification");

// Get the Cargo root manifest directory
let manifest_dir = env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR is not set");


Loading…
Cancel
Save