Laminas API Tools - unable to create new API in Admi UI

Anyone else is experiencing an error when creating new API tool when navigating to: [url]/api-tools/ui ?

Currently I am getting:

Fatal error: Uncaught Laminas\ModuleManager\Exception\RuntimeException: Module (ApplicationTest) could not be initialized. in E:\RZECZY_ADAMA\_XAMPP\xampp-7.4\htdocs\laminas_app\vendor\laminas\laminas-modulemanager\src\ModuleManager.php:202

It looks like you added the module ApplicationTest in config/modules.config.php.
You shouldn’t. Can you show use the content of this file => config/modules.config.php

Yes, the Admin UI during creation of new endpoint did add the 'ApplicationTest', into the list as the last item. Is that a bug?

Full list:

return array(

ok now can you show us the parts involving autoloading in your composer.json please

@gary it turns out Laminas API Tools Admin UI have a bug as the default module structure have changed. Here is how it should look like:


I will raise a ticket on the related repo.

Here is a link:

have you tried to overwrite the value of path_spec to psr-4 in the following config:

    'api-tools-admin' => [
    // path_spec defines whether modules should be created using PSR-0
    //     or PSR-4 module structure; the default is to use PSR-0.
    //     Valid values are:
    //     - Laminas\ApiTools\Admin\Model\ModulePathSpec::PSR_0 ("psr-0")
    //     - Laminas\ApiTools\Admin\Model\ModulePathSpec::PSR_4 ("psr-4")
    // 'path_spec' => 'psr-0',

I’ve already found out a solution myself above and marked it as Solution.

Thanks for reply anyway :slight_smile: