I'm currently generating OpenAPI annotations via Symfony (5.1) Routes and NelmioApiDocBundle,
One of the routes looks like this:
* @Route("/users/{id}", methods={"GET"}, requirements={"id": "\d+"})
* @OA\Parameter(name="id", in="path", description="The id of the user", required=true, @OA\Schema(type="integer"))
and another like
* @Route("/users/followed", methods={"GET"})
I'm using the League's OpenAPI PSR-7 Message Validator (https://github.com/thephpleague/openapi-psr7-validator) by converting the Symfony Request to a PSR-7 Request with symfony/psr-http-message-bridge
and nyholm/psr7
. It all works well, except for those 2 endpoints. I keep getting
The given request matched these operations: [/api/users/{id},get],[/api/charter-calculations/followed,get]. However, it matched not a single schema of theirs.
Is it possible the /followed
can only be matched against /{id}
? and thus the validator gets confused? Or is a regex for {id}
as I have already done possible?