Skip to content

Commit 30dc54d

Browse files
committed
add #[serde(flatten)] to some views that were missing it
1 parent 939adec commit 30dc54d

File tree

3 files changed

+187
-78
lines changed

3 files changed

+187
-78
lines changed

common/src/api/external/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,6 +1161,7 @@ pub enum VpcRouterKind {
11611161
#[derive(ObjectIdentity, Clone, Debug, Deserialize, Serialize, JsonSchema)]
11621162
pub struct VpcRouter {
11631163
/// common identifying metadata
1164+
#[serde(flatten)]
11641165
pub identity: IdentityMetadata,
11651166

11661167
pub kind: VpcRouterKind,
@@ -1364,6 +1365,7 @@ pub enum RouterRouteKind {
13641365
#[derive(ObjectIdentity, Clone, Debug, Deserialize, Serialize, JsonSchema)]
13651366
pub struct RouterRoute {
13661367
/// common identifying metadata
1368+
#[serde(flatten)]
13671369
pub identity: IdentityMetadata,
13681370

13691371
/// The VPC Router to which the route belongs.
@@ -1400,6 +1402,7 @@ pub struct RouterRouteUpdateParams {
14001402
#[derive(ObjectIdentity, Clone, Debug, Deserialize, Serialize, JsonSchema)]
14011403
pub struct VpcFirewallRule {
14021404
/// common identifying metadata
1405+
#[serde(flatten)]
14031406
pub identity: IdentityMetadata,
14041407
/// whether this rule is in effect
14051408
pub status: VpcFirewallRuleStatus,
@@ -1890,6 +1893,7 @@ impl JsonSchema for MacAddr {
18901893
#[derive(ObjectIdentity, Clone, Debug, Deserialize, JsonSchema, Serialize)]
18911894
pub struct NetworkInterface {
18921895
/** common identifying metadata */
1896+
#[serde(flatten)]
18931897
pub identity: IdentityMetadata,
18941898

18951899
/** The Instance to which the interface belongs. */

nexus/src/external_api/views.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ impl Into<Vpc> for model::Vpc {
106106
#[derive(ObjectIdentity, Clone, Debug, Deserialize, Serialize, JsonSchema)]
107107
pub struct VpcSubnet {
108108
/** common identifying metadata */
109+
#[serde(flatten)]
109110
pub identity: IdentityMetadata,
110111

111112
/** The VPC to which the subnet belongs. */
@@ -146,6 +147,7 @@ impl Into<VpcSubnet> for model::VpcSubnet {
146147
#[derive(ObjectIdentity, Clone, Debug, Deserialize, Serialize, JsonSchema)]
147148
#[serde(rename_all = "camelCase")]
148149
pub struct Rack {
150+
#[serde(flatten)]
149151
pub identity: IdentityMetadata,
150152
}
151153

0 commit comments

Comments
 (0)