NelmioApiDocBundle icon indicating copy to clipboard operation
NelmioApiDocBundle copied to clipboard

Best way to get the schema of a single endpoint?

Open LuigiCardamone opened this issue 4 years ago • 0 comments

Given a Controller with this Action:

     /**
     * @Route("/api/users", methods={"GET"})
     * 
     * @OA\Response(...)
     * 
     * @OA\Parameter(
     *     name="order",
     *     in="query",
     *     description="The field used to order users",
     *     @OA\Schema(type="string")
     * )
     */
    public function getUsers()
    {
        // ...
    }

which is the best way to create another endpoint that returns the OpenApi schema of "/api/users" ?

Put in other words:

     /**
     * @Route("/api/users.schema", methods={"GET"})
     */
    public function getUsersSchema()
    {
        // TODO: generate and return "/api/users" schema
    }

is there any way to call the Bundle and get the schema of a given route or url?

LuigiCardamone avatar Nov 18 '21 09:11 LuigiCardamone