Skip to content

Commit fe0e41f

Browse files
committed
Fix book_feedback validation and CEL has() syntax
- Add book_feedback to InteractionCreate.input_type regex pattern so clients can submit feedback without getting a 422 - Fix CEL has() macro to use field-path syntax: has(obj.field) not has(obj, 'field')
1 parent f609e16 commit fe0e41f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/schemas/cms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ class InteractionCreate(BaseModel):
465465
input: str
466466
input_type: str = Field(
467467
...,
468-
pattern="^(text|button|file|choice|number|email|phone|url|date|slider|image_choice|carousel|multiple_choice|continue)$",
468+
pattern="^(text|button|file|choice|number|email|phone|url|date|slider|image_choice|carousel|multiple_choice|book_feedback|continue)$",
469469
)
470470

471471

scripts/fixtures/huey-recommendation-flow.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"actions": [
8888
{
8989
"type": "aggregate",
90-
"expression": "size(has(temp.book_feedback, 'liked') ? temp.book_feedback.liked : [])",
90+
"expression": "size(has(temp.book_feedback.liked) ? temp.book_feedback.liked : [])",
9191
"target": "temp.liked_count"
9292
}
9393
]

0 commit comments

Comments
 (0)