dingo / api

A RESTful API package for the Laravel and Lumen frameworks.
BSD 3-Clause "New" or "Revised" License
9.33k stars 1.25k forks source link

Nested internal call - merged parameters #1578

Open pawlox opened 6 years ago

pawlox commented 6 years ago
Q A
Bug? yes
New Feature? no
Framework Laravel
Framework version 5.2.45
Package version v1.0.0-beta8
PHP version 7.1.18

Actual Behaviour

In place A I'm making internal request with some data to place B. In place B there is another internal request with different data to place C. As Dingo\Api\Dispatcher is a singleton, the parameters from first request remains in instance, they are merged with data from place B and send along to place C, but in place C I only need data from B. I can't see any way to reset internal dispatcher parameters.

Expected Behaviour

Place C get only parameters from place B.

Steps to Reproduce

  1. Make internal call with some data to endpoint which has another internal call (nested internal call).
  2. Final controller method is getting merged data from both requests.

Possible Solutions

Allow manually reseting parameters?