Skip to content

Commit

Permalink
Fix a bug in dash gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
HoKim98 committed May 17, 2023
1 parent 70e4689 commit d322fe3
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions dash/provider/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ impl InputTemplate {
},
ModelFieldKindNativeSpec::Object {
children: _,
dynamic: _,
dynamic,
} => match value {
Value::String(ref_name) => {
let input = InputFieldValue {
Expand All @@ -359,12 +359,17 @@ impl InputTemplate {
self.update_field_value_impl(storage, input, optional).await
}
Value::Object(children) => {
for (child, value) in children.into_iter() {
let child = InputField::sub_object(&name, &child, value);
self.update_field_value_impl(storage, child, optional)
.await?;
if *dynamic {
*field = Value::Object(children);
Ok(())
} else {
for (child, value) in children.into_iter() {
let child = InputField::sub_object(&name, &child, value);
self.update_field_value_impl(storage, child, optional)
.await?;
}
Ok(())
}
Ok(())
}
value => assert_optional(&name, &value, &base_field.parsed, optional),
},
Expand Down Expand Up @@ -788,14 +793,19 @@ impl<'a> ItemTemplate<'a> {
},
ModelFieldKindNativeSpec::Object {
children: _,
dynamic: _,
dynamic,
} => match value {
Value::Object(children) => {
for (child, value) in children.into_iter() {
let child = InputField::sub_object(&name, &child, value);
self.update_field_value_impl(child, optional)?;
if *dynamic {
*field = Value::Object(children);
Ok(())
} else {
for (child, value) in children.into_iter() {
let child = InputField::sub_object(&name, &child, value);
self.update_field_value_impl(child, optional)?;
}
Ok(())
}
Ok(())
}
value => assert_optional(&name, &value, base_field, optional),
},
Expand Down

0 comments on commit d322fe3

Please sign in to comment.