Using array of middlewares for a route gives error

This will most likely resolve both of your issues. If @froschdesign has resolved them both. Please mark them both as resolved as to help others searching similar problems :slight_smile:

Edit to add:

When fetching a identifier from the container. The psr requires a string identifier. Its best, as @froschdesign example shows, to use the ::class syntax for the target service. I would also suggest that when possible alias it to the interface. This allows swapping of underlying implementers without further changes.