Make JSON models less strict

This commit is contained in:
Lucien Greathouse
2018-05-26 16:59:09 -07:00
parent e7fe4ac3ec
commit 804bbc93b7
3 changed files with 7 additions and 6 deletions

View File

@@ -2,6 +2,7 @@
## Current master
* Fixed warning when renaming or removing files that would sometimes corrupt the instance cache (#72)
* JSON models are no longer as strict -- `Children` and `Properties` are now optional.
## 0.4.8 (May 26, 2018)
* Hotfix to prevent errors from being thrown when objects managed by Rojo are deleted

View File

@@ -6,7 +6,11 @@ use std::collections::HashMap;
pub struct RbxInstance {
pub name: String,
pub class_name: String,
#[serde(default = "Vec::new")]
pub children: Vec<RbxInstance>,
#[serde(default = "HashMap::new")]
pub properties: HashMap<String, RbxValue>,
/// The route that this instance was generated from, if there was one.

View File

@@ -4,14 +4,11 @@
"Children": [
{
"Name": "Some Part",
"ClassName": "Part",
"Children": [],
"Properties": {}
"ClassName": "Part"
},
{
"Name": "Some StringValue",
"ClassName": "StringValue",
"Children": [],
"Properties": {
"Value": {
"Type": "String",
@@ -19,6 +16,5 @@
}
}
}
],
"Properties": {}
]
}