Browse Source

rest-api-spec: require watcher.put_watch body (#134425) (#134626)

* rest-api-spec: require watcher.put_watch body

* Remove empty body tests

* Fix format default value

* Revert "Fix format default value"

This reverts commit 2dfcf33209e0288c60e1f335bc74a2ef7a9ee4df.

(cherry picked from commit cb8dd16572d4a09878b510a6954181087f84fde0)
Quentin Pradet 1 month ago
parent
commit
61e4c9e1b2

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

@@ -51,7 +51,7 @@
     },
     "body": {
       "description": "The watch",
-      "required": false
+      "required": true
     }
   }
 }

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

@@ -37,26 +37,3 @@ setup:
             }
           }
   - match: { _id: "my_watch" }
-
----
-"Test empty body is rejected by put watch":
-  - do:
-      watcher.put_watch:
-        id: "my_watch"
-      catch: bad_request
-  - match: { error.root_cause.0.type: "action_request_validation_exception" }
-  - match: { error.root_cause.0.reason: "Validation Failed: 1: request body is missing;" }
-
----
-"Test empty body (with Content-Type) is rejected by put watch":
-  - skip:
-       features:
-         - headers
-  - do:
-      headers:
-        Content-Type: "application/json"
-      watcher.put_watch:
-        id: "my_watch"
-      catch: bad_request
-  - match: { error.root_cause.0.type: "action_request_validation_exception" }
-  - match: { error.root_cause.0.reason: "Validation Failed: 1: request body is missing;" }