diff --git a/spec/namespaces/cat.yaml b/spec/namespaces/cat.yaml index e62e86ea5..176c0d38c 100644 --- a/spec/namespaces/cat.yaml +++ b/spec/namespaces/cat.yaml @@ -869,6 +869,11 @@ components: type: array items: $ref: '../schemas/cat.indices.yaml#/components/schemas/IndicesRecord' + application/yaml: + schema: + type: array + items: + $ref: '../schemas/cat.indices.yaml#/components/schemas/IndicesRecord' cat.master@200: description: '' content: @@ -879,6 +884,11 @@ components: type: array items: $ref: '../schemas/cat.master.yaml#/components/schemas/MasterRecord' + application/yaml: + schema: + type: array + items: + $ref: '../schemas/cat.health.yaml#/components/schemas/MasterRecord' cat.nodeattrs@200: description: '' content: diff --git a/spec/schemas/cat.indices.yaml b/spec/schemas/cat.indices.yaml index c03496f7b..974f4cbfc 100644 --- a/spec/schemas/cat.indices.yaml +++ b/spec/schemas/cat.indices.yaml @@ -29,13 +29,13 @@ components: type: string docs.count: description: available docs - oneOf: + anyOf: - type: string - nullable: true type: string docs.deleted: description: deleted docs - oneOf: + anyOf: - type: string - nullable: true type: string @@ -47,13 +47,13 @@ components: type: string store.size: description: store size of primaries & replicas - oneOf: + anyOf: - type: string - nullable: true type: string pri.store.size: description: store size of primaries - oneOf: + anyOf: - type: string - nullable: true type: string diff --git a/tests/cat/indices.yaml b/tests/cat/indices.yaml new file mode 100644 index 000000000..f1a14b422 --- /dev/null +++ b/tests/cat/indices.yaml @@ -0,0 +1,73 @@ +$schema: ../../json_schemas/test_story.schema.yaml + +description: Test cat/indices endpoints. +prologues: + - synopsis: Create an index named `books` with mappings and settings. + path: /{index} + method: PUT + parameters: + index: books + request_body: + payload: {} +epilogues: + - path: /books + method: DELETE + status: [200, 404] +chapters: + - synopsis: Cat with a default text response. + method: GET + path: /_cat/indices + response: + status: 200 + content_type: text/plain + - synopsis: Cat with verbose output (v=true). + method: GET + path: /_cat/indices + parameters: + v: true + response: + status: 200 + content_type: text/plain + - synopsis: Cat with headers (h=header1,header2). + method: GET + path: /_cat/indices + parameters: + h: + - health + - status + response: + status: 200 + content_type: text/plain + - synopsis: Cat displaying all available headers (help=true). + method: GET + path: /_cat/indices + parameters: + help: true + response: + status: 200 + content_type: text/plain + - synopsis: Cat with sorted results. + method: GET + path: /_cat/indices + parameters: + s: + - status + response: + status: 200 + content_type: text/plain + - synopsis: Cat in different formats (format=json). + method: GET + path: /_cat/indices + parameters: + format: json + response: + status: 200 + content_type: application/json + - synopsis: Cat in different formats (format=yaml). + method: GET + path: /_cat/indices + parameters: + format: yaml + response: + status: 200 + content_type: application/yaml