today tried to use a swagger in apigility project and found the following error.
/**
* Create and return a SwaggerUiController instance.
*
* @param ContainerInterface $container
* @param string $requestedName
* @param null|array $options
* @return SwaggerUiController
* @throws ServiceNotCreatedException when ApiFactory service is missing.
*/
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
if (! $container->has(ApiFactory::class)) {
throw new ServiceNotCreatedException(sprintf(
'%s requires the service %s, which was not found',
SwaggerUiController::class,
ApiFactory::class
));
}
return new SwaggerUiController($services->get(ApiFactory::class));
}
I found that only this line had problem
return new SwaggerUiController($services->get(ApiFactory::class));
I changed $services to $container and so
return new SwaggerUiController($container->get(ApiFactory::class));
today tried to use a swagger in apigility project and found the following error.
I found that only this line had problem
return new SwaggerUiController($services->get(ApiFactory::class));
I changed
$services
to$container
and soreturn new SwaggerUiController($container->get(ApiFactory::class));