getRouter()->fromHere(absolute: true); $api_base_url = str_replace('/openapi.yml', '', $api_base_url); define('AZURACAST_API_URL', $api_base_url); define('AZURACAST_API_NAME', 'This AzuraCast Installation'); define('AZURACAST_VERSION', $this->version->getVersion()); $finder = Util::finder( [ $this->environment->getBaseDirectory() . '/util/openapi.php', $this->environment->getBaseDirectory() . '/src/Entity', $this->environment->getBaseDirectory() . '/src/Controller/Api', ], [ 'bootstrap', 'locale', 'templates', ] ); $yaml = (Generator::scan($finder))->toYaml(); $response->getBody()->write($yaml); return $response->withHeader('Content-Type', 'text/x-yaml'); } }