mirror of
https://github.com/BetterCorp/BetterFrame.git
synced 2026-05-26 21:26:33 +00:00
fix: wrap nullable event fields with optional() for missing keys
anyvali nullable() accepts null but rejects undefined (absent field). Kiosk log events omit camera_id/property_op entirely. Wrap with optional() so missing fields default to null. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
9eeddff680
commit
db0f6fdd53
1 changed files with 2 additions and 2 deletions
|
|
@ -77,8 +77,8 @@ export const EventBody = av.object(
|
|||
{
|
||||
topic: av.string().minLength(1).maxLength(512),
|
||||
source_type: av.string().maxLength(32).default("system"),
|
||||
camera_id: av.nullable(av.string().maxLength(64)).default(null),
|
||||
property_op: av.nullable(av.string().maxLength(32)).default(null),
|
||||
camera_id: av.optional(av.nullable(av.string().maxLength(64))).default(null),
|
||||
property_op: av.optional(av.nullable(av.string().maxLength(32))).default(null),
|
||||
payload: av.any().default({}),
|
||||
},
|
||||
{ unknownKeys: "strip" },
|
||||
|
|
|
|||
Loading…
Reference in a new issue