Make WordPress Core


Ignore:
Timestamp:
06/23/2026 11:40:49 AM (20 hours ago)
Author:
gziolo
Message:

REST API: Add a shared helper for JSON Schema allowed keywords.

Introduce wp_get_json_schema_allowed_keywords() as the single place to decide which JSON Schema keywords may stay in schema output. It supports two profiles: rest-api (the default, used for REST route output) and draft-04 (a wider draft-04 set used when publishing schemas to clients such as the Abilities API).

Route schema output now flows through the helper and the new wp_json_schema_allowed_keywords filter, replacing the Abilities-specific special casing in the REST list controller. Validation internals still call rest_get_allowed_schema_keywords() directly, so REST validation behavior does not change.

Props gziolo, apermo.
See #64955.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-settings.php

    r62547 r62549  
    314314require ABSPATH . WPINC . '/abilities.php';
    315315require ABSPATH . WPINC . '/rest-api.php';
     316require ABSPATH . WPINC . '/json-schema.php';
    316317require ABSPATH . WPINC . '/rest-api/class-wp-rest-server.php';
    317318require ABSPATH . WPINC . '/rest-api/class-wp-rest-response.php';
Note: See TracChangeset for help on using the changeset viewer.