Skip to content

Commit fb2f733

Browse files
committed
fix(shadow): reported may not exist yet
1 parent 0b221b4 commit fb2f733

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/api/DeviceShadow.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@ export const DeviceShadow = Type.Object({
1010
minLength: 1,
1111
examples: ['2019-08-24T14:15:22Z'],
1212
}),
13-
updatedAt: Type.String({
14-
minLength: 1,
15-
examples: ['2019-08-24T14:15:22Z'],
16-
}),
13+
updatedAt: Type.Optional(
14+
Type.String({
15+
minLength: 1,
16+
examples: ['2019-08-24T14:15:22Z'],
17+
}),
18+
),
1719
}),
1820
state: Type.Object({
19-
reported: Type.Record(Type.String({ minLength: 1 }), Type.Any()),
21+
reported: Type.Optional(
22+
Type.Record(Type.String({ minLength: 1 }), Type.Any()),
23+
),
2024
desired: Type.Optional(
2125
Type.Record(Type.String({ minLength: 1 }), Type.Any()),
2226
),

0 commit comments

Comments
 (0)