-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 404 spec for delete index, get document, delete document APIs #589
base: main
Are you sure you want to change the base?
Conversation
Hi @dblock Doc tests are failing for GET and DELETE /{index}/_doc/{id} in case of 404:
It gives error |
This error means that for a deleted document there's no data returned, however we can see that it's not true.
Looking at the code we do something funky with the errors here: https://github.com/opensearch-project/opensearch-api-specification/blob/main/tools/src/tester/ChapterReader.ts#L65. If the response contains a JSON error we return it, otherwise we return nothing, so this explains why the response is nothing. This looks like a non-standard 404 response. Here's a quick fix.
It needs a test, feel free to add one or if it's too much work open an issue and I'll take care of it. |
@dblock Thanks for quick response. Doc tests are now working with the suggested change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Test works well. Rebase and we'll merge?
Signed-off-by: Vatsal <[email protected]>
Signed-off-by: Vatsal <[email protected]>
Signed-off-by: Vatsal <[email protected]>
Signed-off-by: Vatsal <[email protected]>
Rebase done. |
Changes AnalysisCommit SHA: c1039de API ChangesSummary
ReportThe full API changes report is available at: https://github.com/opensearch-project/opensearch-api-specification/actions/runs/11169183929/artifacts/2015667199 API Coverage
|
Spec Test Coverage Analysis
|
Looks like some more lint/validate failures, thanks! |
Signed-off-by: Vatsal <[email protected]>
The validation is correct. The contents of the |
Signed-off-by: Vatsal <[email protected]>
I created new keys, get@404 and delete@404. However, I used anchors to reuse value from get@200 key. This way, we have two keys and we avoid duplication of values. Let me know if we don't want to use anchors but want to duplicate values. |
@@ -2837,11 +2841,12 @@ components: | |||
creation_time: | |||
type: integer | |||
format: int64 | |||
delete@200: | |||
delete@200: &WriteResponseBase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an interesting syntax! Where can I read about &
and *
?
The rest of the docs do not use anchors, maybe let's keep that to be consistent, and open an issue to edit everything not to? |
Signed-off-by: Vatsal [email protected]
Description
Added 404 spec for below APIs
Issues Resolved
Contributes to #445
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.