fix(jtk): use correct payload format for automation rule state endpoint#110
fix(jtk): use correct payload format for automation rule state endpoint#110
Conversation
The Automation REST API expects {"value": "ENABLED"} but the code was
sending {"ruleState": "ENABLED"}, causing a 400 Bad Request. Updated
AutomationStateUpdate to use the "value" JSON field name per the
official API spec.
Closes #105
TDD AssessmentSummaryThis PR fixes a payload format bug in All tests pass. What's Covered
What's Not Covered
VerdictPass. The tests directly validate the bug fix by asserting the exact JSON wire format. The switch from struct-based decoding to raw JSON comparison is a meaningful improvement that would have caught the original bug. The gaps noted above (method/path/error assertions) are pre-existing and outside the scope of this fix. |
Summary
AutomationStateUpdateJSON field from"ruleState"to"value"to match the Automation REST API spec{"value": "ENABLED"}but the code was sending{"ruleState": "ENABLED"}, causing a 400 Bad RequestCloses #105
Test plan
{"value": "ENABLED"}(asserts raw JSON body){"value": "DISABLED"}(asserts raw JSON body)