-
Notifications
You must be signed in to change notification settings - Fork 472
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
Dingo api: DataArraySerializer is not applied #45
Comments
OK, I will check it later. |
If anyone has this, the problem is that the Dingo router dispatching is not applied. PHP webserver:
Swoole webserver:
|
If you want to re-register the LumenServiceProvider it will get into an infinite loop.
|
@hhxsv5 Thank you for, looking into this. I ran out of time to fix this issue, but I wrote the meaningful parts above. If I can come up with something I will let you know. |
The main problem is located the same as in #28 the removeMiddlewareFromApp function in the router adapter is not reset after the first request is served, and will get into the infinite loop because the Request middleware is not removed. If I just disable the thing:
The GET/POST requests will work fine. But the OPTIONS requests are failing with no error message just the 500 status code and no log. So basically the same as #28. |
@hhxsv5 Can I return a response from a middleware in laravels? The function is called according to the logs, but after it returns, it throws a 500 error. My cors middleware:
|
php -v
)PHP 7.2.6 (cli) (built: May 26 2018 07:45:18) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans
php --ri swoole
)Laravel
/Lumen
version(check composer.json & composer.lock)Lumen (5.6.3)
If you use Dingo api from the second response the data misses the "data" wrapper set in a provider (DataArraySerializer). Even if I re register with the config, the wrapper does not come back.
reproducible
code block andsteps
The provider where I set thhe response adapter to DataArraySerializer:
I register this in the bootstrap/app.php:
$app->register(App\Providers\DingoServiceProvider::class);
On the first request/response the response is wrapped inside a "data" array. The second response gives exactly the same output, but without the data array wrapping.
First response:
Second response:
I tried setting the "register_providers" array, and add the boot function lines to the register method.
The problem is, that the cleaning between two requests clears something and I cannot set it back.
The text was updated successfully, but these errors were encountered: