mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-21 21:25:16 +00:00
Support $schema in JSON structures (#974)
This commit is contained in:
@@ -51,6 +51,9 @@ enum Error {
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(deny_unknown_fields, rename_all = "camelCase")]
|
||||
pub struct Project {
|
||||
#[serde(rename = "$schema", skip_serializing_if = "Option::is_none")]
|
||||
schema: Option<String>,
|
||||
|
||||
/// The name of the top-level instance described by the project.
|
||||
pub name: Option<String>,
|
||||
|
||||
|
||||
@@ -61,6 +61,9 @@ pub fn snapshot_json_model(
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
struct JsonModel {
|
||||
#[serde(rename = "$schema", skip_serializing_if = "Option::is_none")]
|
||||
schema: Option<String>,
|
||||
|
||||
#[serde(alias = "Name")]
|
||||
name: Option<String>,
|
||||
|
||||
|
||||
@@ -13,6 +13,9 @@ use crate::{resolution::UnresolvedValue, snapshot::InstanceSnapshot, RojoRef};
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct AdjacentMetadata {
|
||||
#[serde(rename = "$schema", skip_serializing_if = "Option::is_none")]
|
||||
schema: Option<String>,
|
||||
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub id: Option<String>,
|
||||
|
||||
@@ -104,6 +107,9 @@ impl AdjacentMetadata {
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct DirectoryMetadata {
|
||||
#[serde(rename = "$schema", skip_serializing_if = "Option::is_none")]
|
||||
schema: Option<String>,
|
||||
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub id: Option<String>,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user