-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[PROPOSAL] Define and use a standard way for returning 404 responses #9988
Comments
@shwetathareja @Bukhtawar Thoughts on this? |
I like standardization, but I wonder what the blast radius is from a change like this. OpenSearch API has a lot of inconsistencies such as this one. I would better about a big backwards incompatible change in a major release if we completed the spec in https://github.com/opensearch-project/opensearch-api-specification, then made a version of it that removes all the inconsistencies, then generated the server code from it to ensure it's always consistent. |
I will attend triage meeting with core team tomorrow to see how to go about this. |
@imvtsl / @peternied / other attendees : Can you please summarize the discussion held on this issue in the core triage meeting? |
We didn't really conclude on it. The feasibility is uncertain due to the large number of APIs and the potential impact of changing the 404 response for all of them. Additionally, we lack documentation on the current error responses for these APIs, which further complicates the assessment. |
I think a big chunk of work as a prerequisite of changing any responses is opensearch-project/opensearch-api-specification#445. It would let us actually assess what APIs behave in ways we like and which ones don't, and scope the change. |
I can update API spec for a few index APIs to begin with. Then we can standardize index APIs. |
@imvtsl I think it's ok, but keep in mind that 3.0 will likely happen sometime this year (based on Lucene release schedule), so we have a limited window to make big changes. |
Agreed. We can try to standardize as many group of APIs as we can in 3.0. We can do remaining groups in 4.0? |
I am starting on this now. Do we create sub-tasks or sub-issues for better progress tracking? |
@imvtsl I wouldn't bother, maybe just keep a list of |
Is your feature request related to a problem? Please describe.
Opensearch has many different user API endpoints. Some of them behave similar and some doesn't.
During the refactoring of the opensearch-go lib, I notices that 404 response bodys are different between API endpoints.
Examples for some get requests.
Describe the solution you'd like
I would like to see a response similar to 404 responses from
index
or_index_templates
.Describe alternatives you've considered
Depending on the endpoint it would also be an option to return a 200 with a body containing no results like the
_nodes
endpoint does. This would for example work for the_index_template
and_component_template
as they return an array of templates.Additional context
This is a bit in relation to opensearch-project/opensearch-plugins#215 as it is about errors but for plugins. AFAIK Opensearch has its standard way for errors but not one for when to return it.
The text was updated successfully, but these errors were encountered: