@@ -7,7 +7,6 @@ use schemars::{JsonSchema, json_schema};
77use serde:: { Deserialize , Serialize } ;
88use serde_json:: { Map , Value } ;
99use std:: { collections:: HashMap , fmt:: Display } ;
10- use std:: fmt:: Display ;
1110
1211use crate :: { dscerror:: DscError , schemas:: DscRepoSchema } ;
1312
@@ -131,7 +130,7 @@ pub struct UserFunctionOutput {
131130}
132131
133132#[ derive( Debug , Clone , PartialEq , Deserialize , Serialize , JsonSchema ) ]
134- #[ serde( untagged ) ]
133+ #[ serde( rename_all = "camelCase" ) ]
135134pub enum ValueOrCopy {
136135 Value ( String ) ,
137136 Copy ( Copy ) ,
@@ -142,6 +141,7 @@ pub enum ValueOrCopy {
142141pub struct Output {
143142 pub condition : Option < String > ,
144143 pub r#type : DataType ,
144+ #[ serde( flatten) ]
145145 pub value_or_copy : ValueOrCopy ,
146146}
147147
@@ -156,14 +156,14 @@ pub struct Configuration {
156156 #[ serde( skip_serializing_if = "Option::is_none" ) ]
157157 pub functions : Option < Vec < UserFunction > > ,
158158 #[ serde( skip_serializing_if = "Option::is_none" ) ]
159- pub parameters : Option < HashMap < String , Parameter > > ,
160- #[ serde( skip_serializing_if = "Option::is_none" ) ]
161- pub variables : Option < Map < String , Value > > ,
162- pub resources : Vec < Resource > ,
163- #[ serde( skip_serializing_if = "Option::is_none" ) ]
164159 pub metadata : Option < Metadata > ,
165160 #[ serde( skip_serializing_if = "Option::is_none" ) ]
166161 pub outputs : Option < HashMap < String , Output > > ,
162+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
163+ pub parameters : Option < HashMap < String , Parameter > > ,
164+ pub resources : Vec < Resource > ,
165+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
166+ pub variables : Option < Map < String , Value > > ,
167167}
168168
169169#[ derive( Debug , Clone , PartialEq , Deserialize , Serialize , JsonSchema ) ]
0 commit comments