Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
search: add invalid attribute value check
- Loading branch information
Showing
4 changed files
with
104 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
test/command/suite/search/output/attributes/invalid.catalog.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "datasets": { | ||
| "Droonga": { | ||
| "fact": "Memos", | ||
| "schema": { | ||
| "Memos": { | ||
| "type": "Hash", | ||
| "keyType": "ShortText" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
48 changes: 48 additions & 0 deletions
48
test/command/suite/search/output/attributes/invalid.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| [ | ||
| "droonga.message", | ||
| 0, | ||
| { | ||
| "inReplyTo": "request-id", | ||
| "statusCode": 400, | ||
| "type": "search.result", | ||
| "body": { | ||
| "name": "InvalidAttribute", | ||
| "message": "Invalid attribute: <,>", | ||
| "detail": { | ||
| "attribute": "," | ||
| } | ||
| }, | ||
| "errors": { | ||
| "sources0": { | ||
| "statusCode": 400, | ||
| "body": { | ||
| "name": "InvalidAttribute", | ||
| "message": "Invalid attribute: <,>", | ||
| "detail": { | ||
| "attribute": "," | ||
| } | ||
| } | ||
| }, | ||
| "sources1": { | ||
| "statusCode": 400, | ||
| "body": { | ||
| "name": "InvalidAttribute", | ||
| "message": "Invalid attribute: <,>", | ||
| "detail": { | ||
| "attribute": "," | ||
| } | ||
| } | ||
| }, | ||
| "sources2": { | ||
| "statusCode": 400, | ||
| "body": { | ||
| "name": "InvalidAttribute", | ||
| "message": "Invalid attribute: <,>", | ||
| "detail": { | ||
| "attribute": "," | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # -*- js -*- | ||
| #@require-catalog-version 2 | ||
| #@disable-logging | ||
| { | ||
| "type": "add", | ||
| "dataset": "Droonga", | ||
| "body": { | ||
| "table": "Memos", | ||
| "key": "Droonga is fun" | ||
| } | ||
| } | ||
| #@enable-logging | ||
| { | ||
| "type": "search", | ||
| "dataset": "Droonga", | ||
| "body": { | ||
| "queries": { | ||
| "memos": { | ||
| "source": "Memos", | ||
| "output": { | ||
| "elements": ["attributes"], | ||
| "attributes": [","], | ||
| "limit": 10 | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |