Reject coerced consequence-preview inputs
Declare child_id as StrictInt and is_present as StrictBool on the consequence request model so a JSON true is not accepted as child id 1 and a numeric or string status is not coerced to a bool (NQ-201-1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+3
-2
@@ -681,12 +681,13 @@ class AdminPresenceOverrideConsequenceRequest(BaseModel):
|
||||
``is_present`` bool are enforced by the SAME
|
||||
:class:`~nestquest_core.presence.PresenceOverride` constructor the
|
||||
create route's core path builds; this model only guards the SHAPE.
|
||||
Strict fields: a JSON ``true`` is not child id 1, nor ``1`` a bool.
|
||||
"""
|
||||
|
||||
child_id: int
|
||||
child_id: StrictInt
|
||||
start_date: str
|
||||
end_date: str
|
||||
is_present: bool
|
||||
is_present: StrictBool
|
||||
|
||||
|
||||
class AdminPresenceOverrideConsequenceResponse(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user