Single file swagger docs generation, #PG-4887#20
Conversation
| } | ||
|
|
||
| if (strtolower($plugin) == 'all') { | ||
| $plugins = require __DIR__ . '/../config/plugins.php'; |
There was a problem hiding this comment.
@lachiebol Is this something specific to ddev ? I don't see any such files.
I think below is the correct way to get all Plugins.
$pluginNames = PluginManager::getAllPluginsNames();
There was a problem hiding this comment.
I see below, you have added a list, can't we use above method and have a blockList ?
There was a problem hiding this comment.
I prefer the allowlist - safer that we have to manually add new plugins.
There was a problem hiding this comment.
(Assuming we keep this as an internal tool only)
There was a problem hiding this comment.
@lachiebol Is this something specific to ddev ? I don't see any such files. I think below is the correct way to get all Plugins.
$pluginNames = PluginManager::getAllPluginsNames();
The new list is only for plugins with an API.php file. I could go this route but I'll need to check how the existing commands handle plugins with no API
There was a problem hiding this comment.
I am okay with the current approach also 👍
AltamashShaikh
left a comment
There was a problem hiding this comment.
@lachiebol Getting below error when running
/console openapidocs:generate-spec-file --plugin=FormAnalytics --add-annotations
| } | ||
|
|
||
| if (strtolower($plugin) == 'all') { | ||
| $plugins = require __DIR__ . '/../config/plugins.php'; |
There was a problem hiding this comment.
I see below, you have added a list, can't we use above method and have a blockList ?
Codex picked up this one for me. I'm not sure why phpstan didn't find it either - maybe we need a higher level. |
|
@AltamashShaikh I've just added a case for where content-type isn't set. I'm curious what endpoint returned that for you, because it didn't happen for me. I wonder if it's because it's failing the demo.matomo.cloud request, then falling back to our local matomo, which is different. |
@lachiebol You can view the error - https://demo.matomo.cloud/?module=API&method=FormAnalytics.getForms&idSite=1&format=Tsv&token_auth=anonymous&convertToUnicode=0&hideIdSubDatable=1
|
|
@lachiebol For local I am getting |
|
I got this when testing, but haven't had a chance to dig in: |
@james-hill-matomo It looks like you have a cached response from demo that has invalid XML (spaces in <South America>). I'll add a check when it grabs from cache as well. |
|
@james-hill-matomo That error shouldn't show now. We just skip the invalid XML now, it would be nice to go fix that endpoint so it was proper XML |
Co-authored-by: Altamash Shaikh <altu9594@gmail.com>



Description
Have added new params to the
openapidocs:generate-spec-filecommand.Added 'all' option to --plugins param
Added --add-annotations param that does the intermediate step of generating annotations
For a single plugin:
ddev matomo:console openapidocs:generate-spec-file --plugin CrashAnalytics --not-dry-run --add-annotationsFor multiple plugins:
ddev matomo:console openapidocs:generate-spec-file --plugin CrashAnalytics,AbTesting --not-dry-run --add-annotationsFor all plugins:
ddev matomo:console openapidocs:generate-spec-file --plugin all --not-dry-run --add-annotationsIssue No
Steps to Replicate the Issue
Checklist