aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Hellyer <[email protected]>2017-01-20 15:57:21 -0800
committerAustin Hellyer <[email protected]>2017-01-20 15:57:21 -0800
commit38db32e2cbb9dc8504e0dfbc2366b17596836da0 (patch)
tree5a3b46b45fc2fe3ee6f375062dd2a339424cab44
parentMake a single POST on guild role create (diff)
downloadserenity-38db32e2cbb9dc8504e0dfbc2366b17596836da0.tar.xz
serenity-38db32e2cbb9dc8504e0dfbc2366b17596836da0.zip
Fix application decoding w/ rpc_origins
rpc_origins is no longer sent, so fallback to an empty Vec if it's not present.
-rw-r--r--build.rs5
-rw-r--r--definitions/structs/current_application_info.yml1
2 files changed, 6 insertions, 0 deletions
diff --git a/build.rs b/build.rs
index 434c7e0..bd03b66 100644
--- a/build.rs
+++ b/build.rs
@@ -390,6 +390,11 @@ impl {0} {{
format!(r#"try!(remove(&mut map, "{}").and_then(into_string))"#,
field_name)
},
+ ("string", false, true, Some(def), None, None, None) => {
+ format!(r#"try!(opt(&mut map, "{}", |v| decode_array(v, into_string))).unwrap_or({})"#,
+ field_name,
+ def)
+ },
("string", false, true, None, None, None, None) => {
format!(r#"try!(remove(&mut map, "{}").and_then(|v| decode_array(v, into_string)))"#,
field_name)
diff --git a/definitions/structs/current_application_info.yml b/definitions/structs/current_application_info.yml
index 923518b..cbf338d 100644
--- a/definitions/structs/current_application_info.yml
+++ b/definitions/structs/current_application_info.yml
@@ -15,4 +15,5 @@ fields:
type: User
- name: rpc_origins
array: true
+ default: Vec::default()
type: string