Make WordPress Core


Ignore:
Timestamp:
11/13/2025 10:25:05 PM (4 months ago)
Author:
jorgefilipecosta
Message:

Fix: Core abilities invalid schemas (has examples and returns empty array intested of object).

Theis commit fixes two issues with the core abilities schemas we have:

  • They have examples on the schema with is not complient with the version draft-04 of schema JSON we are using.
  • The top level defaults are defined as an empty array and they are of type object, but a php empty array gets JSON serialized and returned in the rest API as [] instead of {}, causing problems on the client validation.

Developed in #10510.

Props jorgefilipecosta, gziolo.
Fixes #64252.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/abilities.php

    r61075 r61244  
    221221                        'type'        => 'string',
    222222                        'description' => __( 'The database server vendor and version string reported by the driver.' ),
    223                         'examples'    => array( '8.0.34', '10.11.6-MariaDB' ),
    224223                    ),
    225224                    'wp_version'     => array(
Note: See TracChangeset for help on using the changeset viewer.