[wp-trac] [WordPress Trac] #64955: Add schema compiler for AI tool calling compatibility
WordPress Trac
noreply at wordpress.org
Tue Jun 2 14:09:04 UTC 2026
#64955: Add schema compiler for AI tool calling compatibility
--------------------------------------+-----------------------
Reporter: gziolo | Owner: gziolo
Type: enhancement | Status: assigned
Priority: normal | Milestone: 7.1
Component: Abilities API | Version: 6.9
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses: rest-api
--------------------------------------+-----------------------
Comment (by gziolo):
In [changeset:"62449" 62449]:
{{{
#!CommitTicketReference repository="" revision="62449"
Abilities API: Normalize `required` schema shape for REST responses
Ability schemas are a public contract that REST clients, including the
`@wordpress/abilities` JavaScript client, validate against as standard
JSON Schema. The `required` keyword must therefore use the draft-04 array-
of-property-names form, not the draft-03 per-property boolean that
`rest_validate_value_from_schema()` also accepts on the server.
In `WP_REST_Abilities_V1_List_Controller::prepare_schema_for_response()`,
collect per-property `required: true` booleans into a parent `required`
array, recursively and inside array `items`. Strip `required: false` and
boolean `required` values with no draft-04 equivalent, and honor
`rest_validate_object_value_from_schema()` precedence where an existing
draft-04 array wins. Only the REST response copy is rewritten; stored
schemas and server-side validation are unchanged.
Props gziolo, westonruter, jorgefilipecosta.
See #64955.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64955#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list