Skip to content

Commit

Permalink
Added tests for /_validate/query.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Dec 16, 2024
1 parent b2c8c46 commit b1f4696
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
17 changes: 17 additions & 0 deletions tests/default/_core/validate/query.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$schema: ../../../../json_schemas/test_story.schema.yaml

description: Test validating queries.
chapters:
- synopsis: Validate a query.
path: /_validate/query
method:
- GET
- POST
request:
payload:
query:
match_all: {}
response:
status: 200
payload:
valid: true
23 changes: 5 additions & 18 deletions tests/default/indices/validate/query.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$schema: ../../../../json_schemas/test_story.schema.yaml

description: Test validating queries for a specific index using both GET and POST methods.
description: Test validating queries for a specific index.
epilogues:
- path: /movies
method: DELETE
Expand All @@ -18,9 +18,11 @@ prologues:
- {create: {_index: movies, _id: movie2}}
- {director: Nicolas Winding Refn, title: Drive, year: 1960}
chapters:
- synopsis: Validate a match query (GET).
- synopsis: Validate a match query.
path: /{index}/_validate/query
method: GET
method:
- GET
- POST
parameters:
index: movies
request:
Expand All @@ -32,18 +34,3 @@ chapters:
status: 200
payload:
valid: true

- synopsis: Validate a match query (POST).
path: /{index}/_validate/query
method: POST
parameters:
index: movies
request:
payload:
query:
match:
title: Drive
response:
status: 200
payload:
valid: true

0 comments on commit b1f4696

Please sign in to comment.