We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Annotation syntax error

Hello.

For generating Swagger documentation by php code annotations I use package.

/**
     *
     * @HttpMethods('GET')
     * @param string $domain
     *
     * @SWG\Get(
     *      @SWG\Response(
     *          response="200"
     *      ),
     *      security={
     *          {
     *              "apiKey": {}
     *          }
     *      },
     *      operationId="getBaseAnalysis",
     *      path="/api/v1/analysis/base/{domain}",
     *      tags={"tag1"},
     *      produces={"application/json"}
     * )
     */
    public function baseAction($domain)
    {
       // some code goes here
    }

All works fine (swagger.json file is generated), excluding annotaion

     *      security={
     *          {
     *              "apiKey": {}
     *          }
     *      }

on which Phalcon\Annotations\Adapter\Memory::getMethod() throws exception

Phalcon\Annotations\Exception object {
  message => (string) Syntax error, unexpected token }, near to '
}

Any ideas? I have the same issue with bearerToken using this syntax...