From 186c226a53acbabf094819575d7d4b4aba8b57d2 Mon Sep 17 00:00:00 2001 From: David Whittaker Date: Thu, 15 May 2025 17:36:56 -0700 Subject: [PATCH] fix(slack): allow subject.id to be a number --- src/dispatch/plugins/dispatch_slack/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dispatch/plugins/dispatch_slack/models.py b/src/dispatch/plugins/dispatch_slack/models.py index 028be85546b9..d3391ed3aba1 100644 --- a/src/dispatch/plugins/dispatch_slack/models.py +++ b/src/dispatch/plugins/dispatch_slack/models.py @@ -1,7 +1,7 @@ """Models for Slack command payloads in the Dispatch application.""" from typing import TypedDict, NewType -from pydantic import BaseModel, AnyHttpUrl +from pydantic import BaseModel, AnyHttpUrl, ConfigDict import logging from dispatch.enums import DispatchEnum @@ -37,6 +37,10 @@ class SubjectMetadata(BaseModel): channel_id: str | None = None thread_id: str | None = None + model_config = ConfigDict( + coerce_numbers_to_str=True + ) # allow coercion of id from number to string + class AddUserMetadata(SubjectMetadata): """Model for metadata when adding users."""