I am using PathHandler with OpenAPI generator and have created some Handlers to handle paths with paramaters, but not in query. Example:
/**
* @PHA\Route(pattern="/country/{byId}")
*/
class CountryById
{
/**
* Get country by id
* @PHA\Get()
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
* @param ServerRequestInterface $request
* @return \App\DTO\Country
*/
public function getCountry(ServerRequestInterface $request): \App\DTO\Country
{
// How to get byId parameter from path herein ?
}
}
There is very good example from you how to get provided query parameters via an extra class. But how can I get parameter byId
from path?
Would be great to have an example. I am a beginner in Zend Expressive.