Skip to content

Conversation

@sethmlarson
Copy link
Contributor

No description provided.

@stevejgordon
Copy link
Contributor

I've actually removed error property from at least one response (#495) due to conflicts. Discussed with @swallez that clients need to define the appropriate behaviour for errors. In the .NET client, we have a bespoke RequestBase that has properties such as error that could appear on responses from any failed (4xx) requests.

I have run into one API so far (indices.validate_query.Response) where an error field is expected as part of the successful payload in a different format to the actual failed request case. It's a string in the expected payload. Not yet sure how that one should be handled.

@swallez
Copy link
Contributor

swallez commented Aug 23, 2021

What @stevejgordon said. Response bodies should describe the nominal response. Clients should expect an ErrorCause if the status code is different from 200 (or other nominal status code). If we ever have other error types, then we'll add them as a (yet to be defined) errorBody property to the response definition.

That being said, looking at the code the response body seems pretty different from what we have in the spec and should be:

export class Response { body: { task?: TaskId // if wait_for_completion is false acknowledged?: boolean // if wait_for_completion is true or unspecified }
Copy link
Member

@delvedor delvedor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we update this pr with the format introduced in #1468? (if still applicable)

@sethmlarson
Copy link
Contributor Author

Going to close this as it's not in the right format and will require some reworking.

@sethmlarson sethmlarson closed this Jun 2, 2022
@pquentin pquentin deleted the ml-close-job branch October 29, 2025 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment