Skip to content

Fix Zod validation error for notifications not tied to an object (#2224)#719

Open
correct-horse-battery-bench wants to merge 2 commits into
masterfrom
2224-bug-zod-validation-error-on-notifications-which-are-not-tied-to-an-object
Open

Fix Zod validation error for notifications not tied to an object (#2224)#719
correct-horse-battery-bench wants to merge 2 commits into
masterfrom
2224-bug-zod-validation-error-on-notifications-which-are-not-tied-to-an-object

Conversation

@correct-horse-battery-bench

@correct-horse-battery-bench correct-horse-battery-bench commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Some notifications are not tied to an object, fix typing and relax zod vallidation schemas in this case

Issue: hashtopolis/server#2224

Notifications that are not directly tied to an object (e.g. a global
agentError shown as "N/A" under "applied to") carry a null or absent
objectId. The generated notification-setting schema required a non-null
integer objectId, so the serializer's validateBody() logged a large
ZodError to the console when listing such notifications.

Drop objectId from the required set and widen its type to allow null in
openapi.json; the codegen then produces objectId: z.int().nullish() and
objectId?: number | null. Update JNotification and the datasource cast
accordingly, and add a schema-level regression spec.
@correct-horse-battery-bench correct-horse-battery-bench marked this pull request as ready for review June 17, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Zod validation error on notifications which are not tied to an object

1 participant