fix(api types): Add an unused field to empty API types.

Null structs (struct Foo;) cause the following error when trying to
deserialize an empty JSON object `{}` into them:

`JsonDecodeError("{}\n", Syntax(InvalidType(Map), 1, 1))` (also known as
`invalid type: map at line 1 column 1: {}`). The optional struct member
prevents this error.
This commit is contained in:
Lewin Bormann
2016-09-21 21:37:39 +02:00
parent 4a92a47bed
commit 0f14aa966e
20 changed files with 42 additions and 41 deletions

View File

@@ -170,7 +170,7 @@ impl<'a, C, A> CloudResourceManager<C, A>
/// * [undelete projects](struct.ProjectUndeleteCall.html) (request)
///
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct UndeleteProjectRequest;
pub struct UndeleteProjectRequest { _never_set: Option<bool> }
impl RequestValue for UndeleteProjectRequest {}
@@ -220,7 +220,7 @@ impl ResponseResult for TestIamPermissionsResponse {}
/// * [get iam policy projects](struct.ProjectGetIamPolicyCall.html) (request)
///
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct GetIamPolicyRequest;
pub struct GetIamPolicyRequest { _never_set: Option<bool> }
impl RequestValue for GetIamPolicyRequest {}
@@ -417,7 +417,7 @@ impl ResponseResult for ListProjectsResponse {}
/// * [undelete projects](struct.ProjectUndeleteCall.html) (response)
///
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Empty;
pub struct Empty { _never_set: Option<bool> }
impl ResponseResult for Empty {}