Expose params to toXContentChunked as well as per-chunk#91771
Expose params to toXContentChunked as well as per-chunk#91771DaveCTurner merged 1 commit intoelastic:mainfrom
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 |
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 ... |
original-brownbear
left a comment
There was a problem hiding this comment.
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 |
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 theparamstotoXContentChunkedwe can adjust the shape of the returned iterator and/or avoid duplicate parsing effort in ways that are not possible today whereparamsis only made available to each leafToXContentobject.