Is it possible to change data in an after middleware for a StreamedJsonResponse? #55492
-
For example we want to transform something like this {
"has_more_pages": true,
...
"data": {
{"id": 1, "relation": {"id": 1}},
... more streamed data
}
} into {
"has_more_pages": true,
...
"data": {
{"id": 1, "relationId": 1},
... more streamed data
}
} in an after middleware. Is that possible? |
Beta Was this translation helpful? Give feedback.
Answered by
macropay-solutions
Apr 20, 2025
Replies: 1 comment
-
It seems like it, by using the $old = $response->getCallback() and $response->setCallback($new); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
macropay-solutions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems like it, by using the $old = $response->getCallback() and $response->setCallback($new);