Skip to content

Commit

Permalink
Corrected /_cat/indices response schema.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Jun 26, 2024
1 parent e1be5c3 commit 78e9b94
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 4 deletions.
10 changes: 10 additions & 0 deletions spec/namespaces/cat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions spec/schemas/cat.indices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
73 changes: 73 additions & 0 deletions tests/cat/indices.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 78e9b94

Please sign in to comment.