Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apps/sim/app/api/knowledge/[id]/tag-definitions/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ export const POST = withRouteHandler(
if (!parsed.success) return parsed.response

const validatedData = parsed.data.body
/**
* Defense-in-depth runtime check: the contract types `fieldType` as a plain
* string because tightening to the field-type enum cascades into UI form
* state types. Cast here to allow `includes` to accept the wider input.
*/
if (!(SUPPORTED_FIELD_TYPES as readonly string[]).includes(validatedData.fieldType)) {
return NextResponse.json(
{ error: 'Invalid request data', details: 'Invalid field type' },
Expand Down
Loading