Skip to content

Commit 783bda6

Browse files
authored
rest-api-spec: require watcher.put_watch body (#134425) (#134627)
* rest-api-spec: require watcher.put_watch body * Remove empty body tests * Fix format default value * Revert "Fix format default value" This reverts commit 2dfcf33. (cherry picked from commit cb8dd16)
1 parent fe10c2e commit 783bda6

File tree

2 files changed

+1
-24
lines changed
  • rest-api-spec/src/main/resources/rest-api-spec/api
  • x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch

2 files changed

+1
-24
lines changed

rest-api-spec/src/main/resources/rest-api-spec/api/watcher.put_watch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
},
5252
"body": {
5353
"description": "The watch",
54-
"required": false
54+
"required": true
5555
}
5656
}
5757
}

x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/10_basic.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,3 @@ setup:
3737
}
3838
}
3939
- match: { _id: "my_watch" }
40-
41-
---
42-
"Test empty body is rejected by put watch":
43-
- do:
44-
watcher.put_watch:
45-
id: "my_watch"
46-
catch: bad_request
47-
- match: { error.root_cause.0.type: "action_request_validation_exception" }
48-
- match: { error.root_cause.0.reason: "Validation Failed: 1: request body is missing;" }
49-
50-
---
51-
"Test empty body (with Content-Type) is rejected by put watch":
52-
- skip:
53-
features:
54-
- headers
55-
- do:
56-
headers:
57-
Content-Type: "application/json"
58-
watcher.put_watch:
59-
id: "my_watch"
60-
catch: bad_request
61-
- match: { error.root_cause.0.type: "action_request_validation_exception" }
62-
- match: { error.root_cause.0.reason: "Validation Failed: 1: request body is missing;" }

0 commit comments

Comments
 (0)