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 '
}