Skip to content

Conversation

levinbaria
Copy link

@levinbaria levinbaria commented Sep 17, 2025

Fix the broken REST schema callback in the WP_REST_Abilities_List_Controller, as it is calling get_public_item_schema instead of get_item_schema.

Fixes #78

Copy link

github-actions bot commented Sep 17, 2025

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: levinbaria <[email protected]>
Co-authored-by: gziolo <[email protected]>
Co-authored-by: justlevine <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@levinbaria levinbaria marked this pull request as draft September 17, 2025 06:07
@levinbaria levinbaria marked this pull request as ready for review September 17, 2025 06:08
Copy link

codecov bot commented Sep 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.33%. Comparing base (59d8ec6) to head (0607006).

Additional details and impacted files
@@            Coverage Diff            @@
##              trunk      #79   +/-   ##
=========================================
  Coverage     83.33%   83.33%           
  Complexity       96       96           
=========================================
  Files             8        8           
  Lines           516      516           
=========================================
  Hits            430      430           
  Misses           86       86           
Flag Coverage Δ
unit 83.33% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gziolo gziolo added the [Type] Bug Something isn't working label Sep 17, 2025
@gziolo gziolo modified the milestone: v0.2.0 Sep 17, 2025
@gziolo gziolo requested a review from emdashcodes September 17, 2025 07:09
@gziolo
Copy link
Member

gziolo commented Sep 17, 2025

@emdashcodes, can you confirm it is a bug? get_public_item_schema is method on WP_REST_Controller and it calls internally get_item_schema so everything seems coorect. There is a unit test in place that passes with both implementations.

@justlevine
Copy link
Contributor

justlevine commented Sep 17, 2025

get_public_item_schema is method on WP_REST_Controller and it calls internally get_item_schema so everything seems correct.

That (and the passing tests) is only because we're not currently using arg_options anywhere.

If there isn't a specific reason to deviate, I'd recommend we follow core as proposed here(implement get_item_schema, call get_public_item_schema) instead of turning this into an inconsistent implementation detail contributors/maintainers need to watch out for if/when the schema warrants changes.

(Code LGTM and I don't think this needs tests either, not "approving" so it doesn't get accidently merged before @emdashcodes can weigh in)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

REST Abilities List Controller calling wrong callback for the schema.
3 participants