-
Notifications
You must be signed in to change notification settings - Fork 24.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
Expose params to toXContentChunked as well as per-chunk #91771
Expose params to toXContentChunked as well as per-chunk #91771
Conversation
Some responses change shape depending on the supplied `params`, and/or parse certain details out of `params`. By passing the `params` to `toXContentChunked` we can adjust the shape of the returned iterator and/or avoid duplicate parsing effort in ways that are not possible today where `params` is only made available to each leaf `ToXContent` object.
Pinging @elastic/es-core-infra (Team:Core/Infra) |
TBH I think we could also pass in the |
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.
LGTM
I would keep it simple. What you have already in this PR seems fine. |
Yea that's how I had it in the initial version of this and would still like to have it. Henning made me change it to what we have now ... |
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.
I'm fine with this but I'd like the version where we just capture the params once even better if possible. We shouldn't have done it like we had in the first place lets go all the way to the correct solution IMO
Thanks both. I missed the conversation about preferring to stick with the |
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.
LGTM.
The primary problem I were trying to address was that each I am happy with the shape of this PR as is. |
Some responses change shape depending on the supplied
params
, and/or parse certain details out ofparams
. By passing theparams
totoXContentChunked
we can adjust the shape of the returned iterator and/or avoid duplicate parsing effort in ways that are not possible today whereparams
is only made available to each leafToXContent
object.