Browse Source

Fix YAML formatting in several REST tests

Clinton Gormley 9 years ago
parent
commit
389d365697

+ 1 - 2
rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_settings/11_reset.yaml

@@ -22,8 +22,7 @@ Test reset index settings:
   - do:
       indices.get_settings:
         flat_settings: false
-  - is_false:
-      test-index.settings.index\.refresh_interval
+  - is_false: test-index.settings.index\.refresh_interval
   - do:
       indices.get_settings:
         include_defaults: true

+ 2 - 1
rest-api-spec/src/main/resources/rest-api-spec/test/indices.update_aliases/30_remove_index_and_replace_with_alias.yaml

@@ -31,4 +31,5 @@
   - do:
       indices.get_mapping:
         index: test
-  - is_true: test_2 # the name of the index that the alias points to, would be `test` if the index were still there
+    # the name of the index that the alias points to, would be `test` if the index were still there
+  - is_true: test_2

+ 6 - 9
rest-api-spec/src/main/resources/rest-api-spec/test/scroll/12_slices.yaml

@@ -21,10 +21,9 @@
         scroll: 1m
         sort: foo
         body:
-          slice: {
-            id: 0,
+          slice:
+            id: 0
             max: 3
-          }
           query:
             match_all: {}
 
@@ -41,10 +40,9 @@
           size: 1
           scroll: 1m
           body:
-            slice: {
-              id: 0,
+            slice:
+              id: 0
               max: 1025
-            }
             query:
               match_all: {}
 
@@ -60,10 +58,9 @@
           size: 1
           scroll: 1m
           body:
-            slice: {
-              id: 0,
+            slice:
+              id: 0
               max: 1025
-            }
             query:
               match_all: {}
 

+ 20 - 20
rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/20_terms.yaml

@@ -47,30 +47,30 @@ setup:
         type: test
         id: 3
         body: { "str": "bcd" }
-      
+
   - do:
       indices.refresh: {}
-    
+
   - do:
       search:
         body: { "size" : 0, "aggs" : { "str_terms" : { "terms" : { "field" : "str" } } } }
 
   - match: { hits.total: 3 }
-  
+
   - length: { aggregations.str_terms.buckets: 2 }
-  
+
   - match: { aggregations.str_terms.buckets.0.key: "abc" }
-  
+
   - is_false: aggregations.str_terms.buckets.0.key_as_string
-  
+
   - match: { aggregations.str_terms.buckets.0.doc_count: 2 }
-  
+
   - match: { aggregations.str_terms.buckets.1.key: "bcd" }
-  
+
   - is_false: aggregations.str_terms.buckets.1.key_as_string
-  
+
   - match: { aggregations.str_terms.buckets.1.doc_count: 1 }
-  
+
 ---
 "IP test":
   - do:
@@ -112,9 +112,9 @@ setup:
   - match: { aggregations.ip_terms.buckets.0.doc_count: 2 }
 
   - match: { aggregations.ip_terms.buckets.1.key: "127.0.0.1" }
-  
+
   - is_false: aggregations.ip_terms.buckets.1.key_as_string
-  
+
   - match: { aggregations.ip_terms.buckets.1.doc_count: 1 }
 
   - do:
@@ -142,7 +142,7 @@ setup:
       search:
         body: { "size" : 0, "aggs" : { "ip_terms" : { "terms" : { "field" : "ip", "exclude" :  "127.*"  } } } }
 
-  
+
 
 ---
 "Boolean test":
@@ -327,7 +327,7 @@ setup:
   - match: { aggregations.date_terms.buckets.1.key_as_string: "2014-09-01T00:00:00.000Z" }
 
   - match: { aggregations.date_terms.buckets.1.doc_count: 1 }
-  
+
   - do:
       search:
         body: { "size" : 0, "aggs" : { "date_terms" : { "terms" : { "field" : "date", "include" : [ "2016-05-03" ] } } } }
@@ -335,11 +335,11 @@ setup:
   - match: { hits.total: 3 }
 
   - length: { aggregations.date_terms.buckets: 1 }
-  
+
   - match: { aggregations.date_terms.buckets.0.key_as_string: "2016-05-03T00:00:00.000Z" }
-  
-  - match: { aggregations.date_terms.buckets.0.doc_count: 2 }  
-  
+
+  - match: { aggregations.date_terms.buckets.0.doc_count: 2 }
+
   - do:
       search:
         body: { "size" : 0, "aggs" : { "date_terms" : { "terms" : { "field" : "date", "exclude" : [ "2016-05-03" ] } } } }
@@ -347,7 +347,7 @@ setup:
   - match: { hits.total: 3 }
 
   - length: { aggregations.date_terms.buckets: 1 }
-  
+
   - match: { aggregations.date_terms.buckets.0.key_as_string: "2014-09-01T00:00:00.000Z" }
 
-  - match: { aggregations.date_terms.buckets.0.doc_count: 1 }  
+  - match: { aggregations.date_terms.buckets.0.doc_count: 1 }

+ 7 - 17
rest-api-spec/src/main/resources/rest-api-spec/test/search.inner_hits/10_basic.yaml

@@ -5,19 +5,14 @@ setup:
         index: test
         body:
             mappings:
-              type_1: {
-                properties: {
-                  nested_field : {
+              type_1:
+                properties:
+                  nested_field:
                     type: nested
-                  }
-                }
-              }
               type_2: {}
-              type_3: {
-                _parent: {
+              type_3:
+                _parent:
                   type: type_2
-                }
-              }
 
 ---
 "Nested inner hits":
@@ -26,13 +21,8 @@ setup:
           index: test
           type:  type_1
           id:    1
-          body:  {
-            "nested_field" : [
-              {
-                "foo": "bar"
-              }
-            ]
-          }
+          body:
+            "nested_field" : [ { "foo": "bar" } ]
 
     - do:
         indices.refresh: {}

+ 10 - 5
rest-api-spec/src/main/resources/rest-api-spec/test/suggest/30_context.yaml

@@ -15,28 +15,33 @@ setup:
                   "suggest_context":
                      "type" : "completion"
                      "contexts":
-                        - "name" : "color"
+                        -
+                          "name" : "color"
                           "type" : "category"
                   "suggest_context_with_path":
                      "type" : "completion"
                      "contexts":
-                        - "name" : "color"
+                        -
+                          "name" : "color"
                           "type" : "category"
                           "path" : "color"
                   "suggest_geo":
                      "type" : "completion"
                      "contexts":
-                        - "name" : "location"
+                        -
+                          "name" : "location"
                           "type" : "geo"
                           "precision" : "5km"
                   "suggest_multi_contexts":
                      "type" : "completion"
                      "contexts":
-                        - "name" : "location"
+                        -
+                          "name" : "location"
                           "type" : "geo"
                           "precision" : "5km"
                           "path" : "location"
-                        - "name" : "color"
+                        -
+                          "name" : "color"
                           "type" : "category"
                           "path" : "color"