Skip to content

Update PublicWikiController parameter validation and add unit tests#1156

Merged
tarrow merged 3 commits into
mainfrom
improve-PublicWikiController-validation
Jun 11, 2026
Merged

Update PublicWikiController parameter validation and add unit tests#1156
tarrow merged 3 commits into
mainfrom
improve-PublicWikiController-validation

Conversation

@outdooracorn

Copy link
Copy Markdown
Member
  • Validate page and per_page params as integers rather than numbers
  • Add page and per_page minimum limit of 1
  • Add per_page maximum limit of 100

Bug: T428711

@outdooracorn outdooracorn self-assigned this Jun 10, 2026

@outdooracorn outdooracorn left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment thread app/Http/Controllers/PublicWikiController.php
@tarrow

tarrow commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

WIP until we have informed the suite team and they have changed https://github.com/wmde/wikibase-metadata/blob/748652566556d1255e8dc79c21b64bd58c2b6bb9/backend/fetch_data/cloud_api_data/get_cloud_api_data.py#L7

I actually think we can change this endpoint without trying to coordinate given we provide no formal stability offers for this endpoint

Comment thread app/Http/Controllers/PublicWikiController.php Outdated
@outdooracorn outdooracorn marked this pull request as ready for review June 10, 2026 10:18
tarrow
tarrow previously approved these changes Jun 11, 2026
* Validate `page` and `per_page` params as integers rather than numbers
* Add `page` and `per_page` minimum limit of 1
* Add `per_page` maximum limit of 100

Bug: T421877
@tarrow tarrow force-pushed the improve-PublicWikiController-validation branch from 8349d22 to 0b72027 Compare June 11, 2026 12:40
Comment thread tests/Http/Controllers/PublicWikiControllerTest.php Outdated

@tarrow tarrow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

boldly approving my own lint change

@tarrow tarrow merged commit 1bccd9d into main Jun 11, 2026
4 checks passed
@tarrow tarrow deleted the improve-PublicWikiController-validation branch June 11, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants