Undefined class constant 'DUMP_OBJECT_AS_MAP'

462 Views Asked by At

I'm getting following errors when I run openapi command to generate swagger file.

Command

#vendor/bin/openapi api/modules/v3/controllers/AbcController.php swagger

Notice: Trying to access array offset on value of type bool 
Notice: Trying to access array offset on value of type bool 
Notice: Trying to access array offset on value of type bool 
Exception: Undefined class constant 'DUMP_OBJECT_AS_MAP'

----------------------swagger annotations-------------

Top of the controller class

/**

@OA\Info(title="Search API", version="1.0.0")
*/

Above getBookmark action

 /**
 * @OA\Get(
 *   tags={"Tag"},
 *   path="/get-bookmarks",
 *   summary="Summary",
 *   @OA\Response(response=200, description="OK"),
 *   @OA\Response(response=401, description="Unauthorized"),
 *   @OA\Response(response=404, description="Not Found")
 * )
 */

I'm using following extension to generate swagger file

https://www.yiiframework.com/extension/genxoft/yii2-oas3

===================UPDATE========================

composer.json

enter image description here

===================Update 2 =====================

symfony/yaml                      v2.8.52     Symfony Yaml Component

Anyone can help me on this?

Thanks

1

There are 1 best solutions below

4
On

The annotations look ok to me; DUMP_OBJECT_AS_MAP is a const on the symfony Yaml class so either that installation is corrupt or very old?!

It sure would be interesting to see where the Notice: Trying to access array offset on value of type bool message comes from.