I'm ussing Swagger to documentate my api-rest and i found a problem that i can't fix. When i start to documentate my api i create this comments before the function:
/**
* @OA\Get(
* path="/api/my-route/",
* tags={"My-tag1","My-tag2"},
* description="Get data from user profile",
* @OA\Parameter(
* name="name_parameter",
* in="query",
* description="description parameter",
* required=true,
* ),
* @OA\Response(response="200", description="Data from user profile"),
* security={ {"api_key": {}} }
* )
*/
The code generate a good documentation but... When i go to test the route i found my problem:
How can set a parameter without question mark?
Something like this:
You should use :
in="path"
And modify your path :
path="/api/my-route/{name_parameter}"
You can find more informations here : https://swagger.io/docs/specification/describing-parameters/#path-parameters