Skip to content

Get spec generation ready for initial plugin API specs#8

Merged
snake14 merged 9 commits into
5.x-devfrom
PG-4544-improve-globals
Sep 10, 2025
Merged

Get spec generation ready for initial plugin API specs#8
snake14 merged 9 commits into
5.x-devfrom
PG-4544-improve-globals

Conversation

@snake14
Copy link
Copy Markdown
Contributor

@snake14 snake14 commented Sep 8, 2025

Description

Doing some cleanup to improve the quality of the annotations and specs which can be generated.

Issue No

PG-4544

Steps to Replicate the Issue

  1. Run ddev matomo:console openapidocs:generate-spec-file --plugin=CustomReports --not-dry-run
  2. Open plugins/CustomReports/OpenApi/Specs/CustomReports_v1.0.0.json in PHPStorm and confirm that everything validates
  3. Switch to preview mode and see the spec presented via Swagger UI

Checklist

  • [✔] Tested locally or on demo2/demo3?
  • [✖] New test case added/updated?
  • [NA] Are all newly added texts included via translation?
  • [NA] Are text sanitized properly? (Eg use of v-text v/s v-html for vue)
  • [✖] Version bumped?

@snake14 snake14 added the Needs Review For pull requests that need a code review. label Sep 9, 2025
@snake14 snake14 requested a review from a team September 9, 2025 05:44
Copy link
Copy Markdown
Contributor

@AltamashShaikh AltamashShaikh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@snake14
no input for array values, is that expected ?

image

Also unreleated, getAvailableDimensions and getAvailableMetrics requires idsite but it is never used

@snake14
Copy link
Copy Markdown
Contributor Author

snake14 commented Sep 9, 2025

@snake14 no input for array values, is that expected ?

Also unreleated, getAvailableDimensions and getAvailableMetrics requires idsite but it is never used

@AltamashShaikh Yes. That's apparently how SwaggerUI works. If you click on the Try it out button, it provides the ability to add items to the array:
image

Even if a parameter isn't used by the method, if it's in the signature and doesn't provide a default value in the signature, it's technically a required parameter and enforced by Matomo. If I make a request to either of those endpoints without the idSite parameter, I receive the following error response: Please specify a value for 'idSite'..

Copy link
Copy Markdown
Contributor

@AltamashShaikh AltamashShaikh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@snake14 snake14 marked this pull request as ready for review September 10, 2025 04:20
@snake14
Copy link
Copy Markdown
Contributor Author

snake14 commented Sep 10, 2025

@AltamashShaikh I thought that I had moved it out of draft. Can you please approve so that I can merge?

@snake14 snake14 merged commit a290e78 into 5.x-dev Sep 10, 2025
7 checks passed
@snake14 snake14 deleted the PG-4544-improve-globals branch September 10, 2025 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review For pull requests that need a code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants