Fix Abilities Explorer input schema validation#787
Conversation
…lorer page, ensure we can pass in non-array schemas
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @squarestar. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #787 +/- ##
=============================================
+ Coverage 76.48% 76.57% +0.09%
- Complexity 1869 1870 +1
=============================================
Files 89 89
Lines 7990 7992 +2
=============================================
+ Hits 6111 6120 +9
+ Misses 1879 1872 -7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jeffpaul
left a comment
There was a problem hiding this comment.
Tested via P{layground and using test steps things worked as expected.
|
The |
…er_setting_args and there's a chance other plugins could hook here and return bad data, resulting in fatals
Thanks for the flag there. I'd argue that's an issue in that plugin as they shouldn't be returning |
|
@squarestar if you can connect your GitHub and WordPress.org accounts, then I can formally credit you on the release announcement post and grant the AI Contributor badge. |
|
Thanks but that WP account isn't the one I'd want connected to this GH account. I've connected my WP squarestar account but I used a different one to open the topic on wp.org. No worries if you don't credit me. |
|
@squarestar what's your preferred WPORG account to credit for work on this AI plugin release then? |
What?
Closes https://wordpress.org/support/topic/bug-ability_handlervalidate_input-wont-accept-scalar-inputs/
Ensure when we validate the input schema in the Abilities Explorer page we allow both array and scalar inputs
Why?
Abilities can have input schemas that are just scalar (like a single post ID) and also support input schemas that are arrays. Our validation we run in the Abilities Explorer was only allowing array schemas so any Abilities that had scalar schemas were rejected.
How?
Remove the array type hint on both
invoke_abilityandvalidate_inputso scalar schemas can be used.Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Opus 4.8
Used for: Validating bug, suggesting a fix and executing that fix. Final review and testing by me
Testing Instructions
Tools > Abilities ExplorerGet Environment Info)Test AbilitybuttonValidate Inputbutton to ensure the schema validates correctlyInvoke Abilityand ensure the Ability is triggered successfullyChangelog Entry