-
Notifications
You must be signed in to change notification settings - Fork 59
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
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 <vatsal.v.anand@gmail.com>
Signed-off-by: Vatsal <vatsal.v.anand@gmail.com>
Signed-off-by: Vatsal <vatsal.v.anand@gmail.com>
Signed-off-by: Vatsal <vatsal.v.anand@gmail.com>
Rebase done. |
Changes AnalysisCommit SHA: c7bae5d API ChangesSummary
ReportThe full API changes report is available at: https://github.com/opensearch-project/opensearch-api-specification/actions/runs/11189230449/artifacts/2019049822 API Coverage
|
Spec Test Coverage Analysis
|
Looks like some more lint/validate failures, thanks! |
Signed-off-by: Vatsal <vatsal.v.anand@gmail.com>
The validation is correct. The contents of the |
Signed-off-by: Vatsal <vatsal.v.anand@gmail.com>
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. |
spec/namespaces/_core.yaml
Outdated
@@ -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 *
?
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.
Thanks.
I referred these resources before implementing:
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 <vatsal.v.anand@gmail.com>
I removed anchors to maintain consistency.
I don't really follow this part. Could you help elaborate? Thanks. |
I mean if you think it's better/cleaner/faster/prettier to use anchors then you can suggest we change to use them everywhere in a new issue. We value your opinion and we can discuss the pros/cons on GitHub. Thanks for your help with this! |
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.
Spotted a grammar thing, sorry to be annoying! I promise that's it after that one :)
Signed-off-by: Vatsal <vatsal.v.anand@gmail.com>
I will analyze yaml files in this repo and check if we should use anchors and create issue.
No worries! |
Signed-off-by: Vatsal vatsal.v.anand@gmail.com
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.