It took me days to realize that the marked solution from Laminas API Tools - unable to create new API in Admi UI - #5 by divix is what I needed to take a closer look at.
When trying to add an API in the Laminas API Tools Admin UI, I still get the same error, but now I know how to fix it (manipulate code manually) so I can still use the API Tools Admin UI:
As you can see in the screenshot above, another folder named NewAPI is automatically created under the src folder. I totally overlooked that when trying to add the new module to the autoloader in my comopser.json-file.
The following works fine for me now:
- I do not delete the new entry ‘NewApi’ from modules.config.php
- I am adding the new module to the autoloader in my comopser.json-file:
...
"autoload-dev": {
"psr-4": {
"NewAPI\\": "module/NewAPI/src/NewAPI/"
}
},
...
After these steps and a page refresh, my new API is available in Laminas API Tools and I can work with it.