Skip to content
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

RequestHandler should be able to pass additional details in the response body #100648

Closed
mshustov opened this issue May 26, 2021 · 2 comments
Closed
Labels
Feature:http Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc technical debt Improvement of the software architecture and operational architecture triage_needed

Comments

@mshustov
Copy link
Contributor

As I plugin author, I should be able to pass any data in the response body

return res.custom({ body, statusCode, bypassErrorFormat: true });

The only way to pass error details in the response body is via the attributes property. It works in a hapi-compatible manner and stores a passed object under attributes property in the response body. For cases when a plugin needs to pass additional data in the response body, we have to use a workaround.

@mshustov mshustov added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc triage_needed labels May 26, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@joshdover joshdover added the technical debt Improvement of the software architecture and operational architecture label May 27, 2021
@pgayvallet
Copy link
Contributor

In retrospect, the bypassErrorFormat workaround that was implemented was probably good enough, I don't think we'll need to make it a more fully fledged API, so I'll go ahead and close this.

@pgayvallet pgayvallet closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:http Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc technical debt Improvement of the software architecture and operational architecture triage_needed
Projects
None yet
Development

No branches or pull requests

4 participants