Skip to content

Commit dd390a5

Browse files
committed
fix(device): state may not be present at all
BREAKING CHANGE: makes the state object optional
1 parent 3145285 commit dd390a5

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/api/DeviceShadow.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,18 @@ export const DeviceShadow = Type.Object({
1717
}),
1818
),
1919
}),
20-
state: Type.Object({
21-
reported: Type.Optional(
22-
Type.Record(Type.String({ minLength: 1 }), Type.Any()),
23-
),
24-
desired: Type.Optional(
25-
Type.Record(Type.String({ minLength: 1 }), Type.Any()),
26-
),
27-
version: Type.Number(),
28-
metadata: Type.Record(Type.String({ minLength: 1 }), Type.Any()),
29-
}),
20+
state: Type.Optional(
21+
Type.Object({
22+
reported: Type.Optional(
23+
Type.Record(Type.String({ minLength: 1 }), Type.Any()),
24+
),
25+
desired: Type.Optional(
26+
Type.Record(Type.String({ minLength: 1 }), Type.Any()),
27+
),
28+
version: Type.Number(),
29+
metadata: Type.Record(Type.String({ minLength: 1 }), Type.Any()),
30+
}),
31+
),
3032
})
3133

3234
export type DeviceShadowType = Static<typeof DeviceShadow>

0 commit comments

Comments
 (0)