Make WordPress Core

Changeset 49257


Ignore:
Timestamp:
10/20/2020 08:17:20 PM (4 years ago)
Author:
TimothyBlynJacobs
Message:

REST API: Make sure all supported JSON Schema keywords are output in the index.

Previously, only a small subset of keywords were exposed which limited the utility of OPTIONS requests.

Props raubvogel, TimothyBlynJacobs.
Fixes #51020.

Location:
trunk
Files:
4 edited

Legend:

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

    r49246 r49257  
    18761876
    18771877/**
    1878  * Validate a value based on a schema.
    1879  *
    1880  * @since 4.7.0
    1881  * @since 4.9.0 Support the "object" type.
    1882  * @since 5.2.0 Support validating "additionalProperties" against a schema.
    1883  * @since 5.3.0 Support multiple types.
    1884  * @since 5.4.0 Convert an empty string to an empty object.
    1885  * @since 5.5.0 Add the "uuid" and "hex-color" formats.
    1886  *              Support the "minLength", "maxLength" and "pattern" keywords for strings.
    1887  *              Support the "minItems", "maxItems" and "uniqueItems" keywords for arrays.
    1888  *              Validate required properties.
    1889  * @since 5.6.0 Support the "minProperties" and "maxProperties" keywords for objects.
    1890  *              Support the "multipleOf" keyword for numbers and integers.
    1891  *              Support the "patternProperties" keyword for objects.
    1892  *              Support the "anyOf" and "oneOf" keywords.
    1893  *
    1894  * @param mixed  $value The value to validate.
    1895  * @param array  $args  Schema array to use for validation.
    1896  * @param string $param The parameter name, used in error messages.
    1897  * @return true|WP_Error
    1898  */
    1899 function rest_validate_value_from_schema( $value, $args, $param = '' ) {
    1900     if ( isset( $args['anyOf'] ) ) {
    1901         $matching_schema = rest_find_any_matching_schema( $value, $args, $param );
    1902         if ( is_wp_error( $matching_schema ) ) {
    1903             return $matching_schema;
    1904         }
    1905 
    1906         if ( ! isset( $args['type'] ) && isset( $matching_schema['type'] ) ) {
    1907             $args['type'] = $matching_schema['type'];
    1908         }
    1909     }
    1910 
    1911     if ( isset( $args['oneOf'] ) ) {
    1912         $matching_schema = rest_find_one_matching_schema( $value, $args, $param );
    1913         if ( is_wp_error( $matching_schema ) ) {
    1914             return $matching_schema;
    1915         }
    1916 
    1917         if ( ! isset( $args['type'] ) && isset( $matching_schema['type'] ) ) {
    1918             $args['type'] = $matching_schema['type'];
    1919         }
    1920     }
    1921 
    1922     $allowed_types = array( 'array', 'object', 'string', 'number', 'integer', 'boolean', 'null' );
    1923 
    1924     if ( ! isset( $args['type'] ) ) {
    1925         /* translators: %s: Parameter. */
    1926         _doing_it_wrong( __FUNCTION__, sprintf( __( 'The "type" schema keyword for %s is required.' ), $param ), '5.5.0' );
    1927     }
    1928 
    1929     if ( is_array( $args['type'] ) ) {
    1930         $best_type = rest_handle_multi_type_schema( $value, $args, $param );
    1931 
    1932         if ( ! $best_type ) {
    1933             return new WP_Error(
    1934                 'rest_invalid_type',
    1935                 /* translators: 1: Parameter, 2: List of types. */
    1936                 sprintf( __( '%1$s is not of type %2$s.' ), $param, implode( ',', $args['type'] ) ),
    1937                 array( 'param' => $param )
    1938             );
    1939         }
    1940 
    1941         $args['type'] = $best_type;
    1942     }
    1943 
    1944     if ( ! in_array( $args['type'], $allowed_types, true ) ) {
    1945         _doing_it_wrong(
    1946             __FUNCTION__,
    1947             /* translators: 1: Parameter, 2: The list of allowed types. */
    1948             wp_sprintf( __( 'The "type" schema keyword for %1$s can only be one of the built-in types: %2$l.' ), $param, $allowed_types ),
    1949             '5.5.0'
    1950         );
    1951     }
    1952 
    1953     if ( 'array' === $args['type'] ) {
    1954         if ( ! rest_is_array( $value ) ) {
    1955             return new WP_Error(
    1956                 'rest_invalid_type',
    1957                 /* translators: 1: Parameter, 2: Type name. */
    1958                 sprintf( __( '%1$s is not of type %2$s.' ), $param, 'array' ),
    1959                 array( 'param' => $param )
    1960             );
    1961         }
    1962 
    1963         $value = rest_sanitize_array( $value );
    1964 
    1965         if ( isset( $args['items'] ) ) {
    1966             foreach ( $value as $index => $v ) {
    1967                 $is_valid = rest_validate_value_from_schema( $v, $args['items'], $param . '[' . $index . ']' );
    1968                 if ( is_wp_error( $is_valid ) ) {
    1969                     return $is_valid;
    1970                 }
    1971             }
    1972         }
    1973 
    1974         if ( isset( $args['minItems'] ) && count( $value ) < $args['minItems'] ) {
    1975             /* translators: 1: Parameter, 2: Number. */
    1976             return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must contain at least %2$s items.' ), $param, number_format_i18n( $args['minItems'] ) ) );
    1977         }
    1978 
    1979         if ( isset( $args['maxItems'] ) && count( $value ) > $args['maxItems'] ) {
    1980             /* translators: 1: Parameter, 2: Number. */
    1981             return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must contain at most %2$s items.' ), $param, number_format_i18n( $args['maxItems'] ) ) );
    1982         }
    1983 
    1984         if ( ! empty( $args['uniqueItems'] ) && ! rest_validate_array_contains_unique_items( $value ) ) {
    1985             /* translators: 1: Parameter. */
    1986             return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s has duplicate items.' ), $param ) );
    1987         }
    1988     }
    1989 
    1990     if ( 'object' === $args['type'] ) {
    1991         if ( ! rest_is_object( $value ) ) {
    1992             return new WP_Error(
    1993                 'rest_invalid_type',
    1994                 /* translators: 1: Parameter, 2: Type name. */
    1995                 sprintf( __( '%1$s is not of type %2$s.' ), $param, 'object' ),
    1996                 array( 'param' => $param )
    1997             );
    1998         }
    1999 
    2000         $value = rest_sanitize_object( $value );
    2001 
    2002         if ( isset( $args['required'] ) && is_array( $args['required'] ) ) { // schema version 4
    2003             foreach ( $args['required'] as $name ) {
    2004                 if ( ! array_key_exists( $name, $value ) ) {
    2005                     /* translators: 1: Property of an object, 2: Parameter. */
    2006                     return new WP_Error( 'rest_property_required', sprintf( __( '%1$s is a required property of %2$s.' ), $name, $param ) );
    2007                 }
    2008             }
    2009         } elseif ( isset( $args['properties'] ) ) { // schema version 3
    2010             foreach ( $args['properties'] as $name => $property ) {
    2011                 if ( isset( $property['required'] ) && true === $property['required'] && ! array_key_exists( $name, $value ) ) {
    2012                     /* translators: 1: Property of an object, 2: Parameter. */
    2013                     return new WP_Error( 'rest_property_required', sprintf( __( '%1$s is a required property of %2$s.' ), $name, $param ) );
    2014                 }
    2015             }
    2016         }
    2017 
    2018         foreach ( $value as $property => $v ) {
    2019             if ( isset( $args['properties'][ $property ] ) ) {
    2020                 $is_valid = rest_validate_value_from_schema( $v, $args['properties'][ $property ], $param . '[' . $property . ']' );
    2021                 if ( is_wp_error( $is_valid ) ) {
    2022                     return $is_valid;
    2023                 }
    2024                 continue;
    2025             }
    2026 
    2027             $pattern_property_schema = rest_find_matching_pattern_property_schema( $property, $args );
    2028             if ( null !== $pattern_property_schema ) {
    2029                 $is_valid = rest_validate_value_from_schema( $v, $pattern_property_schema, $param . '[' . $property . ']' );
    2030                 if ( is_wp_error( $is_valid ) ) {
    2031                     return $is_valid;
    2032                 }
    2033                 continue;
    2034             }
    2035 
    2036             if ( isset( $args['additionalProperties'] ) ) {
    2037                 if ( false === $args['additionalProperties'] ) {
    2038                     /* translators: %s: Property of an object. */
    2039                     return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not a valid property of Object.' ), $property ) );
    2040                 }
    2041 
    2042                 if ( is_array( $args['additionalProperties'] ) ) {
    2043                     $is_valid = rest_validate_value_from_schema( $v, $args['additionalProperties'], $param . '[' . $property . ']' );
    2044                     if ( is_wp_error( $is_valid ) ) {
    2045                         return $is_valid;
    2046                     }
    2047                 }
    2048             }
    2049         }
    2050 
    2051         if ( isset( $args['minProperties'] ) && count( $value ) < $args['minProperties'] ) {
    2052             /* translators: 1: Parameter, 2: Number. */
    2053             return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must contain at least %2$s properties.' ), $param, number_format_i18n( $args['minProperties'] ) ) );
    2054         }
    2055 
    2056         if ( isset( $args['maxProperties'] ) && count( $value ) > $args['maxProperties'] ) {
    2057             /* translators: 1: Parameter, 2: Number. */
    2058             return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must contain at most %2$s properties.' ), $param, number_format_i18n( $args['maxProperties'] ) ) );
    2059         }
    2060     }
    2061 
    2062     if ( 'null' === $args['type'] ) {
    2063         if ( null !== $value ) {
    2064             return new WP_Error(
    2065                 'rest_invalid_type',
    2066                 /* translators: 1: Parameter, 2: Type name. */
    2067                 sprintf( __( '%1$s is not of type %2$s.' ), $param, 'null' ),
    2068                 array( 'param' => $param )
    2069             );
    2070         }
    2071 
    2072         return true;
    2073     }
    2074 
    2075     if ( ! empty( $args['enum'] ) ) {
    2076         if ( ! in_array( $value, $args['enum'], true ) ) {
    2077             /* translators: 1: Parameter, 2: List of valid values. */
    2078             return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not one of %2$s.' ), $param, implode( ', ', $args['enum'] ) ) );
    2079         }
    2080     }
    2081 
    2082     if ( in_array( $args['type'], array( 'integer', 'number' ), true ) ) {
    2083         if ( ! is_numeric( $value ) ) {
    2084             return new WP_Error(
    2085                 'rest_invalid_type',
    2086                 /* translators: 1: Parameter, 2: Type name. */
    2087                 sprintf( __( '%1$s is not of type %2$s.' ), $param, $args['type'] ),
    2088                 array( 'param' => $param )
    2089             );
    2090         }
    2091 
    2092         if ( isset( $args['multipleOf'] ) && fmod( $value, $args['multipleOf'] ) !== 0.0 ) {
    2093             /* translators: 1: Parameter, 2: Multiplier. */
    2094             return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be a multiple of %2$s.' ), $param, $args['multipleOf'] ) );
    2095         }
    2096     }
    2097 
    2098     if ( 'integer' === $args['type'] && ! rest_is_integer( $value ) ) {
    2099         return new WP_Error(
    2100             'rest_invalid_type',
    2101             /* translators: 1: Parameter, 2: Type name. */
    2102             sprintf( __( '%1$s is not of type %2$s.' ), $param, 'integer' ),
    2103             array( 'param' => $param )
    2104         );
    2105     }
    2106 
    2107     if ( 'boolean' === $args['type'] && ! rest_is_boolean( $value ) ) {
    2108         return new WP_Error(
    2109             'rest_invalid_type',
    2110             /* translators: 1: Parameter, 2: Type name. */
    2111             sprintf( __( '%1$s is not of type %2$s.' ), $param, 'boolean' ),
    2112             array( 'param' => $param )
    2113         );
    2114     }
    2115 
    2116     if ( 'string' === $args['type'] ) {
    2117         if ( ! is_string( $value ) ) {
    2118             return new WP_Error(
    2119                 'rest_invalid_type',
    2120                 /* translators: 1: Parameter, 2: Type name. */
    2121                 sprintf( __( '%1$s is not of type %2$s.' ), $param, 'string' ),
    2122                 array( 'param' => $param )
    2123             );
    2124         }
    2125 
    2126         if ( isset( $args['minLength'] ) && mb_strlen( $value ) < $args['minLength'] ) {
    2127             return new WP_Error(
    2128                 'rest_invalid_param',
    2129                 sprintf(
    2130                     /* translators: 1: Parameter, 2: Number of characters. */
    2131                     _n( '%1$s must be at least %2$s character long.', '%1$s must be at least %2$s characters long.', $args['minLength'] ),
    2132                     $param,
    2133                     number_format_i18n( $args['minLength'] )
    2134                 )
    2135             );
    2136         }
    2137 
    2138         if ( isset( $args['maxLength'] ) && mb_strlen( $value ) > $args['maxLength'] ) {
    2139             return new WP_Error(
    2140                 'rest_invalid_param',
    2141                 sprintf(
    2142                     /* translators: 1: Parameter, 2: Number of characters. */
    2143                     _n( '%1$s must be at most %2$s character long.', '%1$s must be at most %2$s characters long.', $args['maxLength'] ),
    2144                     $param,
    2145                     number_format_i18n( $args['maxLength'] )
    2146                 )
    2147             );
    2148         }
    2149 
    2150         if ( isset( $args['pattern'] ) && ! rest_validate_json_schema_pattern( $args['pattern'], $value ) ) {
    2151             /* translators: 1: Parameter, 2: Pattern. */
    2152             return new WP_Error( 'rest_invalid_pattern', sprintf( __( '%1$s does not match pattern %2$s.' ), $param, $args['pattern'] ) );
    2153         }
    2154     }
    2155 
    2156     // The "format" keyword should only be applied to strings. However, for backward compatibility,
    2157     // we allow the "format" keyword if the type keyword was not specified, or was set to an invalid value.
    2158     if ( isset( $args['format'] )
    2159         && ( ! isset( $args['type'] ) || 'string' === $args['type'] || ! in_array( $args['type'], $allowed_types, true ) )
    2160     ) {
    2161         switch ( $args['format'] ) {
    2162             case 'hex-color':
    2163                 if ( ! rest_parse_hex_color( $value ) ) {
    2164                     return new WP_Error( 'rest_invalid_hex_color', __( 'Invalid hex color.' ) );
    2165                 }
    2166                 break;
    2167 
    2168             case 'date-time':
    2169                 if ( ! rest_parse_date( $value ) ) {
    2170                     return new WP_Error( 'rest_invalid_date', __( 'Invalid date.' ) );
    2171                 }
    2172                 break;
    2173 
    2174             case 'email':
    2175                 if ( ! is_email( $value ) ) {
    2176                     return new WP_Error( 'rest_invalid_email', __( 'Invalid email address.' ) );
    2177                 }
    2178                 break;
    2179             case 'ip':
    2180                 if ( ! rest_is_ip_address( $value ) ) {
    2181                     /* translators: %s: IP address. */
    2182                     return new WP_Error( 'rest_invalid_param', sprintf( __( '%s is not a valid IP address.' ), $param ) );
    2183                 }
    2184                 break;
    2185             case 'uuid':
    2186                 if ( ! wp_is_uuid( $value ) ) {
    2187                     /* translators: %s: The name of a JSON field expecting a valid UUID. */
    2188                     return new WP_Error( 'rest_invalid_uuid', sprintf( __( '%s is not a valid UUID.' ), $param ) );
    2189                 }
    2190                 break;
    2191         }
    2192     }
    2193 
    2194     if ( in_array( $args['type'], array( 'number', 'integer' ), true ) && ( isset( $args['minimum'] ) || isset( $args['maximum'] ) ) ) {
    2195         if ( isset( $args['minimum'] ) && ! isset( $args['maximum'] ) ) {
    2196             if ( ! empty( $args['exclusiveMinimum'] ) && $value <= $args['minimum'] ) {
    2197                 /* translators: 1: Parameter, 2: Minimum number. */
    2198                 return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be greater than %2$d' ), $param, $args['minimum'] ) );
    2199             } elseif ( empty( $args['exclusiveMinimum'] ) && $value < $args['minimum'] ) {
    2200                 /* translators: 1: Parameter, 2: Minimum number. */
    2201                 return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be greater than or equal to %2$d' ), $param, $args['minimum'] ) );
    2202             }
    2203         } elseif ( isset( $args['maximum'] ) && ! isset( $args['minimum'] ) ) {
    2204             if ( ! empty( $args['exclusiveMaximum'] ) && $value >= $args['maximum'] ) {
    2205                 /* translators: 1: Parameter, 2: Maximum number. */
    2206                 return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be less than %2$d' ), $param, $args['maximum'] ) );
    2207             } elseif ( empty( $args['exclusiveMaximum'] ) && $value > $args['maximum'] ) {
    2208                 /* translators: 1: Parameter, 2: Maximum number. */
    2209                 return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be less than or equal to %2$d' ), $param, $args['maximum'] ) );
    2210             }
    2211         } elseif ( isset( $args['maximum'] ) && isset( $args['minimum'] ) ) {
    2212             if ( ! empty( $args['exclusiveMinimum'] ) && ! empty( $args['exclusiveMaximum'] ) ) {
    2213                 if ( $value >= $args['maximum'] || $value <= $args['minimum'] ) {
    2214                     /* translators: 1: Parameter, 2: Minimum number, 3: Maximum number. */
    2215                     return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be between %2$d (exclusive) and %3$d (exclusive)' ), $param, $args['minimum'], $args['maximum'] ) );
    2216                 }
    2217             } elseif ( empty( $args['exclusiveMinimum'] ) && ! empty( $args['exclusiveMaximum'] ) ) {
    2218                 if ( $value >= $args['maximum'] || $value < $args['minimum'] ) {
    2219                     /* translators: 1: Parameter, 2: Minimum number, 3: Maximum number. */
    2220                     return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be between %2$d (inclusive) and %3$d (exclusive)' ), $param, $args['minimum'], $args['maximum'] ) );
    2221                 }
    2222             } elseif ( ! empty( $args['exclusiveMinimum'] ) && empty( $args['exclusiveMaximum'] ) ) {
    2223                 if ( $value > $args['maximum'] || $value <= $args['minimum'] ) {
    2224                     /* translators: 1: Parameter, 2: Minimum number, 3: Maximum number. */
    2225                     return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be between %2$d (exclusive) and %3$d (inclusive)' ), $param, $args['minimum'], $args['maximum'] ) );
    2226                 }
    2227             } elseif ( empty( $args['exclusiveMinimum'] ) && empty( $args['exclusiveMaximum'] ) ) {
    2228                 if ( $value > $args['maximum'] || $value < $args['minimum'] ) {
    2229                     /* translators: 1: Parameter, 2: Minimum number, 3: Maximum number. */
    2230                     return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be between %2$d (inclusive) and %3$d (inclusive)' ), $param, $args['minimum'], $args['maximum'] ) );
    2231                 }
    2232             }
    2233         }
    2234     }
    2235 
    2236     return true;
    2237 }
    2238 
    2239 /**
    2240  * Sanitize a value based on a schema.
    2241  *
    2242  * @since 4.7.0
    2243  * @since 5.5.0 Added the `$param` parameter.
    2244  * @since 5.6.0 Support the "anyOf" and "oneOf" keywords.
    2245  *
    2246  * @param mixed  $value The value to sanitize.
    2247  * @param array  $args  Schema array to use for sanitization.
    2248  * @param string $param The parameter name, used in error messages.
    2249  * @return mixed|WP_Error The sanitized value or a WP_Error instance if the value cannot be safely sanitized.
    2250  */
    2251 function rest_sanitize_value_from_schema( $value, $args, $param = '' ) {
    2252     if ( isset( $args['anyOf'] ) ) {
    2253         $matching_schema = rest_find_any_matching_schema( $value, $args, $param );
    2254         if ( is_wp_error( $matching_schema ) ) {
    2255             return $matching_schema;
    2256         }
    2257 
    2258         if ( ! isset( $args['type'] ) ) {
    2259             $args['type'] = $matching_schema['type'];
    2260         }
    2261 
    2262         $value = rest_sanitize_value_from_schema( $value, $matching_schema, $param );
    2263     }
    2264 
    2265     if ( isset( $args['oneOf'] ) ) {
    2266         $matching_schema = rest_find_one_matching_schema( $value, $args, $param );
    2267         if ( is_wp_error( $matching_schema ) ) {
    2268             return $matching_schema;
    2269         }
    2270 
    2271         if ( ! isset( $args['type'] ) ) {
    2272             $args['type'] = $matching_schema['type'];
    2273         }
    2274 
    2275         $value = rest_sanitize_value_from_schema( $value, $matching_schema, $param );
    2276     }
    2277 
    2278     $allowed_types = array( 'array', 'object', 'string', 'number', 'integer', 'boolean', 'null' );
    2279 
    2280     if ( ! isset( $args['type'] ) ) {
    2281         /* translators: %s: Parameter. */
    2282         _doing_it_wrong( __FUNCTION__, sprintf( __( 'The "type" schema keyword for %s is required.' ), $param ), '5.5.0' );
    2283     }
    2284 
    2285     if ( is_array( $args['type'] ) ) {
    2286         $best_type = rest_handle_multi_type_schema( $value, $args, $param );
    2287 
    2288         if ( ! $best_type ) {
    2289             return null;
    2290         }
    2291 
    2292         $args['type'] = $best_type;
    2293     }
    2294 
    2295     if ( ! in_array( $args['type'], $allowed_types, true ) ) {
    2296         _doing_it_wrong(
    2297             __FUNCTION__,
    2298             /* translators: 1: Parameter, 2: The list of allowed types. */
    2299             wp_sprintf( __( 'The "type" schema keyword for %1$s can only be one of the built-in types: %2$l.' ), $param, $allowed_types ),
    2300             '5.5.0'
    2301         );
    2302     }
    2303 
    2304     if ( 'array' === $args['type'] ) {
    2305         $value = rest_sanitize_array( $value );
    2306 
    2307         if ( ! empty( $args['items'] ) ) {
    2308             foreach ( $value as $index => $v ) {
    2309                 $value[ $index ] = rest_sanitize_value_from_schema( $v, $args['items'], $param . '[' . $index . ']' );
    2310             }
    2311         }
    2312 
    2313         if ( ! empty( $args['uniqueItems'] ) && ! rest_validate_array_contains_unique_items( $value ) ) {
    2314             /* translators: 1: Parameter. */
    2315             return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s has duplicate items.' ), $param ) );
    2316         }
    2317 
    2318         return $value;
    2319     }
    2320 
    2321     if ( 'object' === $args['type'] ) {
    2322         $value = rest_sanitize_object( $value );
    2323 
    2324         foreach ( $value as $property => $v ) {
    2325             if ( isset( $args['properties'][ $property ] ) ) {
    2326                 $value[ $property ] = rest_sanitize_value_from_schema( $v, $args['properties'][ $property ], $param . '[' . $property . ']' );
    2327                 continue;
    2328             }
    2329 
    2330             $pattern_property_schema = rest_find_matching_pattern_property_schema( $property, $args );
    2331             if ( null !== $pattern_property_schema ) {
    2332                 $value[ $property ] = rest_sanitize_value_from_schema( $v, $pattern_property_schema, $param . '[' . $property . ']' );
    2333                 continue;
    2334             }
    2335 
    2336             if ( isset( $args['additionalProperties'] ) ) {
    2337                 if ( false === $args['additionalProperties'] ) {
    2338                     unset( $value[ $property ] );
    2339                 } elseif ( is_array( $args['additionalProperties'] ) ) {
    2340                     $value[ $property ] = rest_sanitize_value_from_schema( $v, $args['additionalProperties'], $param . '[' . $property . ']' );
    2341                 }
    2342             }
    2343         }
    2344 
    2345         return $value;
    2346     }
    2347 
    2348     if ( 'null' === $args['type'] ) {
    2349         return null;
    2350     }
    2351 
    2352     if ( 'integer' === $args['type'] ) {
    2353         return (int) $value;
    2354     }
    2355 
    2356     if ( 'number' === $args['type'] ) {
    2357         return (float) $value;
    2358     }
    2359 
    2360     if ( 'boolean' === $args['type'] ) {
    2361         return rest_sanitize_boolean( $value );
    2362     }
    2363 
    2364     // This behavior matches rest_validate_value_from_schema().
    2365     if ( isset( $args['format'] )
    2366         && ( ! isset( $args['type'] ) || 'string' === $args['type'] || ! in_array( $args['type'], $allowed_types, true ) )
    2367     ) {
    2368         switch ( $args['format'] ) {
    2369             case 'hex-color':
    2370                 return (string) sanitize_hex_color( $value );
    2371 
    2372             case 'date-time':
    2373                 return sanitize_text_field( $value );
    2374 
    2375             case 'email':
    2376                 // sanitize_email() validates, which would be unexpected.
    2377                 return sanitize_text_field( $value );
    2378 
    2379             case 'uri':
    2380                 return esc_url_raw( $value );
    2381 
    2382             case 'ip':
    2383                 return sanitize_text_field( $value );
    2384 
    2385             case 'uuid':
    2386                 return sanitize_text_field( $value );
    2387         }
    2388     }
    2389 
    2390     if ( 'string' === $args['type'] ) {
    2391         return (string) $value;
    2392     }
    2393 
    2394     return $value;
    2395 }
    2396 
    2397 /**
    2398  * Append result of internal request to REST API for purpose of preloading data to be attached to a page.
    2399  * Expected to be called in the context of `array_reduce`.
    2400  *
    2401  * @since 5.0.0
    2402  *
    2403  * @param array  $memo Reduce accumulator.
    2404  * @param string $path REST API path to preload.
    2405  * @return array Modified reduce accumulator.
    2406  */
    2407 function rest_preload_api_request( $memo, $path ) {
    2408     // array_reduce() doesn't support passing an array in PHP 5.2,
    2409     // so we need to make sure we start with one.
    2410     if ( ! is_array( $memo ) ) {
    2411         $memo = array();
    2412     }
    2413 
    2414     if ( empty( $path ) ) {
    2415         return $memo;
    2416     }
    2417 
    2418     $method = 'GET';
    2419     if ( is_array( $path ) && 2 === count( $path ) ) {
    2420         $method = end( $path );
    2421         $path   = reset( $path );
    2422 
    2423         if ( ! in_array( $method, array( 'GET', 'OPTIONS' ), true ) ) {
    2424             $method = 'GET';
    2425         }
    2426     }
    2427 
    2428     $path_parts = parse_url( $path );
    2429     if ( false === $path_parts ) {
    2430         return $memo;
    2431     }
    2432 
    2433     $request = new WP_REST_Request( $method, $path_parts['path'] );
    2434     if ( ! empty( $path_parts['query'] ) ) {
    2435         parse_str( $path_parts['query'], $query_params );
    2436         $request->set_query_params( $query_params );
    2437     }
    2438 
    2439     $response = rest_do_request( $request );
    2440     if ( 200 === $response->status ) {
    2441         $server = rest_get_server();
    2442         $data   = (array) $response->get_data();
    2443         $links  = $server::get_compact_response_links( $response );
    2444         if ( ! empty( $links ) ) {
    2445             $data['_links'] = $links;
    2446         }
    2447 
    2448         if ( 'OPTIONS' === $method ) {
    2449             $response = rest_send_allow_header( $response, $server, $request );
    2450 
    2451             $memo[ $method ][ $path ] = array(
    2452                 'body'    => $data,
    2453                 'headers' => $response->headers,
    2454             );
    2455         } else {
    2456             $memo[ $path ] = array(
    2457                 'body'    => $data,
    2458                 'headers' => $response->headers,
    2459             );
    2460         }
    2461     }
    2462 
    2463     return $memo;
    2464 }
    2465 
    2466 /**
    2467  * Parses the "_embed" parameter into the list of resources to embed.
    2468  *
    2469  * @since 5.4.0
    2470  *
    2471  * @param string|array $embed Raw "_embed" parameter value.
    2472  * @return true|string[] Either true to embed all embeds, or a list of relations to embed.
    2473  */
    2474 function rest_parse_embed_param( $embed ) {
    2475     if ( ! $embed || 'true' === $embed || '1' === $embed ) {
    2476         return true;
    2477     }
    2478 
    2479     $rels = wp_parse_list( $embed );
    2480 
    2481     if ( ! $rels ) {
    2482         return true;
    2483     }
    2484 
    2485     return $rels;
    2486 }
    2487 
    2488 /**
    2489  * Filters the response to remove any fields not available in the given context.
    2490  *
    2491  * @since 5.5.0
    2492  * @since 5.6.0 Support the "patternProperties" keyword for objects.
    2493  *              Support the "anyOf" and "oneOf" keywords.
    2494  *
    2495  * @param array|object $data    The response data to modify.
    2496  * @param array        $schema  The schema for the endpoint used to filter the response.
    2497  * @param string       $context The requested context.
    2498  * @return array|object The filtered response data.
    2499  */
    2500 function rest_filter_response_by_context( $data, $schema, $context ) {
    2501     if ( isset( $schema['anyOf'] ) ) {
    2502         $matching_schema = rest_find_any_matching_schema( $data, $schema, '' );
    2503         if ( ! is_wp_error( $matching_schema ) ) {
    2504             if ( ! isset( $schema['type'] ) ) {
    2505                 $schema['type'] = $matching_schema['type'];
    2506             }
    2507 
    2508             $data = rest_filter_response_by_context( $data, $matching_schema, $context );
    2509         }
    2510     }
    2511 
    2512     if ( isset( $schema['oneOf'] ) ) {
    2513         $matching_schema = rest_find_one_matching_schema( $data, $schema, '', true );
    2514         if ( ! is_wp_error( $matching_schema ) ) {
    2515             if ( ! isset( $schema['type'] ) ) {
    2516                 $schema['type'] = $matching_schema['type'];
    2517             }
    2518 
    2519             $data = rest_filter_response_by_context( $data, $matching_schema, $context );
    2520         }
    2521     }
    2522 
    2523     if ( ! is_array( $data ) && ! is_object( $data ) ) {
    2524         return $data;
    2525     }
    2526 
    2527     if ( isset( $schema['type'] ) ) {
    2528         $type = $schema['type'];
    2529     } elseif ( isset( $schema['properties'] ) ) {
    2530         $type = 'object'; // Back compat if a developer accidentally omitted the type.
    2531     } else {
    2532         return $data;
    2533     }
    2534 
    2535     $is_array_type  = 'array' === $type || ( is_array( $type ) && in_array( 'array', $type, true ) );
    2536     $is_object_type = 'object' === $type || ( is_array( $type ) && in_array( 'object', $type, true ) );
    2537 
    2538     if ( $is_array_type && $is_object_type ) {
    2539         if ( rest_is_array( $data ) ) {
    2540             $is_object_type = false;
    2541         } else {
    2542             $is_array_type = false;
    2543         }
    2544     }
    2545 
    2546     $has_additional_properties = $is_object_type && isset( $schema['additionalProperties'] ) && is_array( $schema['additionalProperties'] );
    2547 
    2548     foreach ( $data as $key => $value ) {
    2549         $check = array();
    2550 
    2551         if ( $is_array_type ) {
    2552             $check = isset( $schema['items'] ) ? $schema['items'] : array();
    2553         } elseif ( $is_object_type ) {
    2554             if ( isset( $schema['properties'][ $key ] ) ) {
    2555                 $check = $schema['properties'][ $key ];
    2556             } else {
    2557                 $pattern_property_schema = rest_find_matching_pattern_property_schema( $key, $schema );
    2558                 if ( null !== $pattern_property_schema ) {
    2559                     $check = $pattern_property_schema;
    2560                 } elseif ( $has_additional_properties ) {
    2561                     $check = $schema['additionalProperties'];
    2562                 }
    2563             }
    2564         }
    2565 
    2566         if ( ! isset( $check['context'] ) ) {
    2567             continue;
    2568         }
    2569 
    2570         if ( ! in_array( $context, $check['context'], true ) ) {
    2571             if ( $is_array_type ) {
    2572                 // All array items share schema, so there's no need to check each one.
    2573                 $data = array();
    2574                 break;
    2575             }
    2576 
    2577             if ( is_object( $data ) ) {
    2578                 unset( $data->$key );
    2579             } else {
    2580                 unset( $data[ $key ] );
    2581             }
    2582         } elseif ( is_array( $value ) || is_object( $value ) ) {
    2583             $new_value = rest_filter_response_by_context( $value, $check, $context );
    2584 
    2585             if ( is_object( $data ) ) {
    2586                 $data->$key = $new_value;
    2587             } else {
    2588                 $data[ $key ] = $new_value;
    2589             }
    2590         }
    2591     }
    2592 
    2593     return $data;
    2594 }
    2595 
    2596 /**
    2597  * Sets the "additionalProperties" to false by default for all object definitions in the schema.
    2598  *
    2599  * @since 5.5.0
    2600  * @since 5.6.0 Support the "patternProperties" keyword.
    2601  *
    2602  * @param array $schema The schema to modify.
    2603  * @return array The modified schema.
    2604  */
    2605 function rest_default_additional_properties_to_false( $schema ) {
    2606     $type = (array) $schema['type'];
    2607 
    2608     if ( in_array( 'object', $type, true ) ) {
    2609         if ( isset( $schema['properties'] ) ) {
    2610             foreach ( $schema['properties'] as $key => $child_schema ) {
    2611                 $schema['properties'][ $key ] = rest_default_additional_properties_to_false( $child_schema );
    2612             }
    2613         }
    2614 
    2615         if ( isset( $schema['patternProperties'] ) ) {
    2616             foreach ( $schema['patternProperties'] as $key => $child_schema ) {
    2617                 $schema['patternProperties'][ $key ] = rest_default_additional_properties_to_false( $child_schema );
    2618             }
    2619         }
    2620 
    2621         if ( ! isset( $schema['additionalProperties'] ) ) {
    2622             $schema['additionalProperties'] = false;
    2623         }
    2624     }
    2625 
    2626     if ( in_array( 'array', $type, true ) ) {
    2627         if ( isset( $schema['items'] ) ) {
    2628             $schema['items'] = rest_default_additional_properties_to_false( $schema['items'] );
    2629         }
    2630     }
    2631 
    2632     return $schema;
    2633 }
    2634 
    2635 /**
    2636  * Gets the REST API route for a post.
    2637  *
    2638  * @since 5.5.0
    2639  *
    2640  * @param int|WP_Post $post Post ID or post object.
    2641  * @return string The route path with a leading slash for the given post, or an empty string if there is not a route.
    2642  */
    2643 function rest_get_route_for_post( $post ) {
    2644     $post = get_post( $post );
    2645 
    2646     if ( ! $post instanceof WP_Post ) {
    2647         return '';
    2648     }
    2649 
    2650     $post_type = get_post_type_object( $post->post_type );
    2651     if ( ! $post_type ) {
    2652         return '';
    2653     }
    2654 
    2655     $controller = $post_type->get_rest_controller();
    2656     if ( ! $controller ) {
    2657         return '';
    2658     }
    2659 
    2660     $route = '';
    2661 
    2662     // The only two controllers that we can detect are the Attachments and Posts controllers.
    2663     if ( in_array( get_class( $controller ), array( 'WP_REST_Attachments_Controller', 'WP_REST_Posts_Controller' ), true ) ) {
    2664         $namespace = 'wp/v2';
    2665         $rest_base = ! empty( $post_type->rest_base ) ? $post_type->rest_base : $post_type->name;
    2666         $route     = sprintf( '/%s/%s/%d', $namespace, $rest_base, $post->ID );
    2667     }
    2668 
    2669     /**
    2670      * Filters the REST API route for a post.
    2671      *
    2672      * @since 5.5.0
    2673      *
    2674      * @param string  $route The route path.
    2675      * @param WP_Post $post  The post object.
    2676      */
    2677     return apply_filters( 'rest_route_for_post', $route, $post );
    2678 }
    2679 
    2680 /**
    2681  * Gets the REST API route for a term.
    2682  *
    2683  * @since 5.5.0
    2684  *
    2685  * @param int|WP_Term $term Term ID or term object.
    2686  * @return string The route path with a leading slash for the given term, or an empty string if there is not a route.
    2687  */
    2688 function rest_get_route_for_term( $term ) {
    2689     $term = get_term( $term );
    2690 
    2691     if ( ! $term instanceof WP_Term ) {
    2692         return '';
    2693     }
    2694 
    2695     $taxonomy = get_taxonomy( $term->taxonomy );
    2696     if ( ! $taxonomy ) {
    2697         return '';
    2698     }
    2699 
    2700     $controller = $taxonomy->get_rest_controller();
    2701     if ( ! $controller ) {
    2702         return '';
    2703     }
    2704 
    2705     $route = '';
    2706 
    2707     // The only controller that works is the Terms controller.
    2708     if ( $controller instanceof WP_REST_Terms_Controller ) {
    2709         $namespace = 'wp/v2';
    2710         $rest_base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name;
    2711         $route     = sprintf( '/%s/%s/%d', $namespace, $rest_base, $term->term_id );
    2712     }
    2713 
    2714     /**
    2715      * Filters the REST API route for a term.
    2716      *
    2717      * @since 5.5.0
    2718      *
    2719      * @param string  $route The route path.
    2720      * @param WP_Term $term  The term object.
    2721      */
    2722     return apply_filters( 'rest_route_for_term', $route, $term );
    2723 }
    2724 
    2725 /**
    2726  * Gets the REST route for the currently queried object.
    2727  *
    2728  * @since 5.5.0
    2729  *
    2730  * @return string The REST route of the resource, or an empty string if no resource identified.
    2731  */
    2732 function rest_get_queried_resource_route() {
    2733     if ( is_singular() ) {
    2734         $route = rest_get_route_for_post( get_queried_object() );
    2735     } elseif ( is_category() || is_tag() || is_tax() ) {
    2736         $route = rest_get_route_for_term( get_queried_object() );
    2737     } elseif ( is_author() ) {
    2738         $route = '/wp/v2/users/' . get_queried_object_id();
    2739     } else {
    2740         $route = '';
    2741     }
    2742 
    2743     /**
    2744      * Filters the REST route for the currently queried object.
    2745      *
    2746      * @since 5.5.0
    2747      *
    2748      * @param string $link The route with a leading slash, or an empty string.
    2749      */
    2750     return apply_filters( 'rest_queried_resource_route', $route );
    2751 }
    2752 
    2753 /**
    2754  * Retrieves an array of endpoint arguments from the item schema and endpoint method.
     1878 * Get all valid JSON schema properties.
    27551879 *
    27561880 * @since 5.6.0
    27571881 *
    2758  * @param array  $schema The full JSON schema for the endpoint.
    2759  * @param string $method Optional. HTTP method of the endpoint. The arguments for `CREATABLE` endpoints are
    2760  *                       checked for required values and may fall-back to a given default, this is not done
    2761  *                       on `EDITABLE` endpoints. Default WP_REST_Server::CREATABLE.
    2762  * @return array The endpoint arguments.
    2763  */
    2764 function rest_get_endpoint_args_for_schema( $schema, $method = WP_REST_Server::CREATABLE ) {
    2765 
    2766     $schema_properties       = ! empty( $schema['properties'] ) ? $schema['properties'] : array();
    2767     $endpoint_args           = array();
    2768     $valid_schema_properties = array(
     1882 * @return string[] All valid JSON schema properties.
     1883 */
     1884function rest_get_allowed_schema_keywords() {
     1885    return array(
     1886        'title',
     1887        'description',
     1888        'default',
    27691889        'type',
    27701890        'format',
     
    27901910        'oneOf',
    27911911    );
     1912}
     1913
     1914/**
     1915 * Validate a value based on a schema.
     1916 *
     1917 * @since 4.7.0
     1918 * @since 4.9.0 Support the "object" type.
     1919 * @since 5.2.0 Support validating "additionalProperties" against a schema.
     1920 * @since 5.3.0 Support multiple types.
     1921 * @since 5.4.0 Convert an empty string to an empty object.
     1922 * @since 5.5.0 Add the "uuid" and "hex-color" formats.
     1923 *              Support the "minLength", "maxLength" and "pattern" keywords for strings.
     1924 *              Support the "minItems", "maxItems" and "uniqueItems" keywords for arrays.
     1925 *              Validate required properties.
     1926 * @since 5.6.0 Support the "minProperties" and "maxProperties" keywords for objects.
     1927 *              Support the "multipleOf" keyword for numbers and integers.
     1928 *              Support the "patternProperties" keyword for objects.
     1929 *              Support the "anyOf" and "oneOf" keywords.
     1930 *
     1931 * @param mixed  $value The value to validate.
     1932 * @param array  $args  Schema array to use for validation.
     1933 * @param string $param The parameter name, used in error messages.
     1934 * @return true|WP_Error
     1935 */
     1936function rest_validate_value_from_schema( $value, $args, $param = '' ) {
     1937    if ( isset( $args['anyOf'] ) ) {
     1938        $matching_schema = rest_find_any_matching_schema( $value, $args, $param );
     1939        if ( is_wp_error( $matching_schema ) ) {
     1940            return $matching_schema;
     1941        }
     1942
     1943        if ( ! isset( $args['type'] ) && isset( $matching_schema['type'] ) ) {
     1944            $args['type'] = $matching_schema['type'];
     1945        }
     1946    }
     1947
     1948    if ( isset( $args['oneOf'] ) ) {
     1949        $matching_schema = rest_find_one_matching_schema( $value, $args, $param );
     1950        if ( is_wp_error( $matching_schema ) ) {
     1951            return $matching_schema;
     1952        }
     1953
     1954        if ( ! isset( $args['type'] ) && isset( $matching_schema['type'] ) ) {
     1955            $args['type'] = $matching_schema['type'];
     1956        }
     1957    }
     1958
     1959    $allowed_types = array( 'array', 'object', 'string', 'number', 'integer', 'boolean', 'null' );
     1960
     1961    if ( ! isset( $args['type'] ) ) {
     1962        /* translators: %s: Parameter. */
     1963        _doing_it_wrong( __FUNCTION__, sprintf( __( 'The "type" schema keyword for %s is required.' ), $param ), '5.5.0' );
     1964    }
     1965
     1966    if ( is_array( $args['type'] ) ) {
     1967        $best_type = rest_handle_multi_type_schema( $value, $args, $param );
     1968
     1969        if ( ! $best_type ) {
     1970            return new WP_Error(
     1971                'rest_invalid_type',
     1972                /* translators: 1: Parameter, 2: List of types. */
     1973                sprintf( __( '%1$s is not of type %2$s.' ), $param, implode( ',', $args['type'] ) ),
     1974                array( 'param' => $param )
     1975            );
     1976        }
     1977
     1978        $args['type'] = $best_type;
     1979    }
     1980
     1981    if ( ! in_array( $args['type'], $allowed_types, true ) ) {
     1982        _doing_it_wrong(
     1983            __FUNCTION__,
     1984            /* translators: 1: Parameter, 2: The list of allowed types. */
     1985            wp_sprintf( __( 'The "type" schema keyword for %1$s can only be one of the built-in types: %2$l.' ), $param, $allowed_types ),
     1986            '5.5.0'
     1987        );
     1988    }
     1989
     1990    if ( 'array' === $args['type'] ) {
     1991        if ( ! rest_is_array( $value ) ) {
     1992            return new WP_Error(
     1993                'rest_invalid_type',
     1994                /* translators: 1: Parameter, 2: Type name. */
     1995                sprintf( __( '%1$s is not of type %2$s.' ), $param, 'array' ),
     1996                array( 'param' => $param )
     1997            );
     1998        }
     1999
     2000        $value = rest_sanitize_array( $value );
     2001
     2002        if ( isset( $args['items'] ) ) {
     2003            foreach ( $value as $index => $v ) {
     2004                $is_valid = rest_validate_value_from_schema( $v, $args['items'], $param . '[' . $index . ']' );
     2005                if ( is_wp_error( $is_valid ) ) {
     2006                    return $is_valid;
     2007                }
     2008            }
     2009        }
     2010
     2011        if ( isset( $args['minItems'] ) && count( $value ) < $args['minItems'] ) {
     2012            /* translators: 1: Parameter, 2: Number. */
     2013            return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must contain at least %2$s items.' ), $param, number_format_i18n( $args['minItems'] ) ) );
     2014        }
     2015
     2016        if ( isset( $args['maxItems'] ) && count( $value ) > $args['maxItems'] ) {
     2017            /* translators: 1: Parameter, 2: Number. */
     2018            return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must contain at most %2$s items.' ), $param, number_format_i18n( $args['maxItems'] ) ) );
     2019        }
     2020
     2021        if ( ! empty( $args['uniqueItems'] ) && ! rest_validate_array_contains_unique_items( $value ) ) {
     2022            /* translators: 1: Parameter. */
     2023            return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s has duplicate items.' ), $param ) );
     2024        }
     2025    }
     2026
     2027    if ( 'object' === $args['type'] ) {
     2028        if ( ! rest_is_object( $value ) ) {
     2029            return new WP_Error(
     2030                'rest_invalid_type',
     2031                /* translators: 1: Parameter, 2: Type name. */
     2032                sprintf( __( '%1$s is not of type %2$s.' ), $param, 'object' ),
     2033                array( 'param' => $param )
     2034            );
     2035        }
     2036
     2037        $value = rest_sanitize_object( $value );
     2038
     2039        if ( isset( $args['required'] ) && is_array( $args['required'] ) ) { // schema version 4
     2040            foreach ( $args['required'] as $name ) {
     2041                if ( ! array_key_exists( $name, $value ) ) {
     2042                    /* translators: 1: Property of an object, 2: Parameter. */
     2043                    return new WP_Error( 'rest_property_required', sprintf( __( '%1$s is a required property of %2$s.' ), $name, $param ) );
     2044                }
     2045            }
     2046        } elseif ( isset( $args['properties'] ) ) { // schema version 3
     2047            foreach ( $args['properties'] as $name => $property ) {
     2048                if ( isset( $property['required'] ) && true === $property['required'] && ! array_key_exists( $name, $value ) ) {
     2049                    /* translators: 1: Property of an object, 2: Parameter. */
     2050                    return new WP_Error( 'rest_property_required', sprintf( __( '%1$s is a required property of %2$s.' ), $name, $param ) );
     2051                }
     2052            }
     2053        }
     2054
     2055        foreach ( $value as $property => $v ) {
     2056            if ( isset( $args['properties'][ $property ] ) ) {
     2057                $is_valid = rest_validate_value_from_schema( $v, $args['properties'][ $property ], $param . '[' . $property . ']' );
     2058                if ( is_wp_error( $is_valid ) ) {
     2059                    return $is_valid;
     2060                }
     2061                continue;
     2062            }
     2063
     2064            $pattern_property_schema = rest_find_matching_pattern_property_schema( $property, $args );
     2065            if ( null !== $pattern_property_schema ) {
     2066                $is_valid = rest_validate_value_from_schema( $v, $pattern_property_schema, $param . '[' . $property . ']' );
     2067                if ( is_wp_error( $is_valid ) ) {
     2068                    return $is_valid;
     2069                }
     2070                continue;
     2071            }
     2072
     2073            if ( isset( $args['additionalProperties'] ) ) {
     2074                if ( false === $args['additionalProperties'] ) {
     2075                    /* translators: %s: Property of an object. */
     2076                    return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not a valid property of Object.' ), $property ) );
     2077                }
     2078
     2079                if ( is_array( $args['additionalProperties'] ) ) {
     2080                    $is_valid = rest_validate_value_from_schema( $v, $args['additionalProperties'], $param . '[' . $property . ']' );
     2081                    if ( is_wp_error( $is_valid ) ) {
     2082                        return $is_valid;
     2083                    }
     2084                }
     2085            }
     2086        }
     2087
     2088        if ( isset( $args['minProperties'] ) && count( $value ) < $args['minProperties'] ) {
     2089            /* translators: 1: Parameter, 2: Number. */
     2090            return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must contain at least %2$s properties.' ), $param, number_format_i18n( $args['minProperties'] ) ) );
     2091        }
     2092
     2093        if ( isset( $args['maxProperties'] ) && count( $value ) > $args['maxProperties'] ) {
     2094            /* translators: 1: Parameter, 2: Number. */
     2095            return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must contain at most %2$s properties.' ), $param, number_format_i18n( $args['maxProperties'] ) ) );
     2096        }
     2097    }
     2098
     2099    if ( 'null' === $args['type'] ) {
     2100        if ( null !== $value ) {
     2101            return new WP_Error(
     2102                'rest_invalid_type',
     2103                /* translators: 1: Parameter, 2: Type name. */
     2104                sprintf( __( '%1$s is not of type %2$s.' ), $param, 'null' ),
     2105                array( 'param' => $param )
     2106            );
     2107        }
     2108
     2109        return true;
     2110    }
     2111
     2112    if ( ! empty( $args['enum'] ) ) {
     2113        if ( ! in_array( $value, $args['enum'], true ) ) {
     2114            /* translators: 1: Parameter, 2: List of valid values. */
     2115            return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not one of %2$s.' ), $param, implode( ', ', $args['enum'] ) ) );
     2116        }
     2117    }
     2118
     2119    if ( in_array( $args['type'], array( 'integer', 'number' ), true ) ) {
     2120        if ( ! is_numeric( $value ) ) {
     2121            return new WP_Error(
     2122                'rest_invalid_type',
     2123                /* translators: 1: Parameter, 2: Type name. */
     2124                sprintf( __( '%1$s is not of type %2$s.' ), $param, $args['type'] ),
     2125                array( 'param' => $param )
     2126            );
     2127        }
     2128
     2129        if ( isset( $args['multipleOf'] ) && fmod( $value, $args['multipleOf'] ) !== 0.0 ) {
     2130            /* translators: 1: Parameter, 2: Multiplier. */
     2131            return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be a multiple of %2$s.' ), $param, $args['multipleOf'] ) );
     2132        }
     2133    }
     2134
     2135    if ( 'integer' === $args['type'] && ! rest_is_integer( $value ) ) {
     2136        return new WP_Error(
     2137            'rest_invalid_type',
     2138            /* translators: 1: Parameter, 2: Type name. */
     2139            sprintf( __( '%1$s is not of type %2$s.' ), $param, 'integer' ),
     2140            array( 'param' => $param )
     2141        );
     2142    }
     2143
     2144    if ( 'boolean' === $args['type'] && ! rest_is_boolean( $value ) ) {
     2145        return new WP_Error(
     2146            'rest_invalid_type',
     2147            /* translators: 1: Parameter, 2: Type name. */
     2148            sprintf( __( '%1$s is not of type %2$s.' ), $param, 'boolean' ),
     2149            array( 'param' => $param )
     2150        );
     2151    }
     2152
     2153    if ( 'string' === $args['type'] ) {
     2154        if ( ! is_string( $value ) ) {
     2155            return new WP_Error(
     2156                'rest_invalid_type',
     2157                /* translators: 1: Parameter, 2: Type name. */
     2158                sprintf( __( '%1$s is not of type %2$s.' ), $param, 'string' ),
     2159                array( 'param' => $param )
     2160            );
     2161        }
     2162
     2163        if ( isset( $args['minLength'] ) && mb_strlen( $value ) < $args['minLength'] ) {
     2164            return new WP_Error(
     2165                'rest_invalid_param',
     2166                sprintf(
     2167                    /* translators: 1: Parameter, 2: Number of characters. */
     2168                    _n( '%1$s must be at least %2$s character long.', '%1$s must be at least %2$s characters long.', $args['minLength'] ),
     2169                    $param,
     2170                    number_format_i18n( $args['minLength'] )
     2171                )
     2172            );
     2173        }
     2174
     2175        if ( isset( $args['maxLength'] ) && mb_strlen( $value ) > $args['maxLength'] ) {
     2176            return new WP_Error(
     2177                'rest_invalid_param',
     2178                sprintf(
     2179                    /* translators: 1: Parameter, 2: Number of characters. */
     2180                    _n( '%1$s must be at most %2$s character long.', '%1$s must be at most %2$s characters long.', $args['maxLength'] ),
     2181                    $param,
     2182                    number_format_i18n( $args['maxLength'] )
     2183                )
     2184            );
     2185        }
     2186
     2187        if ( isset( $args['pattern'] ) && ! rest_validate_json_schema_pattern( $args['pattern'], $value ) ) {
     2188            /* translators: 1: Parameter, 2: Pattern. */
     2189            return new WP_Error( 'rest_invalid_pattern', sprintf( __( '%1$s does not match pattern %2$s.' ), $param, $args['pattern'] ) );
     2190        }
     2191    }
     2192
     2193    // The "format" keyword should only be applied to strings. However, for backward compatibility,
     2194    // we allow the "format" keyword if the type keyword was not specified, or was set to an invalid value.
     2195    if ( isset( $args['format'] )
     2196        && ( ! isset( $args['type'] ) || 'string' === $args['type'] || ! in_array( $args['type'], $allowed_types, true ) )
     2197    ) {
     2198        switch ( $args['format'] ) {
     2199            case 'hex-color':
     2200                if ( ! rest_parse_hex_color( $value ) ) {
     2201                    return new WP_Error( 'rest_invalid_hex_color', __( 'Invalid hex color.' ) );
     2202                }
     2203                break;
     2204
     2205            case 'date-time':
     2206                if ( ! rest_parse_date( $value ) ) {
     2207                    return new WP_Error( 'rest_invalid_date', __( 'Invalid date.' ) );
     2208                }
     2209                break;
     2210
     2211            case 'email':
     2212                if ( ! is_email( $value ) ) {
     2213                    return new WP_Error( 'rest_invalid_email', __( 'Invalid email address.' ) );
     2214                }
     2215                break;
     2216            case 'ip':
     2217                if ( ! rest_is_ip_address( $value ) ) {
     2218                    /* translators: %s: IP address. */
     2219                    return new WP_Error( 'rest_invalid_param', sprintf( __( '%s is not a valid IP address.' ), $param ) );
     2220                }
     2221                break;
     2222            case 'uuid':
     2223                if ( ! wp_is_uuid( $value ) ) {
     2224                    /* translators: %s: The name of a JSON field expecting a valid UUID. */
     2225                    return new WP_Error( 'rest_invalid_uuid', sprintf( __( '%s is not a valid UUID.' ), $param ) );
     2226                }
     2227                break;
     2228        }
     2229    }
     2230
     2231    if ( in_array( $args['type'], array( 'number', 'integer' ), true ) && ( isset( $args['minimum'] ) || isset( $args['maximum'] ) ) ) {
     2232        if ( isset( $args['minimum'] ) && ! isset( $args['maximum'] ) ) {
     2233            if ( ! empty( $args['exclusiveMinimum'] ) && $value <= $args['minimum'] ) {
     2234                /* translators: 1: Parameter, 2: Minimum number. */
     2235                return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be greater than %2$d' ), $param, $args['minimum'] ) );
     2236            } elseif ( empty( $args['exclusiveMinimum'] ) && $value < $args['minimum'] ) {
     2237                /* translators: 1: Parameter, 2: Minimum number. */
     2238                return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be greater than or equal to %2$d' ), $param, $args['minimum'] ) );
     2239            }
     2240        } elseif ( isset( $args['maximum'] ) && ! isset( $args['minimum'] ) ) {
     2241            if ( ! empty( $args['exclusiveMaximum'] ) && $value >= $args['maximum'] ) {
     2242                /* translators: 1: Parameter, 2: Maximum number. */
     2243                return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be less than %2$d' ), $param, $args['maximum'] ) );
     2244            } elseif ( empty( $args['exclusiveMaximum'] ) && $value > $args['maximum'] ) {
     2245                /* translators: 1: Parameter, 2: Maximum number. */
     2246                return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be less than or equal to %2$d' ), $param, $args['maximum'] ) );
     2247            }
     2248        } elseif ( isset( $args['maximum'] ) && isset( $args['minimum'] ) ) {
     2249            if ( ! empty( $args['exclusiveMinimum'] ) && ! empty( $args['exclusiveMaximum'] ) ) {
     2250                if ( $value >= $args['maximum'] || $value <= $args['minimum'] ) {
     2251                    /* translators: 1: Parameter, 2: Minimum number, 3: Maximum number. */
     2252                    return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be between %2$d (exclusive) and %3$d (exclusive)' ), $param, $args['minimum'], $args['maximum'] ) );
     2253                }
     2254            } elseif ( empty( $args['exclusiveMinimum'] ) && ! empty( $args['exclusiveMaximum'] ) ) {
     2255                if ( $value >= $args['maximum'] || $value < $args['minimum'] ) {
     2256                    /* translators: 1: Parameter, 2: Minimum number, 3: Maximum number. */
     2257                    return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be between %2$d (inclusive) and %3$d (exclusive)' ), $param, $args['minimum'], $args['maximum'] ) );
     2258                }
     2259            } elseif ( ! empty( $args['exclusiveMinimum'] ) && empty( $args['exclusiveMaximum'] ) ) {
     2260                if ( $value > $args['maximum'] || $value <= $args['minimum'] ) {
     2261                    /* translators: 1: Parameter, 2: Minimum number, 3: Maximum number. */
     2262                    return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be between %2$d (exclusive) and %3$d (inclusive)' ), $param, $args['minimum'], $args['maximum'] ) );
     2263                }
     2264            } elseif ( empty( $args['exclusiveMinimum'] ) && empty( $args['exclusiveMaximum'] ) ) {
     2265                if ( $value > $args['maximum'] || $value < $args['minimum'] ) {
     2266                    /* translators: 1: Parameter, 2: Minimum number, 3: Maximum number. */
     2267                    return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be between %2$d (inclusive) and %3$d (inclusive)' ), $param, $args['minimum'], $args['maximum'] ) );
     2268                }
     2269            }
     2270        }
     2271    }
     2272
     2273    return true;
     2274}
     2275
     2276/**
     2277 * Sanitize a value based on a schema.
     2278 *
     2279 * @since 4.7.0
     2280 * @since 5.5.0 Added the `$param` parameter.
     2281 * @since 5.6.0 Support the "anyOf" and "oneOf" keywords.
     2282 *
     2283 * @param mixed  $value The value to sanitize.
     2284 * @param array  $args  Schema array to use for sanitization.
     2285 * @param string $param The parameter name, used in error messages.
     2286 * @return mixed|WP_Error The sanitized value or a WP_Error instance if the value cannot be safely sanitized.
     2287 */
     2288function rest_sanitize_value_from_schema( $value, $args, $param = '' ) {
     2289    if ( isset( $args['anyOf'] ) ) {
     2290        $matching_schema = rest_find_any_matching_schema( $value, $args, $param );
     2291        if ( is_wp_error( $matching_schema ) ) {
     2292            return $matching_schema;
     2293        }
     2294
     2295        if ( ! isset( $args['type'] ) ) {
     2296            $args['type'] = $matching_schema['type'];
     2297        }
     2298
     2299        $value = rest_sanitize_value_from_schema( $value, $matching_schema, $param );
     2300    }
     2301
     2302    if ( isset( $args['oneOf'] ) ) {
     2303        $matching_schema = rest_find_one_matching_schema( $value, $args, $param );
     2304        if ( is_wp_error( $matching_schema ) ) {
     2305            return $matching_schema;
     2306        }
     2307
     2308        if ( ! isset( $args['type'] ) ) {
     2309            $args['type'] = $matching_schema['type'];
     2310        }
     2311
     2312        $value = rest_sanitize_value_from_schema( $value, $matching_schema, $param );
     2313    }
     2314
     2315    $allowed_types = array( 'array', 'object', 'string', 'number', 'integer', 'boolean', 'null' );
     2316
     2317    if ( ! isset( $args['type'] ) ) {
     2318        /* translators: %s: Parameter. */
     2319        _doing_it_wrong( __FUNCTION__, sprintf( __( 'The "type" schema keyword for %s is required.' ), $param ), '5.5.0' );
     2320    }
     2321
     2322    if ( is_array( $args['type'] ) ) {
     2323        $best_type = rest_handle_multi_type_schema( $value, $args, $param );
     2324
     2325        if ( ! $best_type ) {
     2326            return null;
     2327        }
     2328
     2329        $args['type'] = $best_type;
     2330    }
     2331
     2332    if ( ! in_array( $args['type'], $allowed_types, true ) ) {
     2333        _doing_it_wrong(
     2334            __FUNCTION__,
     2335            /* translators: 1: Parameter, 2: The list of allowed types. */
     2336            wp_sprintf( __( 'The "type" schema keyword for %1$s can only be one of the built-in types: %2$l.' ), $param, $allowed_types ),
     2337            '5.5.0'
     2338        );
     2339    }
     2340
     2341    if ( 'array' === $args['type'] ) {
     2342        $value = rest_sanitize_array( $value );
     2343
     2344        if ( ! empty( $args['items'] ) ) {
     2345            foreach ( $value as $index => $v ) {
     2346                $value[ $index ] = rest_sanitize_value_from_schema( $v, $args['items'], $param . '[' . $index . ']' );
     2347            }
     2348        }
     2349
     2350        if ( ! empty( $args['uniqueItems'] ) && ! rest_validate_array_contains_unique_items( $value ) ) {
     2351            /* translators: 1: Parameter. */
     2352            return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s has duplicate items.' ), $param ) );
     2353        }
     2354
     2355        return $value;
     2356    }
     2357
     2358    if ( 'object' === $args['type'] ) {
     2359        $value = rest_sanitize_object( $value );
     2360
     2361        foreach ( $value as $property => $v ) {
     2362            if ( isset( $args['properties'][ $property ] ) ) {
     2363                $value[ $property ] = rest_sanitize_value_from_schema( $v, $args['properties'][ $property ], $param . '[' . $property . ']' );
     2364                continue;
     2365            }
     2366
     2367            $pattern_property_schema = rest_find_matching_pattern_property_schema( $property, $args );
     2368            if ( null !== $pattern_property_schema ) {
     2369                $value[ $property ] = rest_sanitize_value_from_schema( $v, $pattern_property_schema, $param . '[' . $property . ']' );
     2370                continue;
     2371            }
     2372
     2373            if ( isset( $args['additionalProperties'] ) ) {
     2374                if ( false === $args['additionalProperties'] ) {
     2375                    unset( $value[ $property ] );
     2376                } elseif ( is_array( $args['additionalProperties'] ) ) {
     2377                    $value[ $property ] = rest_sanitize_value_from_schema( $v, $args['additionalProperties'], $param . '[' . $property . ']' );
     2378                }
     2379            }
     2380        }
     2381
     2382        return $value;
     2383    }
     2384
     2385    if ( 'null' === $args['type'] ) {
     2386        return null;
     2387    }
     2388
     2389    if ( 'integer' === $args['type'] ) {
     2390        return (int) $value;
     2391    }
     2392
     2393    if ( 'number' === $args['type'] ) {
     2394        return (float) $value;
     2395    }
     2396
     2397    if ( 'boolean' === $args['type'] ) {
     2398        return rest_sanitize_boolean( $value );
     2399    }
     2400
     2401    // This behavior matches rest_validate_value_from_schema().
     2402    if ( isset( $args['format'] )
     2403        && ( ! isset( $args['type'] ) || 'string' === $args['type'] || ! in_array( $args['type'], $allowed_types, true ) )
     2404    ) {
     2405        switch ( $args['format'] ) {
     2406            case 'hex-color':
     2407                return (string) sanitize_hex_color( $value );
     2408
     2409            case 'date-time':
     2410                return sanitize_text_field( $value );
     2411
     2412            case 'email':
     2413                // sanitize_email() validates, which would be unexpected.
     2414                return sanitize_text_field( $value );
     2415
     2416            case 'uri':
     2417                return esc_url_raw( $value );
     2418
     2419            case 'ip':
     2420                return sanitize_text_field( $value );
     2421
     2422            case 'uuid':
     2423                return sanitize_text_field( $value );
     2424        }
     2425    }
     2426
     2427    if ( 'string' === $args['type'] ) {
     2428        return (string) $value;
     2429    }
     2430
     2431    return $value;
     2432}
     2433
     2434/**
     2435 * Append result of internal request to REST API for purpose of preloading data to be attached to a page.
     2436 * Expected to be called in the context of `array_reduce`.
     2437 *
     2438 * @since 5.0.0
     2439 *
     2440 * @param array  $memo Reduce accumulator.
     2441 * @param string $path REST API path to preload.
     2442 * @return array Modified reduce accumulator.
     2443 */
     2444function rest_preload_api_request( $memo, $path ) {
     2445    // array_reduce() doesn't support passing an array in PHP 5.2,
     2446    // so we need to make sure we start with one.
     2447    if ( ! is_array( $memo ) ) {
     2448        $memo = array();
     2449    }
     2450
     2451    if ( empty( $path ) ) {
     2452        return $memo;
     2453    }
     2454
     2455    $method = 'GET';
     2456    if ( is_array( $path ) && 2 === count( $path ) ) {
     2457        $method = end( $path );
     2458        $path   = reset( $path );
     2459
     2460        if ( ! in_array( $method, array( 'GET', 'OPTIONS' ), true ) ) {
     2461            $method = 'GET';
     2462        }
     2463    }
     2464
     2465    $path_parts = parse_url( $path );
     2466    if ( false === $path_parts ) {
     2467        return $memo;
     2468    }
     2469
     2470    $request = new WP_REST_Request( $method, $path_parts['path'] );
     2471    if ( ! empty( $path_parts['query'] ) ) {
     2472        parse_str( $path_parts['query'], $query_params );
     2473        $request->set_query_params( $query_params );
     2474    }
     2475
     2476    $response = rest_do_request( $request );
     2477    if ( 200 === $response->status ) {
     2478        $server = rest_get_server();
     2479        $data   = (array) $response->get_data();
     2480        $links  = $server::get_compact_response_links( $response );
     2481        if ( ! empty( $links ) ) {
     2482            $data['_links'] = $links;
     2483        }
     2484
     2485        if ( 'OPTIONS' === $method ) {
     2486            $response = rest_send_allow_header( $response, $server, $request );
     2487
     2488            $memo[ $method ][ $path ] = array(
     2489                'body'    => $data,
     2490                'headers' => $response->headers,
     2491            );
     2492        } else {
     2493            $memo[ $path ] = array(
     2494                'body'    => $data,
     2495                'headers' => $response->headers,
     2496            );
     2497        }
     2498    }
     2499
     2500    return $memo;
     2501}
     2502
     2503/**
     2504 * Parses the "_embed" parameter into the list of resources to embed.
     2505 *
     2506 * @since 5.4.0
     2507 *
     2508 * @param string|array $embed Raw "_embed" parameter value.
     2509 * @return true|string[] Either true to embed all embeds, or a list of relations to embed.
     2510 */
     2511function rest_parse_embed_param( $embed ) {
     2512    if ( ! $embed || 'true' === $embed || '1' === $embed ) {
     2513        return true;
     2514    }
     2515
     2516    $rels = wp_parse_list( $embed );
     2517
     2518    if ( ! $rels ) {
     2519        return true;
     2520    }
     2521
     2522    return $rels;
     2523}
     2524
     2525/**
     2526 * Filters the response to remove any fields not available in the given context.
     2527 *
     2528 * @since 5.5.0
     2529 * @since 5.6.0 Support the "patternProperties" keyword for objects.
     2530 *              Support the "anyOf" and "oneOf" keywords.
     2531 *
     2532 * @param array|object $data    The response data to modify.
     2533 * @param array        $schema  The schema for the endpoint used to filter the response.
     2534 * @param string       $context The requested context.
     2535 * @return array|object The filtered response data.
     2536 */
     2537function rest_filter_response_by_context( $data, $schema, $context ) {
     2538    if ( isset( $schema['anyOf'] ) ) {
     2539        $matching_schema = rest_find_any_matching_schema( $data, $schema, '' );
     2540        if ( ! is_wp_error( $matching_schema ) ) {
     2541            if ( ! isset( $schema['type'] ) ) {
     2542                $schema['type'] = $matching_schema['type'];
     2543            }
     2544
     2545            $data = rest_filter_response_by_context( $data, $matching_schema, $context );
     2546        }
     2547    }
     2548
     2549    if ( isset( $schema['oneOf'] ) ) {
     2550        $matching_schema = rest_find_one_matching_schema( $data, $schema, '', true );
     2551        if ( ! is_wp_error( $matching_schema ) ) {
     2552            if ( ! isset( $schema['type'] ) ) {
     2553                $schema['type'] = $matching_schema['type'];
     2554            }
     2555
     2556            $data = rest_filter_response_by_context( $data, $matching_schema, $context );
     2557        }
     2558    }
     2559
     2560    if ( ! is_array( $data ) && ! is_object( $data ) ) {
     2561        return $data;
     2562    }
     2563
     2564    if ( isset( $schema['type'] ) ) {
     2565        $type = $schema['type'];
     2566    } elseif ( isset( $schema['properties'] ) ) {
     2567        $type = 'object'; // Back compat if a developer accidentally omitted the type.
     2568    } else {
     2569        return $data;
     2570    }
     2571
     2572    $is_array_type  = 'array' === $type || ( is_array( $type ) && in_array( 'array', $type, true ) );
     2573    $is_object_type = 'object' === $type || ( is_array( $type ) && in_array( 'object', $type, true ) );
     2574
     2575    if ( $is_array_type && $is_object_type ) {
     2576        if ( rest_is_array( $data ) ) {
     2577            $is_object_type = false;
     2578        } else {
     2579            $is_array_type = false;
     2580        }
     2581    }
     2582
     2583    $has_additional_properties = $is_object_type && isset( $schema['additionalProperties'] ) && is_array( $schema['additionalProperties'] );
     2584
     2585    foreach ( $data as $key => $value ) {
     2586        $check = array();
     2587
     2588        if ( $is_array_type ) {
     2589            $check = isset( $schema['items'] ) ? $schema['items'] : array();
     2590        } elseif ( $is_object_type ) {
     2591            if ( isset( $schema['properties'][ $key ] ) ) {
     2592                $check = $schema['properties'][ $key ];
     2593            } else {
     2594                $pattern_property_schema = rest_find_matching_pattern_property_schema( $key, $schema );
     2595                if ( null !== $pattern_property_schema ) {
     2596                    $check = $pattern_property_schema;
     2597                } elseif ( $has_additional_properties ) {
     2598                    $check = $schema['additionalProperties'];
     2599                }
     2600            }
     2601        }
     2602
     2603        if ( ! isset( $check['context'] ) ) {
     2604            continue;
     2605        }
     2606
     2607        if ( ! in_array( $context, $check['context'], true ) ) {
     2608            if ( $is_array_type ) {
     2609                // All array items share schema, so there's no need to check each one.
     2610                $data = array();
     2611                break;
     2612            }
     2613
     2614            if ( is_object( $data ) ) {
     2615                unset( $data->$key );
     2616            } else {
     2617                unset( $data[ $key ] );
     2618            }
     2619        } elseif ( is_array( $value ) || is_object( $value ) ) {
     2620            $new_value = rest_filter_response_by_context( $value, $check, $context );
     2621
     2622            if ( is_object( $data ) ) {
     2623                $data->$key = $new_value;
     2624            } else {
     2625                $data[ $key ] = $new_value;
     2626            }
     2627        }
     2628    }
     2629
     2630    return $data;
     2631}
     2632
     2633/**
     2634 * Sets the "additionalProperties" to false by default for all object definitions in the schema.
     2635 *
     2636 * @since 5.5.0
     2637 * @since 5.6.0 Support the "patternProperties" keyword.
     2638 *
     2639 * @param array $schema The schema to modify.
     2640 * @return array The modified schema.
     2641 */
     2642function rest_default_additional_properties_to_false( $schema ) {
     2643    $type = (array) $schema['type'];
     2644
     2645    if ( in_array( 'object', $type, true ) ) {
     2646        if ( isset( $schema['properties'] ) ) {
     2647            foreach ( $schema['properties'] as $key => $child_schema ) {
     2648                $schema['properties'][ $key ] = rest_default_additional_properties_to_false( $child_schema );
     2649            }
     2650        }
     2651
     2652        if ( isset( $schema['patternProperties'] ) ) {
     2653            foreach ( $schema['patternProperties'] as $key => $child_schema ) {
     2654                $schema['patternProperties'][ $key ] = rest_default_additional_properties_to_false( $child_schema );
     2655            }
     2656        }
     2657
     2658        if ( ! isset( $schema['additionalProperties'] ) ) {
     2659            $schema['additionalProperties'] = false;
     2660        }
     2661    }
     2662
     2663    if ( in_array( 'array', $type, true ) ) {
     2664        if ( isset( $schema['items'] ) ) {
     2665            $schema['items'] = rest_default_additional_properties_to_false( $schema['items'] );
     2666        }
     2667    }
     2668
     2669    return $schema;
     2670}
     2671
     2672/**
     2673 * Gets the REST API route for a post.
     2674 *
     2675 * @since 5.5.0
     2676 *
     2677 * @param int|WP_Post $post Post ID or post object.
     2678 * @return string The route path with a leading slash for the given post, or an empty string if there is not a route.
     2679 */
     2680function rest_get_route_for_post( $post ) {
     2681    $post = get_post( $post );
     2682
     2683    if ( ! $post instanceof WP_Post ) {
     2684        return '';
     2685    }
     2686
     2687    $post_type = get_post_type_object( $post->post_type );
     2688    if ( ! $post_type ) {
     2689        return '';
     2690    }
     2691
     2692    $controller = $post_type->get_rest_controller();
     2693    if ( ! $controller ) {
     2694        return '';
     2695    }
     2696
     2697    $route = '';
     2698
     2699    // The only two controllers that we can detect are the Attachments and Posts controllers.
     2700    if ( in_array( get_class( $controller ), array( 'WP_REST_Attachments_Controller', 'WP_REST_Posts_Controller' ), true ) ) {
     2701        $namespace = 'wp/v2';
     2702        $rest_base = ! empty( $post_type->rest_base ) ? $post_type->rest_base : $post_type->name;
     2703        $route     = sprintf( '/%s/%s/%d', $namespace, $rest_base, $post->ID );
     2704    }
     2705
     2706    /**
     2707     * Filters the REST API route for a post.
     2708     *
     2709     * @since 5.5.0
     2710     *
     2711     * @param string  $route The route path.
     2712     * @param WP_Post $post  The post object.
     2713     */
     2714    return apply_filters( 'rest_route_for_post', $route, $post );
     2715}
     2716
     2717/**
     2718 * Gets the REST API route for a term.
     2719 *
     2720 * @since 5.5.0
     2721 *
     2722 * @param int|WP_Term $term Term ID or term object.
     2723 * @return string The route path with a leading slash for the given term, or an empty string if there is not a route.
     2724 */
     2725function rest_get_route_for_term( $term ) {
     2726    $term = get_term( $term );
     2727
     2728    if ( ! $term instanceof WP_Term ) {
     2729        return '';
     2730    }
     2731
     2732    $taxonomy = get_taxonomy( $term->taxonomy );
     2733    if ( ! $taxonomy ) {
     2734        return '';
     2735    }
     2736
     2737    $controller = $taxonomy->get_rest_controller();
     2738    if ( ! $controller ) {
     2739        return '';
     2740    }
     2741
     2742    $route = '';
     2743
     2744    // The only controller that works is the Terms controller.
     2745    if ( $controller instanceof WP_REST_Terms_Controller ) {
     2746        $namespace = 'wp/v2';
     2747        $rest_base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name;
     2748        $route     = sprintf( '/%s/%s/%d', $namespace, $rest_base, $term->term_id );
     2749    }
     2750
     2751    /**
     2752     * Filters the REST API route for a term.
     2753     *
     2754     * @since 5.5.0
     2755     *
     2756     * @param string  $route The route path.
     2757     * @param WP_Term $term  The term object.
     2758     */
     2759    return apply_filters( 'rest_route_for_term', $route, $term );
     2760}
     2761
     2762/**
     2763 * Gets the REST route for the currently queried object.
     2764 *
     2765 * @since 5.5.0
     2766 *
     2767 * @return string The REST route of the resource, or an empty string if no resource identified.
     2768 */
     2769function rest_get_queried_resource_route() {
     2770    if ( is_singular() ) {
     2771        $route = rest_get_route_for_post( get_queried_object() );
     2772    } elseif ( is_category() || is_tag() || is_tax() ) {
     2773        $route = rest_get_route_for_term( get_queried_object() );
     2774    } elseif ( is_author() ) {
     2775        $route = '/wp/v2/users/' . get_queried_object_id();
     2776    } else {
     2777        $route = '';
     2778    }
     2779
     2780    /**
     2781     * Filters the REST route for the currently queried object.
     2782     *
     2783     * @since 5.5.0
     2784     *
     2785     * @param string $link The route with a leading slash, or an empty string.
     2786     */
     2787    return apply_filters( 'rest_queried_resource_route', $route );
     2788}
     2789
     2790/**
     2791 * Retrieves an array of endpoint arguments from the item schema and endpoint method.
     2792 *
     2793 * @since 5.6.0
     2794 *
     2795 * @param array  $schema The full JSON schema for the endpoint.
     2796 * @param string $method Optional. HTTP method of the endpoint. The arguments for `CREATABLE` endpoints are
     2797 *                       checked for required values and may fall-back to a given default, this is not done
     2798 *                       on `EDITABLE` endpoints. Default WP_REST_Server::CREATABLE.
     2799 * @return array The endpoint arguments.
     2800 */
     2801function rest_get_endpoint_args_for_schema( $schema, $method = WP_REST_Server::CREATABLE ) {
     2802
     2803    $schema_properties       = ! empty( $schema['properties'] ) ? $schema['properties'] : array();
     2804    $endpoint_args           = array();
     2805    $valid_schema_properties = rest_get_allowed_schema_keywords();
     2806    $valid_schema_properties = array_diff( $valid_schema_properties, array( 'default', 'required' ) );
    27922807
    27932808    foreach ( $schema_properties as $field_id => $params ) {
     
    28022817            'sanitize_callback' => 'rest_sanitize_request_arg',
    28032818        );
    2804 
    2805         if ( isset( $params['description'] ) ) {
    2806             $endpoint_args[ $field_id ]['description'] = $params['description'];
    2807         }
    28082819
    28092820        if ( WP_REST_Server::CREATABLE === $method && isset( $params['default'] ) ) {
  • trunk/src/wp-includes/rest-api/class-wp-rest-server.php

    r49252 r49257  
    13811381        }
    13821382
     1383        $allowed_schema_keywords = array_flip( rest_get_allowed_schema_keywords() );
     1384
    13831385        $route = preg_replace( '#\(\?P<(\w+?)>.*?\)#', '{$1}', $route );
    13841386
     
    13981400
    13991401                foreach ( $callback['args'] as $key => $opts ) {
    1400                     $arg_data = array(
    1401                         'required' => ! empty( $opts['required'] ),
    1402                     );
    1403                     if ( isset( $opts['default'] ) ) {
    1404                         $arg_data['default'] = $opts['default'];
    1405                     }
    1406                     if ( isset( $opts['enum'] ) ) {
    1407                         $arg_data['enum'] = $opts['enum'];
    1408                     }
    1409                     if ( isset( $opts['description'] ) ) {
    1410                         $arg_data['description'] = $opts['description'];
    1411                     }
    1412                     if ( isset( $opts['type'] ) ) {
    1413                         $arg_data['type'] = $opts['type'];
    1414                     }
    1415                     if ( isset( $opts['items'] ) ) {
    1416                         $arg_data['items'] = $opts['items'];
    1417                     }
     1402                    $arg_data             = array_intersect_key( $opts, $allowed_schema_keywords );
     1403                    $arg_data['required'] = ! empty( $opts['required'] );
     1404
    14181405                    $endpoint_data['args'][ $key ] = $arg_data;
    14191406                }
  • trunk/tests/phpunit/tests/rest-api/rest-server.php

    r49252 r49257  
    19321932    }
    19331933
     1934    /**
     1935     * @ticket 51020
     1936     */
     1937    public function test_get_data_for_route_includes_permitted_schema_keywords() {
     1938        $keywords = array(
     1939            'title'                => 'Hi',
     1940            'description'          => 'World',
     1941            'type'                 => 'string',
     1942            'default'              => 0,
     1943            'format'               => 'uri',
     1944            'enum'                 => array( 'https://example.org' ),
     1945            'items'                => array( 'type' => 'string' ),
     1946            'properties'           => array( 'a' => array( 'type' => 'string' ) ),
     1947            'additionalProperties' => false,
     1948            'patternProperties'    => array( '\d' => array( 'type' => 'string' ) ),
     1949            'minProperties'        => 1,
     1950            'maxProperties'        => 5,
     1951            'minimum'              => 1,
     1952            'maximum'              => 5,
     1953            'exclusiveMinimum'     => true,
     1954            'exclusiveMaximum'     => false,
     1955            'multipleOf'           => 2,
     1956            'minLength'            => 1,
     1957            'maxLength'            => 5,
     1958            'pattern'              => '\d',
     1959            'minItems'             => 1,
     1960            'maxItems'             => 5,
     1961            'uniqueItems'          => true,
     1962            'anyOf'                => array(
     1963                array( 'type' => 'string' ),
     1964                array( 'type' => 'integer' ),
     1965            ),
     1966            'oneOf'                => array(
     1967                array( 'type' => 'string' ),
     1968                array( 'type' => 'integer' ),
     1969            ),
     1970        );
     1971
     1972        $param            = $keywords;
     1973        $param['invalid'] = true;
     1974
     1975        $expected             = $keywords;
     1976        $expected['required'] = false;
     1977
     1978        register_rest_route(
     1979            'test-ns/v1',
     1980            '/test',
     1981            array(
     1982                'methods'             => 'POST',
     1983                'callback'            => static function () {
     1984                    return new WP_REST_Response( 'test' );
     1985                },
     1986                'permission_callback' => '__return_true',
     1987                'args'                => array(
     1988                    'param' => $param,
     1989                ),
     1990            )
     1991        );
     1992
     1993        $response = rest_do_request( new WP_REST_Request( 'OPTIONS', '/test-ns/v1/test' ) );
     1994        $args     = $response->get_data()['endpoints'][0]['args'];
     1995
     1996        $this->assertSameSetsWithIndex( $expected, $args['param'] );
     1997    }
     1998
    19341999    public function _validate_as_integer_123( $value, $request, $key ) {
    19352000        if ( ! is_int( $value ) ) {
  • trunk/tests/qunit/fixtures/wp-api-generated.js

    r49252 r49257  
    3232                    "args": {
    3333                        "context": {
    34                             "required": false,
    35                             "default": "view"
     34                            "default": "view",
     35                            "required": false
    3636                        }
    3737                    }
     
    5454                    "args": {
    5555                        "validation": {
    56                             "required": false,
    57                             "default": "normal",
     56                            "type": "string",
    5857                            "enum": [
    5958                                "require-all-validate",
    6059                                "normal"
    6160                            ],
    62                             "type": "string"
     61                            "default": "normal",
     62                            "required": false
    6363                        },
    6464                        "requests": {
    65                             "required": true,
    6665                            "type": "array",
     66                            "maxItems": 25,
    6767                            "items": {
    6868                                "type": "object",
     
    101101                                    }
    102102                                }
    103                             }
     103                            },
     104                            "required": true
    104105                        }
    105106                    }
     
    126127                    "args": {
    127128                        "namespace": {
    128                             "required": false,
    129                             "default": "oembed/1.0"
     129                            "default": "oembed/1.0",
     130                            "required": false
    130131                        },
    131132                        "context": {
    132                             "required": false,
    133                             "default": "view"
     133                            "default": "view",
     134                            "required": false
    134135                        }
    135136                    }
     
    152153                    "args": {
    153154                        "url": {
    154                             "required": true,
    155155                            "description": "The URL of the resource for which to fetch oEmbed data.",
    156                             "type": "string"
     156                            "type": "string",
     157                            "format": "uri",
     158                            "required": true
    157159                        },
    158160                        "format": {
    159                             "required": false,
    160                             "default": "json"
     161                            "default": "json",
     162                            "required": false
    161163                        },
    162164                        "maxwidth": {
    163                             "required": false,
    164                             "default": 600
     165                            "default": 600,
     166                            "required": false
    165167                        }
    166168                    }
     
    183185                    "args": {
    184186                        "url": {
    185                             "required": true,
    186187                            "description": "The URL of the resource for which to fetch oEmbed data.",
    187                             "type": "string"
     188                            "type": "string",
     189                            "format": "uri",
     190                            "required": true
    188191                        },
    189192                        "format": {
    190                             "required": false,
     193                            "description": "The oEmbed format to use.",
     194                            "type": "string",
    191195                            "default": "json",
    192196                            "enum": [
     
    194198                                "xml"
    195199                            ],
    196                             "description": "The oEmbed format to use.",
    197                             "type": "string"
     200                            "required": false
    198201                        },
    199202                        "maxwidth": {
    200                             "required": false,
     203                            "description": "The maximum width of the embed frame in pixels.",
     204                            "type": "integer",
    201205                            "default": 600,
    202                             "description": "The maximum width of the embed frame in pixels.",
    203                             "type": "integer"
     206                            "required": false
    204207                        },
    205208                        "maxheight": {
    206                             "required": false,
    207209                            "description": "The maximum height of the embed frame in pixels.",
    208                             "type": "integer"
     210                            "type": "integer",
     211                            "required": false
    209212                        },
    210213                        "discover": {
    211                             "required": false,
     214                            "description": "Whether to perform an oEmbed discovery request for unsanctioned providers.",
     215                            "type": "boolean",
    212216                            "default": true,
    213                             "description": "Whether to perform an oEmbed discovery request for unsanctioned providers.",
    214                             "type": "boolean"
     217                            "required": false
    215218                        }
    216219                    }
     
    233236                    "args": {
    234237                        "namespace": {
    235                             "required": false,
    236                             "default": "wp/v2"
     238                            "default": "wp/v2",
     239                            "required": false
    237240                        },
    238241                        "context": {
    239                             "required": false,
    240                             "default": "view"
     242                            "default": "view",
     243                            "required": false
    241244                        }
    242245                    }
     
    260263                    "args": {
    261264                        "context": {
    262                             "required": false,
    263                             "default": "view",
     265                            "description": "Scope under which the request is made; determines fields present in response.",
     266                            "type": "string",
    264267                            "enum": [
    265268                                "view",
     
    267270                                "edit"
    268271                            ],
    269                             "description": "Scope under which the request is made; determines fields present in response.",
    270                             "type": "string"
     272                            "default": "view",
     273                            "required": false
    271274                        },
    272275                        "page": {
    273                             "required": false,
     276                            "description": "Current page of the collection.",
     277                            "type": "integer",
    274278                            "default": 1,
    275                             "description": "Current page of the collection.",
    276                             "type": "integer"
     279                            "minimum": 1,
     280                            "required": false
    277281                        },
    278282                        "per_page": {
    279                             "required": false,
     283                            "description": "Maximum number of items to be returned in result set.",
     284                            "type": "integer",
    280285                            "default": 10,
    281                             "description": "Maximum number of items to be returned in result set.",
    282                             "type": "integer"
     286                            "minimum": 1,
     287                            "maximum": 100,
     288                            "required": false
    283289                        },
    284290                        "search": {
    285                             "required": false,
    286291                            "description": "Limit results to those matching a string.",
    287                             "type": "string"
     292                            "type": "string",
     293                            "required": false
    288294                        },
    289295                        "after": {
    290                             "required": false,
    291296                            "description": "Limit response to posts published after a given ISO8601 compliant date.",
    292                             "type": "string"
     297                            "type": "string",
     298                            "format": "date-time",
     299                            "required": false
    293300                        },
    294301                        "author": {
    295                             "required": false,
    296                             "default": [],
    297302                            "description": "Limit result set to posts assigned to specific authors.",
    298303                            "type": "array",
    299304                            "items": {
    300305                                "type": "integer"
    301                             }
     306                            },
     307                            "default": [],
     308                            "required": false
    302309                        },
    303310                        "author_exclude": {
    304                             "required": false,
    305                             "default": [],
    306311                            "description": "Ensure result set excludes posts assigned to specific authors.",
    307312                            "type": "array",
    308313                            "items": {
    309314                                "type": "integer"
    310                             }
     315                            },
     316                            "default": [],
     317                            "required": false
    311318                        },
    312319                        "before": {
    313                             "required": false,
    314320                            "description": "Limit response to posts published before a given ISO8601 compliant date.",
    315                             "type": "string"
     321                            "type": "string",
     322                            "format": "date-time",
     323                            "required": false
    316324                        },
    317325                        "exclude": {
    318                             "required": false,
    319                             "default": [],
    320326                            "description": "Ensure result set excludes specific IDs.",
    321327                            "type": "array",
    322328                            "items": {
    323329                                "type": "integer"
    324                             }
     330                            },
     331                            "default": [],
     332                            "required": false
    325333                        },
    326334                        "include": {
    327                             "required": false,
    328                             "default": [],
    329335                            "description": "Limit result set to specific IDs.",
    330336                            "type": "array",
    331337                            "items": {
    332338                                "type": "integer"
    333                             }
     339                            },
     340                            "default": [],
     341                            "required": false
    334342                        },
    335343                        "offset": {
    336                             "required": false,
    337344                            "description": "Offset the result set by a specific number of items.",
    338                             "type": "integer"
     345                            "type": "integer",
     346                            "required": false
    339347                        },
    340348                        "order": {
    341                             "required": false,
     349                            "description": "Order sort attribute ascending or descending.",
     350                            "type": "string",
    342351                            "default": "desc",
    343352                            "enum": [
     
    345354                                "desc"
    346355                            ],
    347                             "description": "Order sort attribute ascending or descending.",
    348                             "type": "string"
     356                            "required": false
    349357                        },
    350358                        "orderby": {
    351                             "required": false,
     359                            "description": "Sort collection by object attribute.",
     360                            "type": "string",
    352361                            "default": "date",
    353362                            "enum": [
     
    363372                                "title"
    364373                            ],
    365                             "description": "Sort collection by object attribute.",
    366                             "type": "string"
     374                            "required": false
    367375                        },
    368376                        "slug": {
    369                             "required": false,
    370377                            "description": "Limit result set to posts with one or more specific slugs.",
    371378                            "type": "array",
    372379                            "items": {
    373380                                "type": "string"
    374                             }
     381                            },
     382                            "required": false
    375383                        },
    376384                        "status": {
    377                             "required": false,
    378385                            "default": "publish",
    379386                            "description": "Limit result set to posts assigned one or more statuses.",
     
    396403                                ],
    397404                                "type": "string"
    398                             }
     405                            },
     406                            "required": false
    399407                        },
    400408                        "tax_relation": {
    401                             "required": false,
     409                            "description": "Limit result set based on relationship between multiple taxonomies.",
     410                            "type": "string",
    402411                            "enum": [
    403412                                "AND",
    404413                                "OR"
    405414                            ],
    406                             "description": "Limit result set based on relationship between multiple taxonomies.",
    407                             "type": "string"
     415                            "required": false
    408416                        },
    409417                        "categories": {
    410                             "required": false,
    411                             "default": [],
    412418                            "description": "Limit result set to all items that have the specified term assigned in the categories taxonomy.",
    413419                            "type": "array",
    414420                            "items": {
    415421                                "type": "integer"
    416                             }
     422                            },
     423                            "default": [],
     424                            "required": false
    417425                        },
    418426                        "categories_exclude": {
    419                             "required": false,
    420                             "default": [],
    421427                            "description": "Limit result set to all items except those that have the specified term assigned in the categories taxonomy.",
    422428                            "type": "array",
    423429                            "items": {
    424430                                "type": "integer"
    425                             }
     431                            },
     432                            "default": [],
     433                            "required": false
    426434                        },
    427435                        "tags": {
    428                             "required": false,
    429                             "default": [],
    430436                            "description": "Limit result set to all items that have the specified term assigned in the tags taxonomy.",
    431437                            "type": "array",
    432438                            "items": {
    433439                                "type": "integer"
    434                             }
     440                            },
     441                            "default": [],
     442                            "required": false
    435443                        },
    436444                        "tags_exclude": {
    437                             "required": false,
    438                             "default": [],
    439445                            "description": "Limit result set to all items except those that have the specified term assigned in the tags taxonomy.",
    440446                            "type": "array",
    441447                            "items": {
    442448                                "type": "integer"
    443                             }
     449                            },
     450                            "default": [],
     451                            "required": false
    444452                        },
    445453                        "sticky": {
    446                             "required": false,
    447454                            "description": "Limit result set to items that are sticky.",
    448                             "type": "boolean"
     455                            "type": "boolean",
     456                            "required": false
    449457                        }
    450458                    }
     
    456464                    "args": {
    457465                        "date": {
    458                             "required": false,
    459466                            "description": "The date the object was published, in the site's timezone.",
    460467                            "type": [
    461468                                "string",
    462469                                "null"
    463                             ]
     470                            ],
     471                            "format": "date-time",
     472                            "required": false
    464473                        },
    465474                        "date_gmt": {
    466                             "required": false,
    467475                            "description": "The date the object was published, as GMT.",
    468476                            "type": [
    469477                                "string",
    470478                                "null"
    471                             ]
     479                            ],
     480                            "format": "date-time",
     481                            "required": false
    472482                        },
    473483                        "slug": {
    474                             "required": false,
    475484                            "description": "An alphanumeric identifier for the object unique to its type.",
    476                             "type": "string"
     485                            "type": "string",
     486                            "required": false
    477487                        },
    478488                        "status": {
    479                             "required": false,
     489                            "description": "A named status for the object.",
     490                            "type": "string",
    480491                            "enum": [
    481492                                "publish",
     
    485496                                "private"
    486497                            ],
    487                             "description": "A named status for the object.",
    488                             "type": "string"
     498                            "required": false
    489499                        },
    490500                        "password": {
    491                             "required": false,
    492501                            "description": "A password to protect access to the content and excerpt.",
    493                             "type": "string"
     502                            "type": "string",
     503                            "required": false
    494504                        },
    495505                        "title": {
    496                             "required": false,
    497506                            "description": "The title for the object.",
    498                             "type": "object"
     507                            "type": "object",
     508                            "properties": {
     509                                "raw": {
     510                                    "description": "Title for the object, as it exists in the database.",
     511                                    "type": "string",
     512                                    "context": [
     513                                        "edit"
     514                                    ]
     515                                },
     516                                "rendered": {
     517                                    "description": "HTML title for the object, transformed for display.",
     518                                    "type": "string",
     519                                    "context": [
     520                                        "view",
     521                                        "edit",
     522                                        "embed"
     523                                    ],
     524                                    "readonly": true
     525                                }
     526                            },
     527                            "required": false
    499528                        },
    500529                        "content": {
    501                             "required": false,
    502530                            "description": "The content for the object.",
    503                             "type": "object"
     531                            "type": "object",
     532                            "properties": {
     533                                "raw": {
     534                                    "description": "Content for the object, as it exists in the database.",
     535                                    "type": "string",
     536                                    "context": [
     537                                        "edit"
     538                                    ]
     539                                },
     540                                "rendered": {
     541                                    "description": "HTML content for the object, transformed for display.",
     542                                    "type": "string",
     543                                    "context": [
     544                                        "view",
     545                                        "edit"
     546                                    ],
     547                                    "readonly": true
     548                                },
     549                                "block_version": {
     550                                    "description": "Version of the content block format used by the object.",
     551                                    "type": "integer",
     552                                    "context": [
     553                                        "edit"
     554                                    ],
     555                                    "readonly": true
     556                                },
     557                                "protected": {
     558                                    "description": "Whether the content is protected with a password.",
     559                                    "type": "boolean",
     560                                    "context": [
     561                                        "view",
     562                                        "edit",
     563                                        "embed"
     564                                    ],
     565                                    "readonly": true
     566                                }
     567                            },
     568                            "required": false
    504569                        },
    505570                        "author": {
    506                             "required": false,
    507571                            "description": "The ID for the author of the object.",
    508                             "type": "integer"
     572                            "type": "integer",
     573                            "required": false
    509574                        },
    510575                        "excerpt": {
    511                             "required": false,
    512576                            "description": "The excerpt for the object.",
    513                             "type": "object"
     577                            "type": "object",
     578                            "properties": {
     579                                "raw": {
     580                                    "description": "Excerpt for the object, as it exists in the database.",
     581                                    "type": "string",
     582                                    "context": [
     583                                        "edit"
     584                                    ]
     585                                },
     586                                "rendered": {
     587                                    "description": "HTML excerpt for the object, transformed for display.",
     588                                    "type": "string",
     589                                    "context": [
     590                                        "view",
     591                                        "edit",
     592                                        "embed"
     593                                    ],
     594                                    "readonly": true
     595                                },
     596                                "protected": {
     597                                    "description": "Whether the excerpt is protected with a password.",
     598                                    "type": "boolean",
     599                                    "context": [
     600                                        "view",
     601                                        "edit",
     602                                        "embed"
     603                                    ],
     604                                    "readonly": true
     605                                }
     606                            },
     607                            "required": false
    514608                        },
    515609                        "featured_media": {
    516                             "required": false,
    517610                            "description": "The ID of the featured media for the object.",
    518                             "type": "integer"
     611                            "type": "integer",
     612                            "required": false
    519613                        },
    520614                        "comment_status": {
    521                             "required": false,
     615                            "description": "Whether or not comments are open on the object.",
     616                            "type": "string",
    522617                            "enum": [
    523618                                "open",
    524619                                "closed"
    525620                            ],
    526                             "description": "Whether or not comments are open on the object.",
    527                             "type": "string"
     621                            "required": false
    528622                        },
    529623                        "ping_status": {
    530                             "required": false,
     624                            "description": "Whether or not the object can be pinged.",
     625                            "type": "string",
    531626                            "enum": [
    532627                                "open",
    533628                                "closed"
    534629                            ],
    535                             "description": "Whether or not the object can be pinged.",
    536                             "type": "string"
     630                            "required": false
    537631                        },
    538632                        "format": {
    539                             "required": false,
     633                            "description": "The format for the object.",
     634                            "type": "string",
    540635                            "enum": [
    541636                                "standard",
     
    550645                                "audio"
    551646                            ],
    552                             "description": "The format for the object.",
    553                             "type": "string"
     647                            "required": false
    554648                        },
    555649                        "meta": {
    556                             "required": false,
    557650                            "description": "Meta fields.",
    558                             "type": "object"
     651                            "type": "object",
     652                            "properties": [],
     653                            "required": false
    559654                        },
    560655                        "sticky": {
    561                             "required": false,
    562656                            "description": "Whether or not the object should be treated as sticky.",
    563                             "type": "boolean"
     657                            "type": "boolean",
     658                            "required": false
    564659                        },
    565660                        "template": {
    566                             "required": false,
    567661                            "description": "The theme file to use to display the object.",
    568                             "type": "string"
     662                            "type": "string",
     663                            "required": false
    569664                        },
    570665                        "categories": {
    571                             "required": false,
    572666                            "description": "The terms assigned to the object in the category taxonomy.",
    573667                            "type": "array",
    574668                            "items": {
    575669                                "type": "integer"
    576                             }
     670                            },
     671                            "required": false
    577672                        },
    578673                        "tags": {
    579                             "required": false,
    580674                            "description": "The terms assigned to the object in the post_tag taxonomy.",
    581675                            "type": "array",
    582676                            "items": {
    583677                                "type": "integer"
    584                             }
     678                            },
     679                            "required": false
    585680                        }
    586681                    }
     
    607702                    "args": {
    608703                        "id": {
    609                             "required": false,
    610704                            "description": "Unique identifier for the object.",
    611                             "type": "integer"
     705                            "type": "integer",
     706                            "required": false
    612707                        },
    613708                        "context": {
    614                             "required": false,
    615                             "default": "view",
     709                            "description": "Scope under which the request is made; determines fields present in response.",
     710                            "type": "string",
    616711                            "enum": [
    617712                                "view",
     
    619714                                "edit"
    620715                            ],
    621                             "description": "Scope under which the request is made; determines fields present in response.",
    622                             "type": "string"
     716                            "default": "view",
     717                            "required": false
    623718                        },
    624719                        "password": {
    625                             "required": false,
    626720                            "description": "The password for the post if it is password protected.",
    627                             "type": "string"
     721                            "type": "string",
     722                            "required": false
    628723                        }
    629724                    }
     
    637732                    "args": {
    638733                        "id": {
    639                             "required": false,
    640734                            "description": "Unique identifier for the object.",
    641                             "type": "integer"
     735                            "type": "integer",
     736                            "required": false
    642737                        },
    643738                        "date": {
    644                             "required": false,
    645739                            "description": "The date the object was published, in the site's timezone.",
    646740                            "type": [
    647741                                "string",
    648742                                "null"
    649                             ]
     743                            ],
     744                            "format": "date-time",
     745                            "required": false
    650746                        },
    651747                        "date_gmt": {
    652                             "required": false,
    653748                            "description": "The date the object was published, as GMT.",
    654749                            "type": [
    655750                                "string",
    656751                                "null"
    657                             ]
     752                            ],
     753                            "format": "date-time",
     754                            "required": false
    658755                        },
    659756                        "slug": {
    660                             "required": false,
    661757                            "description": "An alphanumeric identifier for the object unique to its type.",
    662                             "type": "string"
     758                            "type": "string",
     759                            "required": false
    663760                        },
    664761                        "status": {
    665                             "required": false,
     762                            "description": "A named status for the object.",
     763                            "type": "string",
    666764                            "enum": [
    667765                                "publish",
     
    671769                                "private"
    672770                            ],
    673                             "description": "A named status for the object.",
    674                             "type": "string"
     771                            "required": false
    675772                        },
    676773                        "password": {
    677                             "required": false,
    678774                            "description": "A password to protect access to the content and excerpt.",
    679                             "type": "string"
     775                            "type": "string",
     776                            "required": false
    680777                        },
    681778                        "title": {
    682                             "required": false,
    683779                            "description": "The title for the object.",
    684                             "type": "object"
     780                            "type": "object",
     781                            "properties": {
     782                                "raw": {
     783                                    "description": "Title for the object, as it exists in the database.",
     784                                    "type": "string",
     785                                    "context": [
     786                                        "edit"
     787                                    ]
     788                                },
     789                                "rendered": {
     790                                    "description": "HTML title for the object, transformed for display.",
     791                                    "type": "string",
     792                                    "context": [
     793                                        "view",
     794                                        "edit",
     795                                        "embed"
     796                                    ],
     797                                    "readonly": true
     798                                }
     799                            },
     800                            "required": false
    685801                        },
    686802                        "content": {
    687                             "required": false,
    688803                            "description": "The content for the object.",
    689                             "type": "object"
     804                            "type": "object",
     805                            "properties": {
     806                                "raw": {
     807                                    "description": "Content for the object, as it exists in the database.",
     808                                    "type": "string",
     809                                    "context": [
     810                                        "edit"
     811                                    ]
     812                                },
     813                                "rendered": {
     814                                    "description": "HTML content for the object, transformed for display.",
     815                                    "type": "string",
     816                                    "context": [
     817                                        "view",
     818                                        "edit"
     819                                    ],
     820                                    "readonly": true
     821                                },
     822                                "block_version": {
     823                                    "description": "Version of the content block format used by the object.",
     824                                    "type": "integer",
     825                                    "context": [
     826                                        "edit"
     827                                    ],
     828                                    "readonly": true
     829                                },
     830                                "protected": {
     831                                    "description": "Whether the content is protected with a password.",
     832                                    "type": "boolean",
     833                                    "context": [
     834                                        "view",
     835                                        "edit",
     836                                        "embed"
     837                                    ],
     838                                    "readonly": true
     839                                }
     840                            },
     841                            "required": false
    690842                        },
    691843                        "author": {
    692                             "required": false,
    693844                            "description": "The ID for the author of the object.",
    694                             "type": "integer"
     845                            "type": "integer",
     846                            "required": false
    695847                        },
    696848                        "excerpt": {
    697                             "required": false,
    698849                            "description": "The excerpt for the object.",
    699                             "type": "object"
     850                            "type": "object",
     851                            "properties": {
     852                                "raw": {
     853                                    "description": "Excerpt for the object, as it exists in the database.",
     854                                    "type": "string",
     855                                    "context": [
     856                                        "edit"
     857                                    ]
     858                                },
     859                                "rendered": {
     860                                    "description": "HTML excerpt for the object, transformed for display.",
     861                                    "type": "string",
     862                                    "context": [
     863                                        "view",
     864                                        "edit",
     865                                        "embed"
     866                                    ],
     867                                    "readonly": true
     868                                },
     869                                "protected": {
     870                                    "description": "Whether the excerpt is protected with a password.",
     871                                    "type": "boolean",
     872                                    "context": [
     873                                        "view",
     874                                        "edit",
     875                                        "embed"
     876                                    ],
     877                                    "readonly": true
     878                                }
     879                            },
     880                            "required": false
    700881                        },
    701882                        "featured_media": {
    702                             "required": false,
    703883                            "description": "The ID of the featured media for the object.",
    704                             "type": "integer"
     884                            "type": "integer",
     885                            "required": false
    705886                        },
    706887                        "comment_status": {
    707                             "required": false,
     888                            "description": "Whether or not comments are open on the object.",
     889                            "type": "string",
    708890                            "enum": [
    709891                                "open",
    710892                                "closed"
    711893                            ],
    712                             "description": "Whether or not comments are open on the object.",
    713                             "type": "string"
     894                            "required": false
    714895                        },
    715896                        "ping_status": {
    716                             "required": false,
     897                            "description": "Whether or not the object can be pinged.",
     898                            "type": "string",
    717899                            "enum": [
    718900                                "open",
    719901                                "closed"
    720902                            ],
    721                             "description": "Whether or not the object can be pinged.",
    722                             "type": "string"
     903                            "required": false
    723904                        },
    724905                        "format": {
    725                             "required": false,
     906                            "description": "The format for the object.",
     907                            "type": "string",
    726908                            "enum": [
    727909                                "standard",
     
    736918                                "audio"
    737919                            ],
    738                             "description": "The format for the object.",
    739                             "type": "string"
     920                            "required": false
    740921                        },
    741922                        "meta": {
    742                             "required": false,
    743923                            "description": "Meta fields.",
    744                             "type": "object"
     924                            "type": "object",
     925                            "properties": [],
     926                            "required": false
    745927                        },
    746928                        "sticky": {
    747                             "required": false,
    748929                            "description": "Whether or not the object should be treated as sticky.",
    749                             "type": "boolean"
     930                            "type": "boolean",
     931                            "required": false
    750932                        },
    751933                        "template": {
    752                             "required": false,
    753934                            "description": "The theme file to use to display the object.",
    754                             "type": "string"
     935                            "type": "string",
     936                            "required": false
    755937                        },
    756938                        "categories": {
    757                             "required": false,
    758939                            "description": "The terms assigned to the object in the category taxonomy.",
    759940                            "type": "array",
    760941                            "items": {
    761942                                "type": "integer"
    762                             }
     943                            },
     944                            "required": false
    763945                        },
    764946                        "tags": {
    765                             "required": false,
    766947                            "description": "The terms assigned to the object in the post_tag taxonomy.",
    767948                            "type": "array",
    768949                            "items": {
    769950                                "type": "integer"
    770                             }
     951                            },
     952                            "required": false
    771953                        }
    772954                    }
     
    778960                    "args": {
    779961                        "id": {
    780                             "required": false,
    781962                            "description": "Unique identifier for the object.",
    782                             "type": "integer"
     963                            "type": "integer",
     964                            "required": false
    783965                        },
    784966                        "force": {
    785                             "required": false,
     967                            "type": "boolean",
    786968                            "default": false,
    787969                            "description": "Whether to bypass Trash and force deletion.",
    788                             "type": "boolean"
     970                            "required": false
    789971                        }
    790972                    }
     
    804986                    "args": {
    805987                        "parent": {
    806                             "required": false,
    807988                            "description": "The ID for the parent of the object.",
    808                             "type": "integer"
     989                            "type": "integer",
     990                            "required": false
    809991                        },
    810992                        "context": {
    811                             "required": false,
    812                             "default": "view",
     993                            "description": "Scope under which the request is made; determines fields present in response.",
     994                            "type": "string",
    813995                            "enum": [
    814996                                "view",
     
    816998                                "edit"
    817999                            ],
    818                             "description": "Scope under which the request is made; determines fields present in response.",
    819                             "type": "string"
     1000                            "default": "view",
     1001                            "required": false
    8201002                        },
    8211003                        "page": {
    822                             "required": false,
     1004                            "description": "Current page of the collection.",
     1005                            "type": "integer",
    8231006                            "default": 1,
    824                             "description": "Current page of the collection.",
    825                             "type": "integer"
     1007                            "minimum": 1,
     1008                            "required": false
    8261009                        },
    8271010                        "per_page": {
    828                             "required": false,
    8291011                            "description": "Maximum number of items to be returned in result set.",
    830                             "type": "integer"
     1012                            "type": "integer",
     1013                            "minimum": 1,
     1014                            "maximum": 100,
     1015                            "required": false
    8311016                        },
    8321017                        "search": {
    833                             "required": false,
    8341018                            "description": "Limit results to those matching a string.",
    835                             "type": "string"
     1019                            "type": "string",
     1020                            "required": false
    8361021                        },
    8371022                        "exclude": {
    838                             "required": false,
    839                             "default": [],
    8401023                            "description": "Ensure result set excludes specific IDs.",
    8411024                            "type": "array",
    8421025                            "items": {
    8431026                                "type": "integer"
    844                             }
     1027                            },
     1028                            "default": [],
     1029                            "required": false
    8451030                        },
    8461031                        "include": {
    847                             "required": false,
    848                             "default": [],
    8491032                            "description": "Limit result set to specific IDs.",
    8501033                            "type": "array",
    8511034                            "items": {
    8521035                                "type": "integer"
    853                             }
     1036                            },
     1037                            "default": [],
     1038                            "required": false
    8541039                        },
    8551040                        "offset": {
    856                             "required": false,
    8571041                            "description": "Offset the result set by a specific number of items.",
    858                             "type": "integer"
     1042                            "type": "integer",
     1043                            "required": false
    8591044                        },
    8601045                        "order": {
    861                             "required": false,
     1046                            "description": "Order sort attribute ascending or descending.",
     1047                            "type": "string",
    8621048                            "default": "desc",
    8631049                            "enum": [
     
    8651051                                "desc"
    8661052                            ],
    867                             "description": "Order sort attribute ascending or descending.",
    868                             "type": "string"
     1053                            "required": false
    8691054                        },
    8701055                        "orderby": {
    871                             "required": false,
     1056                            "description": "Sort collection by object attribute.",
     1057                            "type": "string",
    8721058                            "default": "date",
    8731059                            "enum": [
     
    8801066                                "title"
    8811067                            ],
    882                             "description": "Sort collection by object attribute.",
    883                             "type": "string"
     1068                            "required": false
    8841069                        }
    8851070                    }
     
    9001085                    "args": {
    9011086                        "parent": {
    902                             "required": false,
    9031087                            "description": "The ID for the parent of the object.",
    904                             "type": "integer"
     1088                            "type": "integer",
     1089                            "required": false
    9051090                        },
    9061091                        "id": {
    907                             "required": false,
    9081092                            "description": "Unique identifier for the object.",
    909                             "type": "integer"
     1093                            "type": "integer",
     1094                            "required": false
    9101095                        },
    9111096                        "context": {
    912                             "required": false,
    913                             "default": "view",
     1097                            "description": "Scope under which the request is made; determines fields present in response.",
     1098                            "type": "string",
    9141099                            "enum": [
    9151100                                "view",
     
    9171102                                "edit"
    9181103                            ],
    919                             "description": "Scope under which the request is made; determines fields present in response.",
    920                             "type": "string"
     1104                            "default": "view",
     1105                            "required": false
    9211106                        }
    9221107                    }
     
    9281113                    "args": {
    9291114                        "parent": {
    930                             "required": false,
    9311115                            "description": "The ID for the parent of the object.",
    932                             "type": "integer"
     1116                            "type": "integer",
     1117                            "required": false
    9331118                        },
    9341119                        "id": {
    935                             "required": false,
    9361120                            "description": "Unique identifier for the object.",
    937                             "type": "integer"
     1121                            "type": "integer",
     1122                            "required": false
    9381123                        },
    9391124                        "force": {
    940                             "required": false,
     1125                            "type": "boolean",
    9411126                            "default": false,
    9421127                            "description": "Required to be true, as revisions do not support trashing.",
    943                             "type": "boolean"
     1128                            "required": false
    9441129                        }
    9451130                    }
     
    9601145                    "args": {
    9611146                        "parent": {
    962                             "required": false,
    9631147                            "description": "The ID for the parent of the object.",
    964                             "type": "integer"
     1148                            "type": "integer",
     1149                            "required": false
    9651150                        },
    9661151                        "context": {
    967                             "required": false,
    968                             "default": "view",
     1152                            "description": "Scope under which the request is made; determines fields present in response.",
     1153                            "type": "string",
    9691154                            "enum": [
    9701155                                "view",
     
    9721157                                "edit"
    9731158                            ],
    974                             "description": "Scope under which the request is made; determines fields present in response.",
    975                             "type": "string"
     1159                            "default": "view",
     1160                            "required": false
    9761161                        }
    9771162                    }
     
    9831168                    "args": {
    9841169                        "parent": {
    985                             "required": false,
    9861170                            "description": "The ID for the parent of the object.",
    987                             "type": "integer"
     1171                            "type": "integer",
     1172                            "required": false
    9881173                        },
    9891174                        "date": {
    990                             "required": false,
    9911175                            "description": "The date the object was published, in the site's timezone.",
    9921176                            "type": [
    9931177                                "string",
    9941178                                "null"
    995                             ]
     1179                            ],
     1180                            "format": "date-time",
     1181                            "required": false
    9961182                        },
    9971183                        "date_gmt": {
    998                             "required": false,
    9991184                            "description": "The date the object was published, as GMT.",
    10001185                            "type": [
    10011186                                "string",
    10021187                                "null"
    1003                             ]
     1188                            ],
     1189                            "format": "date-time",
     1190                            "required": false
    10041191                        },
    10051192                        "slug": {
    1006                             "required": false,
    10071193                            "description": "An alphanumeric identifier for the object unique to its type.",
    1008                             "type": "string"
     1194                            "type": "string",
     1195                            "required": false
    10091196                        },
    10101197                        "status": {
    1011                             "required": false,
     1198                            "description": "A named status for the object.",
     1199                            "type": "string",
    10121200                            "enum": [
    10131201                                "publish",
     
    10171205                                "private"
    10181206                            ],
    1019                             "description": "A named status for the object.",
    1020                             "type": "string"
     1207                            "required": false
    10211208                        },
    10221209                        "password": {
    1023                             "required": false,
    10241210                            "description": "A password to protect access to the content and excerpt.",
    1025                             "type": "string"
     1211                            "type": "string",
     1212                            "required": false
    10261213                        },
    10271214                        "title": {
    1028                             "required": false,
    10291215                            "description": "The title for the object.",
    1030                             "type": "object"
     1216                            "type": "object",
     1217                            "properties": {
     1218                                "raw": {
     1219                                    "description": "Title for the object, as it exists in the database.",
     1220                                    "type": "string",
     1221                                    "context": [
     1222                                        "edit"
     1223                                    ]
     1224                                },
     1225                                "rendered": {
     1226                                    "description": "HTML title for the object, transformed for display.",
     1227                                    "type": "string",
     1228                                    "context": [
     1229                                        "view",
     1230                                        "edit",
     1231                                        "embed"
     1232                                    ],
     1233                                    "readonly": true
     1234                                }
     1235                            },
     1236                            "required": false
    10311237                        },
    10321238                        "content": {
    1033                             "required": false,
    10341239                            "description": "The content for the object.",
    1035                             "type": "object"
     1240                            "type": "object",
     1241                            "properties": {
     1242                                "raw": {
     1243                                    "description": "Content for the object, as it exists in the database.",
     1244                                    "type": "string",
     1245                                    "context": [
     1246                                        "edit"
     1247                                    ]
     1248                                },
     1249                                "rendered": {
     1250                                    "description": "HTML content for the object, transformed for display.",
     1251                                    "type": "string",
     1252                                    "context": [
     1253                                        "view",
     1254                                        "edit"
     1255                                    ],
     1256                                    "readonly": true
     1257                                },
     1258                                "block_version": {
     1259                                    "description": "Version of the content block format used by the object.",
     1260                                    "type": "integer",
     1261                                    "context": [
     1262                                        "edit"
     1263                                    ],
     1264                                    "readonly": true
     1265                                },
     1266                                "protected": {
     1267                                    "description": "Whether the content is protected with a password.",
     1268                                    "type": "boolean",
     1269                                    "context": [
     1270                                        "view",
     1271                                        "edit",
     1272                                        "embed"
     1273                                    ],
     1274                                    "readonly": true
     1275                                }
     1276                            },
     1277                            "required": false
    10361278                        },
    10371279                        "author": {
    1038                             "required": false,
    10391280                            "description": "The ID for the author of the object.",
    1040                             "type": "integer"
     1281                            "type": "integer",
     1282                            "required": false
    10411283                        },
    10421284                        "excerpt": {
    1043                             "required": false,
    10441285                            "description": "The excerpt for the object.",
    1045                             "type": "object"
     1286                            "type": "object",
     1287                            "properties": {
     1288                                "raw": {
     1289                                    "description": "Excerpt for the object, as it exists in the database.",
     1290                                    "type": "string",
     1291                                    "context": [
     1292                                        "edit"
     1293                                    ]
     1294                                },
     1295                                "rendered": {
     1296                                    "description": "HTML excerpt for the object, transformed for display.",
     1297                                    "type": "string",
     1298                                    "context": [
     1299                                        "view",
     1300                                        "edit",
     1301                                        "embed"
     1302                                    ],
     1303                                    "readonly": true
     1304                                },
     1305                                "protected": {
     1306                                    "description": "Whether the excerpt is protected with a password.",
     1307                                    "type": "boolean",
     1308                                    "context": [
     1309                                        "view",
     1310                                        "edit",
     1311                                        "embed"
     1312                                    ],
     1313                                    "readonly": true
     1314                                }
     1315                            },
     1316                            "required": false
    10461317                        },
    10471318                        "featured_media": {
    1048                             "required": false,
    10491319                            "description": "The ID of the featured media for the object.",
    1050                             "type": "integer"
     1320                            "type": "integer",
     1321                            "required": false
    10511322                        },
    10521323                        "comment_status": {
    1053                             "required": false,
     1324                            "description": "Whether or not comments are open on the object.",
     1325                            "type": "string",
    10541326                            "enum": [
    10551327                                "open",
    10561328                                "closed"
    10571329                            ],
    1058                             "description": "Whether or not comments are open on the object.",
    1059                             "type": "string"
     1330                            "required": false
    10601331                        },
    10611332                        "ping_status": {
    1062                             "required": false,
     1333                            "description": "Whether or not the object can be pinged.",
     1334                            "type": "string",
    10631335                            "enum": [
    10641336                                "open",
    10651337                                "closed"
    10661338                            ],
    1067                             "description": "Whether or not the object can be pinged.",
    1068                             "type": "string"
     1339                            "required": false
    10691340                        },
    10701341                        "format": {
    1071                             "required": false,
     1342                            "description": "The format for the object.",
     1343                            "type": "string",
    10721344                            "enum": [
    10731345                                "standard",
     
    10821354                                "audio"
    10831355                            ],
    1084                             "description": "The format for the object.",
    1085                             "type": "string"
     1356                            "required": false
    10861357                        },
    10871358                        "meta": {
    1088                             "required": false,
    10891359                            "description": "Meta fields.",
    1090                             "type": "object"
     1360                            "type": "object",
     1361                            "properties": [],
     1362                            "required": false
    10911363                        },
    10921364                        "sticky": {
    1093                             "required": false,
    10941365                            "description": "Whether or not the object should be treated as sticky.",
    1095                             "type": "boolean"
     1366                            "type": "boolean",
     1367                            "required": false
    10961368                        },
    10971369                        "template": {
    1098                             "required": false,
    10991370                            "description": "The theme file to use to display the object.",
    1100                             "type": "string"
     1371                            "type": "string",
     1372                            "required": false
    11011373                        },
    11021374                        "categories": {
    1103                             "required": false,
    11041375                            "description": "The terms assigned to the object in the category taxonomy.",
    11051376                            "type": "array",
    11061377                            "items": {
    11071378                                "type": "integer"
    1108                             }
     1379                            },
     1380                            "required": false
    11091381                        },
    11101382                        "tags": {
    1111                             "required": false,
    11121383                            "description": "The terms assigned to the object in the post_tag taxonomy.",
    11131384                            "type": "array",
    11141385                            "items": {
    11151386                                "type": "integer"
    1116                             }
     1387                            },
     1388                            "required": false
    11171389                        }
    11181390                    }
     
    11321404                    "args": {
    11331405                        "parent": {
    1134                             "required": false,
    11351406                            "description": "The ID for the parent of the object.",
    1136                             "type": "integer"
     1407                            "type": "integer",
     1408                            "required": false
    11371409                        },
    11381410                        "id": {
    1139                             "required": false,
    11401411                            "description": "The ID for the object.",
    1141                             "type": "integer"
     1412                            "type": "integer",
     1413                            "required": false
    11421414                        },
    11431415                        "context": {
    1144                             "required": false,
    1145                             "default": "view",
     1416                            "description": "Scope under which the request is made; determines fields present in response.",
     1417                            "type": "string",
    11461418                            "enum": [
    11471419                                "view",
     
    11491421                                "edit"
    11501422                            ],
    1151                             "description": "Scope under which the request is made; determines fields present in response.",
    1152                             "type": "string"
     1423                            "default": "view",
     1424                            "required": false
    11531425                        }
    11541426                    }
     
    11691441                    "args": {
    11701442                        "context": {
    1171                             "required": false,
    1172                             "default": "view",
     1443                            "description": "Scope under which the request is made; determines fields present in response.",
     1444                            "type": "string",
    11731445                            "enum": [
    11741446                                "view",
     
    11761448                                "edit"
    11771449                            ],
    1178                             "description": "Scope under which the request is made; determines fields present in response.",
    1179                             "type": "string"
     1450                            "default": "view",
     1451                            "required": false
    11801452                        },
    11811453                        "page": {
    1182                             "required": false,
     1454                            "description": "Current page of the collection.",
     1455                            "type": "integer",
    11831456                            "default": 1,
    1184                             "description": "Current page of the collection.",
    1185                             "type": "integer"
     1457                            "minimum": 1,
     1458                            "required": false
    11861459                        },
    11871460                        "per_page": {
    1188                             "required": false,
     1461                            "description": "Maximum number of items to be returned in result set.",
     1462                            "type": "integer",
    11891463                            "default": 10,
    1190                             "description": "Maximum number of items to be returned in result set.",
    1191                             "type": "integer"
     1464                            "minimum": 1,
     1465                            "maximum": 100,
     1466                            "required": false
    11921467                        },
    11931468                        "search": {
    1194                             "required": false,
    11951469                            "description": "Limit results to those matching a string.",
    1196                             "type": "string"
     1470                            "type": "string",
     1471                            "required": false
    11971472                        },
    11981473                        "after": {
    1199                             "required": false,
    12001474                            "description": "Limit response to posts published after a given ISO8601 compliant date.",
    1201                             "type": "string"
     1475                            "type": "string",
     1476                            "format": "date-time",
     1477                            "required": false
    12021478                        },
    12031479                        "author": {
    1204                             "required": false,
    1205                             "default": [],
    12061480                            "description": "Limit result set to posts assigned to specific authors.",
    12071481                            "type": "array",
    12081482                            "items": {
    12091483                                "type": "integer"
    1210                             }
     1484                            },
     1485                            "default": [],
     1486                            "required": false
    12111487                        },
    12121488                        "author_exclude": {
    1213                             "required": false,
    1214                             "default": [],
    12151489                            "description": "Ensure result set excludes posts assigned to specific authors.",
    12161490                            "type": "array",
    12171491                            "items": {
    12181492                                "type": "integer"
    1219                             }
     1493                            },
     1494                            "default": [],
     1495                            "required": false
    12201496                        },
    12211497                        "before": {
    1222                             "required": false,
    12231498                            "description": "Limit response to posts published before a given ISO8601 compliant date.",
    1224                             "type": "string"
     1499                            "type": "string",
     1500                            "format": "date-time",
     1501                            "required": false
    12251502                        },
    12261503                        "exclude": {
    1227                             "required": false,
    1228                             "default": [],
    12291504                            "description": "Ensure result set excludes specific IDs.",
    12301505                            "type": "array",
    12311506                            "items": {
    12321507                                "type": "integer"
    1233                             }
     1508                            },
     1509                            "default": [],
     1510                            "required": false
    12341511                        },
    12351512                        "include": {
    1236                             "required": false,
    1237                             "default": [],
    12381513                            "description": "Limit result set to specific IDs.",
    12391514                            "type": "array",
    12401515                            "items": {
    12411516                                "type": "integer"
    1242                             }
     1517                            },
     1518                            "default": [],
     1519                            "required": false
    12431520                        },
    12441521                        "menu_order": {
    1245                             "required": false,
    12461522                            "description": "Limit result set to posts with a specific menu_order value.",
    1247                             "type": "integer"
     1523                            "type": "integer",
     1524                            "required": false
    12481525                        },
    12491526                        "offset": {
    1250                             "required": false,
    12511527                            "description": "Offset the result set by a specific number of items.",
    1252                             "type": "integer"
     1528                            "type": "integer",
     1529                            "required": false
    12531530                        },
    12541531                        "order": {
    1255                             "required": false,
     1532                            "description": "Order sort attribute ascending or descending.",
     1533                            "type": "string",
    12561534                            "default": "desc",
    12571535                            "enum": [
     
    12591537                                "desc"
    12601538                            ],
    1261                             "description": "Order sort attribute ascending or descending.",
    1262                             "type": "string"
     1539                            "required": false
    12631540                        },
    12641541                        "orderby": {
    1265                             "required": false,
     1542                            "description": "Sort collection by object attribute.",
     1543                            "type": "string",
    12661544                            "default": "date",
    12671545                            "enum": [
     
    12781556                                "menu_order"
    12791557                            ],
    1280                             "description": "Sort collection by object attribute.",
    1281                             "type": "string"
     1558                            "required": false
    12821559                        },
    12831560                        "parent": {
    1284                             "required": false,
    1285                             "default": [],
    12861561                            "description": "Limit result set to items with particular parent IDs.",
    12871562                            "type": "array",
    12881563                            "items": {
    12891564                                "type": "integer"
    1290                             }
     1565                            },
     1566                            "default": [],
     1567                            "required": false
    12911568                        },
    12921569                        "parent_exclude": {
    1293                             "required": false,
    1294                             "default": [],
    12951570                            "description": "Limit result set to all items except those of a particular parent ID.",
    12961571                            "type": "array",
    12971572                            "items": {
    12981573                                "type": "integer"
    1299                             }
     1574                            },
     1575                            "default": [],
     1576                            "required": false
    13001577                        },
    13011578                        "slug": {
    1302                             "required": false,
    13031579                            "description": "Limit result set to posts with one or more specific slugs.",
    13041580                            "type": "array",
    13051581                            "items": {
    13061582                                "type": "string"
    1307                             }
     1583                            },
     1584                            "required": false
    13081585                        },
    13091586                        "status": {
    1310                             "required": false,
    13111587                            "default": "publish",
    13121588                            "description": "Limit result set to posts assigned one or more statuses.",
     
    13291605                                ],
    13301606                                "type": "string"
    1331                             }
     1607                            },
     1608                            "required": false
    13321609                        }
    13331610                    }
     
    13391616                    "args": {
    13401617                        "date": {
    1341                             "required": false,
    13421618                            "description": "The date the object was published, in the site's timezone.",
    13431619                            "type": [
    13441620                                "string",
    13451621                                "null"
    1346                             ]
     1622                            ],
     1623                            "format": "date-time",
     1624                            "required": false
    13471625                        },
    13481626                        "date_gmt": {
    1349                             "required": false,
    13501627                            "description": "The date the object was published, as GMT.",
    13511628                            "type": [
    13521629                                "string",
    13531630                                "null"
    1354                             ]
     1631                            ],
     1632                            "format": "date-time",
     1633                            "required": false
    13551634                        },
    13561635                        "slug": {
    1357                             "required": false,
    13581636                            "description": "An alphanumeric identifier for the object unique to its type.",
    1359                             "type": "string"
     1637                            "type": "string",
     1638                            "required": false
    13601639                        },
    13611640                        "status": {
    1362                             "required": false,
     1641                            "description": "A named status for the object.",
     1642                            "type": "string",
    13631643                            "enum": [
    13641644                                "publish",
     
    13681648                                "private"
    13691649                            ],
    1370                             "description": "A named status for the object.",
    1371                             "type": "string"
     1650                            "required": false
    13721651                        },
    13731652                        "password": {
    1374                             "required": false,
    13751653                            "description": "A password to protect access to the content and excerpt.",
    1376                             "type": "string"
     1654                            "type": "string",
     1655                            "required": false
    13771656                        },
    13781657                        "parent": {
    1379                             "required": false,
    13801658                            "description": "The ID for the parent of the object.",
    1381                             "type": "integer"
     1659                            "type": "integer",
     1660                            "required": false
    13821661                        },
    13831662                        "title": {
    1384                             "required": false,
    13851663                            "description": "The title for the object.",
    1386                             "type": "object"
     1664                            "type": "object",
     1665                            "properties": {
     1666                                "raw": {
     1667                                    "description": "Title for the object, as it exists in the database.",
     1668                                    "type": "string",
     1669                                    "context": [
     1670                                        "edit"
     1671                                    ]
     1672                                },
     1673                                "rendered": {
     1674                                    "description": "HTML title for the object, transformed for display.",
     1675                                    "type": "string",
     1676                                    "context": [
     1677                                        "view",
     1678                                        "edit",
     1679                                        "embed"
     1680                                    ],
     1681                                    "readonly": true
     1682                                }
     1683                            },
     1684                            "required": false
    13871685                        },
    13881686                        "content": {
    1389                             "required": false,
    13901687                            "description": "The content for the object.",
    1391                             "type": "object"
     1688                            "type": "object",
     1689                            "properties": {
     1690                                "raw": {
     1691                                    "description": "Content for the object, as it exists in the database.",
     1692                                    "type": "string",
     1693                                    "context": [
     1694                                        "edit"
     1695                                    ]
     1696                                },
     1697                                "rendered": {
     1698                                    "description": "HTML content for the object, transformed for display.",
     1699                                    "type": "string",
     1700                                    "context": [
     1701                                        "view",
     1702                                        "edit"
     1703                                    ],
     1704                                    "readonly": true
     1705                                },
     1706                                "block_version": {
     1707                                    "description": "Version of the content block format used by the object.",
     1708                                    "type": "integer",
     1709                                    "context": [
     1710                                        "edit"
     1711                                    ],
     1712                                    "readonly": true
     1713                                },
     1714                                "protected": {
     1715                                    "description": "Whether the content is protected with a password.",
     1716                                    "type": "boolean",
     1717                                    "context": [
     1718                                        "view",
     1719                                        "edit",
     1720                                        "embed"
     1721                                    ],
     1722                                    "readonly": true
     1723                                }
     1724                            },
     1725                            "required": false
    13921726                        },
    13931727                        "author": {
    1394                             "required": false,
    13951728                            "description": "The ID for the author of the object.",
    1396                             "type": "integer"
     1729                            "type": "integer",
     1730                            "required": false
    13971731                        },
    13981732                        "excerpt": {
    1399                             "required": false,
    14001733                            "description": "The excerpt for the object.",
    1401                             "type": "object"
     1734                            "type": "object",
     1735                            "properties": {
     1736                                "raw": {
     1737                                    "description": "Excerpt for the object, as it exists in the database.",
     1738                                    "type": "string",
     1739                                    "context": [
     1740                                        "edit"
     1741                                    ]
     1742                                },
     1743                                "rendered": {
     1744                                    "description": "HTML excerpt for the object, transformed for display.",
     1745                                    "type": "string",
     1746                                    "context": [
     1747                                        "view",
     1748                                        "edit",
     1749                                        "embed"
     1750                                    ],
     1751                                    "readonly": true
     1752                                },
     1753                                "protected": {
     1754                                    "description": "Whether the excerpt is protected with a password.",
     1755                                    "type": "boolean",
     1756                                    "context": [
     1757                                        "view",
     1758                                        "edit",
     1759                                        "embed"
     1760                                    ],
     1761                                    "readonly": true
     1762                                }
     1763                            },
     1764                            "required": false
    14021765                        },
    14031766                        "featured_media": {
    1404                             "required": false,
    14051767                            "description": "The ID of the featured media for the object.",
    1406                             "type": "integer"
     1768                            "type": "integer",
     1769                            "required": false
    14071770                        },
    14081771                        "comment_status": {
    1409                             "required": false,
     1772                            "description": "Whether or not comments are open on the object.",
     1773                            "type": "string",
    14101774                            "enum": [
    14111775                                "open",
    14121776                                "closed"
    14131777                            ],
    1414                             "description": "Whether or not comments are open on the object.",
    1415                             "type": "string"
     1778                            "required": false
    14161779                        },
    14171780                        "ping_status": {
    1418                             "required": false,
     1781                            "description": "Whether or not the object can be pinged.",
     1782                            "type": "string",
    14191783                            "enum": [
    14201784                                "open",
    14211785                                "closed"
    14221786                            ],
    1423                             "description": "Whether or not the object can be pinged.",
    1424                             "type": "string"
     1787                            "required": false
    14251788                        },
    14261789                        "menu_order": {
    1427                             "required": false,
    14281790                            "description": "The order of the object in relation to other object of its type.",
    1429                             "type": "integer"
     1791                            "type": "integer",
     1792                            "required": false
    14301793                        },
    14311794                        "meta": {
    1432                             "required": false,
    14331795                            "description": "Meta fields.",
    1434                             "type": "object"
     1796                            "type": "object",
     1797                            "properties": [],
     1798                            "required": false
    14351799                        },
    14361800                        "template": {
    1437                             "required": false,
    14381801                            "description": "The theme file to use to display the object.",
    1439                             "type": "string"
     1802                            "type": "string",
     1803                            "required": false
    14401804                        }
    14411805                    }
     
    14621826                    "args": {
    14631827                        "id": {
    1464                             "required": false,
    14651828                            "description": "Unique identifier for the object.",
    1466                             "type": "integer"
     1829                            "type": "integer",
     1830                            "required": false
    14671831                        },
    14681832                        "context": {
    1469                             "required": false,
    1470                             "default": "view",
     1833                            "description": "Scope under which the request is made; determines fields present in response.",
     1834                            "type": "string",
    14711835                            "enum": [
    14721836                                "view",
     
    14741838                                "edit"
    14751839                            ],
    1476                             "description": "Scope under which the request is made; determines fields present in response.",
    1477                             "type": "string"
     1840                            "default": "view",
     1841                            "required": false
    14781842                        },
    14791843                        "password": {
    1480                             "required": false,
    14811844                            "description": "The password for the post if it is password protected.",
    1482                             "type": "string"
     1845                            "type": "string",
     1846                            "required": false
    14831847                        }
    14841848                    }
     
    14921856                    "args": {
    14931857                        "id": {
    1494                             "required": false,
    14951858                            "description": "Unique identifier for the object.",
    1496                             "type": "integer"
     1859                            "type": "integer",
     1860                            "required": false
    14971861                        },
    14981862                        "date": {
    1499                             "required": false,
    15001863                            "description": "The date the object was published, in the site's timezone.",
    15011864                            "type": [
    15021865                                "string",
    15031866                                "null"
    1504                             ]
     1867                            ],
     1868                            "format": "date-time",
     1869                            "required": false
    15051870                        },
    15061871                        "date_gmt": {
    1507                             "required": false,
    15081872                            "description": "The date the object was published, as GMT.",
    15091873                            "type": [
    15101874                                "string",
    15111875                                "null"
    1512                             ]
     1876                            ],
     1877                            "format": "date-time",
     1878                            "required": false
    15131879                        },
    15141880                        "slug": {
    1515                             "required": false,
    15161881                            "description": "An alphanumeric identifier for the object unique to its type.",
    1517                             "type": "string"
     1882                            "type": "string",
     1883                            "required": false
    15181884                        },
    15191885                        "status": {
    1520                             "required": false,
     1886                            "description": "A named status for the object.",
     1887                            "type": "string",
    15211888                            "enum": [
    15221889                                "publish",
     
    15261893                                "private"
    15271894                            ],
    1528                             "description": "A named status for the object.",
    1529                             "type": "string"
     1895                            "required": false
    15301896                        },
    15311897                        "password": {
    1532                             "required": false,
    15331898                            "description": "A password to protect access to the content and excerpt.",
    1534                             "type": "string"
     1899                            "type": "string",
     1900                            "required": false
    15351901                        },
    15361902                        "parent": {
    1537                             "required": false,
    15381903                            "description": "The ID for the parent of the object.",
    1539                             "type": "integer"
     1904                            "type": "integer",
     1905                            "required": false
    15401906                        },
    15411907                        "title": {
    1542                             "required": false,
    15431908                            "description": "The title for the object.",
    1544                             "type": "object"
     1909                            "type": "object",
     1910                            "properties": {
     1911                                "raw": {
     1912                                    "description": "Title for the object, as it exists in the database.",
     1913                                    "type": "string",
     1914                                    "context": [
     1915                                        "edit"
     1916                                    ]
     1917                                },
     1918                                "rendered": {
     1919                                    "description": "HTML title for the object, transformed for display.",
     1920                                    "type": "string",
     1921                                    "context": [
     1922                                        "view",
     1923                                        "edit",
     1924                                        "embed"
     1925                                    ],
     1926                                    "readonly": true
     1927                                }
     1928                            },
     1929                            "required": false
    15451930                        },
    15461931                        "content": {
    1547                             "required": false,
    15481932                            "description": "The content for the object.",
    1549                             "type": "object"
     1933                            "type": "object",
     1934                            "properties": {
     1935                                "raw": {
     1936                                    "description": "Content for the object, as it exists in the database.",
     1937                                    "type": "string",
     1938                                    "context": [
     1939                                        "edit"
     1940                                    ]
     1941                                },
     1942                                "rendered": {
     1943                                    "description": "HTML content for the object, transformed for display.",
     1944                                    "type": "string",
     1945                                    "context": [
     1946                                        "view",
     1947                                        "edit"
     1948                                    ],
     1949                                    "readonly": true
     1950                                },
     1951                                "block_version": {
     1952                                    "description": "Version of the content block format used by the object.",
     1953                                    "type": "integer",
     1954                                    "context": [
     1955                                        "edit"
     1956                                    ],
     1957                                    "readonly": true
     1958                                },
     1959                                "protected": {
     1960                                    "description": "Whether the content is protected with a password.",
     1961                                    "type": "boolean",
     1962                                    "context": [
     1963                                        "view",
     1964                                        "edit",
     1965                                        "embed"
     1966                                    ],
     1967                                    "readonly": true
     1968                                }
     1969                            },
     1970                            "required": false
    15501971                        },
    15511972                        "author": {
    1552                             "required": false,
    15531973                            "description": "The ID for the author of the object.",
    1554                             "type": "integer"
     1974                            "type": "integer",
     1975                            "required": false
    15551976                        },
    15561977                        "excerpt": {
    1557                             "required": false,
    15581978                            "description": "The excerpt for the object.",
    1559                             "type": "object"
     1979                            "type": "object",
     1980                            "properties": {
     1981                                "raw": {
     1982                                    "description": "Excerpt for the object, as it exists in the database.",
     1983                                    "type": "string",
     1984                                    "context": [
     1985                                        "edit"
     1986                                    ]
     1987                                },
     1988                                "rendered": {
     1989                                    "description": "HTML excerpt for the object, transformed for display.",
     1990                                    "type": "string",
     1991                                    "context": [
     1992                                        "view",
     1993                                        "edit",
     1994                                        "embed"
     1995                                    ],
     1996                                    "readonly": true
     1997                                },
     1998                                "protected": {
     1999                                    "description": "Whether the excerpt is protected with a password.",
     2000                                    "type": "boolean",
     2001                                    "context": [
     2002                                        "view",
     2003                                        "edit",
     2004                                        "embed"
     2005                                    ],
     2006                                    "readonly": true
     2007                                }
     2008                            },
     2009                            "required": false
    15602010                        },
    15612011                        "featured_media": {
    1562                             "required": false,
    15632012                            "description": "The ID of the featured media for the object.",
    1564                             "type": "integer"
     2013                            "type": "integer",
     2014                            "required": false
    15652015                        },
    15662016                        "comment_status": {
    1567                             "required": false,
     2017                            "description": "Whether or not comments are open on the object.",
     2018                            "type": "string",
    15682019                            "enum": [
    15692020                                "open",
    15702021                                "closed"
    15712022                            ],
    1572                             "description": "Whether or not comments are open on the object.",
    1573                             "type": "string"
     2023                            "required": false
    15742024                        },
    15752025                        "ping_status": {
    1576                             "required": false,
     2026                            "description": "Whether or not the object can be pinged.",
     2027                            "type": "string",
    15772028                            "enum": [
    15782029                                "open",
    15792030                                "closed"
    15802031                            ],
    1581                             "description": "Whether or not the object can be pinged.",
    1582                             "type": "string"
     2032                            "required": false
    15832033                        },
    15842034                        "menu_order": {
    1585                             "required": false,
    15862035                            "description": "The order of the object in relation to other object of its type.",
    1587                             "type": "integer"
     2036                            "type": "integer",
     2037                            "required": false
    15882038                        },
    15892039                        "meta": {
    1590                             "required": false,
    15912040                            "description": "Meta fields.",
    1592                             "type": "object"
     2041                            "type": "object",
     2042                            "properties": [],
     2043                            "required": false
    15932044                        },
    15942045                        "template": {
    1595                             "required": false,
    15962046                            "description": "The theme file to use to display the object.",
    1597                             "type": "string"
     2047                            "type": "string",
     2048                            "required": false
    15982049                        }
    15992050                    }
     
    16052056                    "args": {
    16062057                        "id": {
    1607                             "required": false,
    16082058                            "description": "Unique identifier for the object.",
    1609                             "type": "integer"
     2059                            "type": "integer",
     2060                            "required": false
    16102061                        },
    16112062                        "force": {
    1612                             "required": false,
     2063                            "type": "boolean",
    16132064                            "default": false,
    16142065                            "description": "Whether to bypass Trash and force deletion.",
    1615                             "type": "boolean"
     2066                            "required": false
    16162067                        }
    16172068                    }
     
    16312082                    "args": {
    16322083                        "parent": {
    1633                             "required": false,
    16342084                            "description": "The ID for the parent of the object.",
    1635                             "type": "integer"
     2085                            "type": "integer",
     2086                            "required": false
    16362087                        },
    16372088                        "context": {
    1638                             "required": false,
    1639                             "default": "view",
     2089                            "description": "Scope under which the request is made; determines fields present in response.",
     2090                            "type": "string",
    16402091                            "enum": [
    16412092                                "view",
     
    16432094                                "edit"
    16442095                            ],
    1645                             "description": "Scope under which the request is made; determines fields present in response.",
    1646                             "type": "string"
     2096                            "default": "view",
     2097                            "required": false
    16472098                        },
    16482099                        "page": {
    1649                             "required": false,
     2100                            "description": "Current page of the collection.",
     2101                            "type": "integer",
    16502102                            "default": 1,
    1651                             "description": "Current page of the collection.",
    1652                             "type": "integer"
     2103                            "minimum": 1,
     2104                            "required": false
    16532105                        },
    16542106                        "per_page": {
    1655                             "required": false,
    16562107                            "description": "Maximum number of items to be returned in result set.",
    1657                             "type": "integer"
     2108                            "type": "integer",
     2109                            "minimum": 1,
     2110                            "maximum": 100,
     2111                            "required": false
    16582112                        },
    16592113                        "search": {
    1660                             "required": false,
    16612114                            "description": "Limit results to those matching a string.",
    1662                             "type": "string"
     2115                            "type": "string",
     2116                            "required": false
    16632117                        },
    16642118                        "exclude": {
    1665                             "required": false,
    1666                             "default": [],
    16672119                            "description": "Ensure result set excludes specific IDs.",
    16682120                            "type": "array",
    16692121                            "items": {
    16702122                                "type": "integer"
    1671                             }
     2123                            },
     2124                            "default": [],
     2125                            "required": false
    16722126                        },
    16732127                        "include": {
    1674                             "required": false,
    1675                             "default": [],
    16762128                            "description": "Limit result set to specific IDs.",
    16772129                            "type": "array",
    16782130                            "items": {
    16792131                                "type": "integer"
    1680                             }
     2132                            },
     2133                            "default": [],
     2134                            "required": false
    16812135                        },
    16822136                        "offset": {
    1683                             "required": false,
    16842137                            "description": "Offset the result set by a specific number of items.",
    1685                             "type": "integer"
     2138                            "type": "integer",
     2139                            "required": false
    16862140                        },
    16872141                        "order": {
    1688                             "required": false,
     2142                            "description": "Order sort attribute ascending or descending.",
     2143                            "type": "string",
    16892144                            "default": "desc",
    16902145                            "enum": [
     
    16922147                                "desc"
    16932148                            ],
    1694                             "description": "Order sort attribute ascending or descending.",
    1695                             "type": "string"
     2149                            "required": false
    16962150                        },
    16972151                        "orderby": {
    1698                             "required": false,
     2152                            "description": "Sort collection by object attribute.",
     2153                            "type": "string",
    16992154                            "default": "date",
    17002155                            "enum": [
     
    17072162                                "title"
    17082163                            ],
    1709                             "description": "Sort collection by object attribute.",
    1710                             "type": "string"
     2164                            "required": false
    17112165                        }
    17122166                    }
     
    17272181                    "args": {
    17282182                        "parent": {
    1729                             "required": false,
    17302183                            "description": "The ID for the parent of the object.",
    1731                             "type": "integer"
     2184                            "type": "integer",
     2185                            "required": false
    17322186                        },
    17332187                        "id": {
    1734                             "required": false,
    17352188                            "description": "Unique identifier for the object.",
    1736                             "type": "integer"
     2189                            "type": "integer",
     2190                            "required": false
    17372191                        },
    17382192                        "context": {
    1739                             "required": false,
    1740                             "default": "view",
     2193                            "description": "Scope under which the request is made; determines fields present in response.",
     2194                            "type": "string",
    17412195                            "enum": [
    17422196                                "view",
     
    17442198                                "edit"
    17452199                            ],
    1746                             "description": "Scope under which the request is made; determines fields present in response.",
    1747                             "type": "string"
     2200                            "default": "view",
     2201                            "required": false
    17482202                        }
    17492203                    }
     
    17552209                    "args": {
    17562210                        "parent": {
    1757                             "required": false,
    17582211                            "description": "The ID for the parent of the object.",
    1759                             "type": "integer"
     2212                            "type": "integer",
     2213                            "required": false
    17602214                        },
    17612215                        "id": {
    1762                             "required": false,
    17632216                            "description": "Unique identifier for the object.",
    1764                             "type": "integer"
     2217                            "type": "integer",
     2218                            "required": false
    17652219                        },
    17662220                        "force": {
    1767                             "required": false,
     2221                            "type": "boolean",
    17682222                            "default": false,
    17692223                            "description": "Required to be true, as revisions do not support trashing.",
    1770                             "type": "boolean"
     2224                            "required": false
    17712225                        }
    17722226                    }
     
    17872241                    "args": {
    17882242                        "parent": {
    1789                             "required": false,
    17902243                            "description": "The ID for the parent of the object.",
    1791                             "type": "integer"
     2244                            "type": "integer",
     2245                            "required": false
    17922246                        },
    17932247                        "context": {
    1794                             "required": false,
    1795                             "default": "view",
     2248                            "description": "Scope under which the request is made; determines fields present in response.",
     2249                            "type": "string",
    17962250                            "enum": [
    17972251                                "view",
     
    17992253                                "edit"
    18002254                            ],
    1801                             "description": "Scope under which the request is made; determines fields present in response.",
    1802                             "type": "string"
     2255                            "default": "view",
     2256                            "required": false
    18032257                        }
    18042258                    }
     
    18102264                    "args": {
    18112265                        "parent": {
    1812                             "required": false,
    18132266                            "description": "The ID for the parent of the object.",
    1814                             "type": "integer"
     2267                            "type": "integer",
     2268                            "required": false
    18152269                        },
    18162270                        "date": {
    1817                             "required": false,
    18182271                            "description": "The date the object was published, in the site's timezone.",
    18192272                            "type": [
    18202273                                "string",
    18212274                                "null"
    1822                             ]
     2275                            ],
     2276                            "format": "date-time",
     2277                            "required": false
    18232278                        },
    18242279                        "date_gmt": {
    1825                             "required": false,
    18262280                            "description": "The date the object was published, as GMT.",
    18272281                            "type": [
    18282282                                "string",
    18292283                                "null"
    1830                             ]
     2284                            ],
     2285                            "format": "date-time",
     2286                            "required": false
    18312287                        },
    18322288                        "slug": {
    1833                             "required": false,
    18342289                            "description": "An alphanumeric identifier for the object unique to its type.",
    1835                             "type": "string"
     2290                            "type": "string",
     2291                            "required": false
    18362292                        },
    18372293                        "status": {
    1838                             "required": false,
     2294                            "description": "A named status for the object.",
     2295                            "type": "string",
    18392296                            "enum": [
    18402297                                "publish",
     
    18442301                                "private"
    18452302                            ],
    1846                             "description": "A named status for the object.",
    1847                             "type": "string"
     2303                            "required": false
    18482304                        },
    18492305                        "password": {
    1850                             "required": false,
    18512306                            "description": "A password to protect access to the content and excerpt.",
    1852                             "type": "string"
     2307                            "type": "string",
     2308                            "required": false
    18532309                        },
    18542310                        "title": {
    1855                             "required": false,
    18562311                            "description": "The title for the object.",
    1857                             "type": "object"
     2312                            "type": "object",
     2313                            "properties": {
     2314                                "raw": {
     2315                                    "description": "Title for the object, as it exists in the database.",
     2316                                    "type": "string",
     2317                                    "context": [
     2318                                        "edit"
     2319                                    ]
     2320                                },
     2321                                "rendered": {
     2322                                    "description": "HTML title for the object, transformed for display.",
     2323                                    "type": "string",
     2324                                    "context": [
     2325                                        "view",
     2326                                        "edit",
     2327                                        "embed"
     2328                                    ],
     2329                                    "readonly": true
     2330                                }
     2331                            },
     2332                            "required": false
    18582333                        },
    18592334                        "content": {
    1860                             "required": false,
    18612335                            "description": "The content for the object.",
    1862                             "type": "object"
     2336                            "type": "object",
     2337                            "properties": {
     2338                                "raw": {
     2339                                    "description": "Content for the object, as it exists in the database.",
     2340                                    "type": "string",
     2341                                    "context": [
     2342                                        "edit"
     2343                                    ]
     2344                                },
     2345                                "rendered": {
     2346                                    "description": "HTML content for the object, transformed for display.",
     2347                                    "type": "string",
     2348                                    "context": [
     2349                                        "view",
     2350                                        "edit"
     2351                                    ],
     2352                                    "readonly": true
     2353                                },
     2354                                "block_version": {
     2355                                    "description": "Version of the content block format used by the object.",
     2356                                    "type": "integer",
     2357                                    "context": [
     2358                                        "edit"
     2359                                    ],
     2360                                    "readonly": true
     2361                                },
     2362                                "protected": {
     2363                                    "description": "Whether the content is protected with a password.",
     2364                                    "type": "boolean",
     2365                                    "context": [
     2366                                        "view",
     2367                                        "edit",
     2368                                        "embed"
     2369                                    ],
     2370                                    "readonly": true
     2371                                }
     2372                            },
     2373                            "required": false
    18632374                        },
    18642375                        "author": {
    1865                             "required": false,
    18662376                            "description": "The ID for the author of the object.",
    1867                             "type": "integer"
     2377                            "type": "integer",
     2378                            "required": false
    18682379                        },
    18692380                        "excerpt": {
    1870                             "required": false,
    18712381                            "description": "The excerpt for the object.",
    1872                             "type": "object"
     2382                            "type": "object",
     2383                            "properties": {
     2384                                "raw": {
     2385                                    "description": "Excerpt for the object, as it exists in the database.",
     2386                                    "type": "string",
     2387                                    "context": [
     2388                                        "edit"
     2389                                    ]
     2390                                },
     2391                                "rendered": {
     2392                                    "description": "HTML excerpt for the object, transformed for display.",
     2393                                    "type": "string",
     2394                                    "context": [
     2395                                        "view",
     2396                                        "edit",
     2397                                        "embed"
     2398                                    ],
     2399                                    "readonly": true
     2400                                },
     2401                                "protected": {
     2402                                    "description": "Whether the excerpt is protected with a password.",
     2403                                    "type": "boolean",
     2404                                    "context": [
     2405                                        "view",
     2406                                        "edit",
     2407                                        "embed"
     2408                                    ],
     2409                                    "readonly": true
     2410                                }
     2411                            },
     2412                            "required": false
    18732413                        },
    18742414                        "featured_media": {
    1875                             "required": false,
    18762415                            "description": "The ID of the featured media for the object.",
    1877                             "type": "integer"
     2416                            "type": "integer",
     2417                            "required": false
    18782418                        },
    18792419                        "comment_status": {
    1880                             "required": false,
     2420                            "description": "Whether or not comments are open on the object.",
     2421                            "type": "string",
    18812422                            "enum": [
    18822423                                "open",
    18832424                                "closed"
    18842425                            ],
    1885                             "description": "Whether or not comments are open on the object.",
    1886                             "type": "string"
     2426                            "required": false
    18872427                        },
    18882428                        "ping_status": {
    1889                             "required": false,
     2429                            "description": "Whether or not the object can be pinged.",
     2430                            "type": "string",
    18902431                            "enum": [
    18912432                                "open",
    18922433                                "closed"
    18932434                            ],
    1894                             "description": "Whether or not the object can be pinged.",
    1895                             "type": "string"
     2435                            "required": false
    18962436                        },
    18972437                        "menu_order": {
    1898                             "required": false,
    18992438                            "description": "The order of the object in relation to other object of its type.",
    1900                             "type": "integer"
     2439                            "type": "integer",
     2440                            "required": false
    19012441                        },
    19022442                        "meta": {
    1903                             "required": false,
    19042443                            "description": "Meta fields.",
    1905                             "type": "object"
     2444                            "type": "object",
     2445                            "properties": [],
     2446                            "required": false
    19062447                        },
    19072448                        "template": {
    1908                             "required": false,
    19092449                            "description": "The theme file to use to display the object.",
    1910                             "type": "string"
     2450                            "type": "string",
     2451                            "required": false
    19112452                        }
    19122453                    }
     
    19262467                    "args": {
    19272468                        "parent": {
    1928                             "required": false,
    19292469                            "description": "The ID for the parent of the object.",
    1930                             "type": "integer"
     2470                            "type": "integer",
     2471                            "required": false
    19312472                        },
    19322473                        "id": {
    1933                             "required": false,
    19342474                            "description": "The ID for the object.",
    1935                             "type": "integer"
     2475                            "type": "integer",
     2476                            "required": false
    19362477                        },
    19372478                        "context": {
    1938                             "required": false,
    1939                             "default": "view",
     2479                            "description": "Scope under which the request is made; determines fields present in response.",
     2480                            "type": "string",
    19402481                            "enum": [
    19412482                                "view",
     
    19432484                                "edit"
    19442485                            ],
    1945                             "description": "Scope under which the request is made; determines fields present in response.",
    1946                             "type": "string"
     2486                            "default": "view",
     2487                            "required": false
    19472488                        }
    19482489                    }
     
    19632504                    "args": {
    19642505                        "context": {
    1965                             "required": false,
    1966                             "default": "view",
     2506                            "description": "Scope under which the request is made; determines fields present in response.",
     2507                            "type": "string",
    19672508                            "enum": [
    19682509                                "view",
     
    19702511                                "edit"
    19712512                            ],
    1972                             "description": "Scope under which the request is made; determines fields present in response.",
    1973                             "type": "string"
     2513                            "default": "view",
     2514                            "required": false
    19742515                        },
    19752516                        "page": {
    1976                             "required": false,
     2517                            "description": "Current page of the collection.",
     2518                            "type": "integer",
    19772519                            "default": 1,
    1978                             "description": "Current page of the collection.",
    1979                             "type": "integer"
     2520                            "minimum": 1,
     2521                            "required": false
    19802522                        },
    19812523                        "per_page": {
    1982                             "required": false,
     2524                            "description": "Maximum number of items to be returned in result set.",
     2525                            "type": "integer",
    19832526                            "default": 10,
    1984                             "description": "Maximum number of items to be returned in result set.",
    1985                             "type": "integer"
     2527                            "minimum": 1,
     2528                            "maximum": 100,
     2529                            "required": false
    19862530                        },
    19872531                        "search": {
    1988                             "required": false,
    19892532                            "description": "Limit results to those matching a string.",
    1990                             "type": "string"
     2533                            "type": "string",
     2534                            "required": false
    19912535                        },
    19922536                        "after": {
    1993                             "required": false,
    19942537                            "description": "Limit response to posts published after a given ISO8601 compliant date.",
    1995                             "type": "string"
     2538                            "type": "string",
     2539                            "format": "date-time",
     2540                            "required": false
    19962541                        },
    19972542                        "author": {
    1998                             "required": false,
    1999                             "default": [],
    20002543                            "description": "Limit result set to posts assigned to specific authors.",
    20012544                            "type": "array",
    20022545                            "items": {
    20032546                                "type": "integer"
    2004                             }
     2547                            },
     2548                            "default": [],
     2549                            "required": false
    20052550                        },
    20062551                        "author_exclude": {
    2007                             "required": false,
    2008                             "default": [],
    20092552                            "description": "Ensure result set excludes posts assigned to specific authors.",
    20102553                            "type": "array",
    20112554                            "items": {
    20122555                                "type": "integer"
    2013                             }
     2556                            },
     2557                            "default": [],
     2558                            "required": false
    20142559                        },
    20152560                        "before": {
    2016                             "required": false,
    20172561                            "description": "Limit response to posts published before a given ISO8601 compliant date.",
    2018                             "type": "string"
     2562                            "type": "string",
     2563                            "format": "date-time",
     2564                            "required": false
    20192565                        },
    20202566                        "exclude": {
    2021                             "required": false,
    2022                             "default": [],
    20232567                            "description": "Ensure result set excludes specific IDs.",
    20242568                            "type": "array",
    20252569                            "items": {
    20262570                                "type": "integer"
    2027                             }
     2571                            },
     2572                            "default": [],
     2573                            "required": false
    20282574                        },
    20292575                        "include": {
    2030                             "required": false,
    2031                             "default": [],
    20322576                            "description": "Limit result set to specific IDs.",
    20332577                            "type": "array",
    20342578                            "items": {
    20352579                                "type": "integer"
    2036                             }
     2580                            },
     2581                            "default": [],
     2582                            "required": false
    20372583                        },
    20382584                        "offset": {
    2039                             "required": false,
    20402585                            "description": "Offset the result set by a specific number of items.",
    2041                             "type": "integer"
     2586                            "type": "integer",
     2587                            "required": false
    20422588                        },
    20432589                        "order": {
    2044                             "required": false,
     2590                            "description": "Order sort attribute ascending or descending.",
     2591                            "type": "string",
    20452592                            "default": "desc",
    20462593                            "enum": [
     
    20482595                                "desc"
    20492596                            ],
    2050                             "description": "Order sort attribute ascending or descending.",
    2051                             "type": "string"
     2597                            "required": false
    20522598                        },
    20532599                        "orderby": {
    2054                             "required": false,
     2600                            "description": "Sort collection by object attribute.",
     2601                            "type": "string",
    20552602                            "default": "date",
    20562603                            "enum": [
     
    20662613                                "title"
    20672614                            ],
    2068                             "description": "Sort collection by object attribute.",
    2069                             "type": "string"
     2615                            "required": false
    20702616                        },
    20712617                        "parent": {
    2072                             "required": false,
    2073                             "default": [],
    20742618                            "description": "Limit result set to items with particular parent IDs.",
    20752619                            "type": "array",
    20762620                            "items": {
    20772621                                "type": "integer"
    2078                             }
     2622                            },
     2623                            "default": [],
     2624                            "required": false
    20792625                        },
    20802626                        "parent_exclude": {
    2081                             "required": false,
    2082                             "default": [],
    20832627                            "description": "Limit result set to all items except those of a particular parent ID.",
    20842628                            "type": "array",
    20852629                            "items": {
    20862630                                "type": "integer"
    2087                             }
     2631                            },
     2632                            "default": [],
     2633                            "required": false
    20882634                        },
    20892635                        "slug": {
    2090                             "required": false,
    20912636                            "description": "Limit result set to posts with one or more specific slugs.",
    20922637                            "type": "array",
    20932638                            "items": {
    20942639                                "type": "string"
    2095                             }
     2640                            },
     2641                            "required": false
    20962642                        },
    20972643                        "status": {
    2098                             "required": false,
    20992644                            "default": "inherit",
    21002645                            "description": "Limit result set to posts assigned one or more statuses.",
     
    21072652                                ],
    21082653                                "type": "string"
    2109                             }
     2654                            },
     2655                            "required": false
    21102656                        },
    21112657                        "media_type": {
    2112                             "required": false,
     2658                            "default": null,
     2659                            "description": "Limit result set to attachments of a particular media type.",
     2660                            "type": "string",
    21132661                            "enum": [
    21142662                                "image",
     
    21182666                                "audio"
    21192667                            ],
    2120                             "description": "Limit result set to attachments of a particular media type.",
    2121                             "type": "string"
     2668                            "required": false
    21222669                        },
    21232670                        "mime_type": {
    2124                             "required": false,
     2671                            "default": null,
    21252672                            "description": "Limit result set to attachments of a particular MIME type.",
    2126                             "type": "string"
     2673                            "type": "string",
     2674                            "required": false
    21272675                        }
    21282676                    }
     
    21342682                    "args": {
    21352683                        "date": {
    2136                             "required": false,
    21372684                            "description": "The date the object was published, in the site's timezone.",
    21382685                            "type": [
    21392686                                "string",
    21402687                                "null"
    2141                             ]
     2688                            ],
     2689                            "format": "date-time",
     2690                            "required": false
    21422691                        },
    21432692                        "date_gmt": {
    2144                             "required": false,
    21452693                            "description": "The date the object was published, as GMT.",
    21462694                            "type": [
    21472695                                "string",
    21482696                                "null"
    2149                             ]
     2697                            ],
     2698                            "format": "date-time",
     2699                            "required": false
    21502700                        },
    21512701                        "slug": {
    2152                             "required": false,
    21532702                            "description": "An alphanumeric identifier for the object unique to its type.",
    2154                             "type": "string"
     2703                            "type": "string",
     2704                            "required": false
    21552705                        },
    21562706                        "status": {
    2157                             "required": false,
     2707                            "description": "A named status for the object.",
     2708                            "type": "string",
    21582709                            "enum": [
    21592710                                "publish",
     
    21632714                                "private"
    21642715                            ],
    2165                             "description": "A named status for the object.",
    2166                             "type": "string"
     2716                            "required": false
    21672717                        },
    21682718                        "title": {
    2169                             "required": false,
    21702719                            "description": "The title for the object.",
    2171                             "type": "object"
     2720                            "type": "object",
     2721                            "properties": {
     2722                                "raw": {
     2723                                    "description": "Title for the object, as it exists in the database.",
     2724                                    "type": "string",
     2725                                    "context": [
     2726                                        "edit"
     2727                                    ]
     2728                                },
     2729                                "rendered": {
     2730                                    "description": "HTML title for the object, transformed for display.",
     2731                                    "type": "string",
     2732                                    "context": [
     2733                                        "view",
     2734                                        "edit",
     2735                                        "embed"
     2736                                    ],
     2737                                    "readonly": true
     2738                                }
     2739                            },
     2740                            "required": false
    21722741                        },
    21732742                        "author": {
    2174                             "required": false,
    21752743                            "description": "The ID for the author of the object.",
    2176                             "type": "integer"
     2744                            "type": "integer",
     2745                            "required": false
    21772746                        },
    21782747                        "comment_status": {
    2179                             "required": false,
     2748                            "description": "Whether or not comments are open on the object.",
     2749                            "type": "string",
    21802750                            "enum": [
    21812751                                "open",
    21822752                                "closed"
    21832753                            ],
    2184                             "description": "Whether or not comments are open on the object.",
    2185                             "type": "string"
     2754                            "required": false
    21862755                        },
    21872756                        "ping_status": {
    2188                             "required": false,
     2757                            "description": "Whether or not the object can be pinged.",
     2758                            "type": "string",
    21892759                            "enum": [
    21902760                                "open",
    21912761                                "closed"
    21922762                            ],
    2193                             "description": "Whether or not the object can be pinged.",
    2194                             "type": "string"
     2763                            "required": false
    21952764                        },
    21962765                        "meta": {
    2197                             "required": false,
    21982766                            "description": "Meta fields.",
    2199                             "type": "object"
     2767                            "type": "object",
     2768                            "properties": [],
     2769                            "required": false
    22002770                        },
    22012771                        "template": {
    2202                             "required": false,
    22032772                            "description": "The theme file to use to display the object.",
    2204                             "type": "string"
     2773                            "type": "string",
     2774                            "required": false
    22052775                        },
    22062776                        "alt_text": {
    2207                             "required": false,
    22082777                            "description": "Alternative text to display when attachment is not displayed.",
    2209                             "type": "string"
     2778                            "type": "string",
     2779                            "required": false
    22102780                        },
    22112781                        "caption": {
    2212                             "required": false,
    22132782                            "description": "The attachment caption.",
    2214                             "type": "object"
     2783                            "type": "object",
     2784                            "properties": {
     2785                                "raw": {
     2786                                    "description": "Caption for the attachment, as it exists in the database.",
     2787                                    "type": "string",
     2788                                    "context": [
     2789                                        "edit"
     2790                                    ]
     2791                                },
     2792                                "rendered": {
     2793                                    "description": "HTML caption for the attachment, transformed for display.",
     2794                                    "type": "string",
     2795                                    "context": [
     2796                                        "view",
     2797                                        "edit",
     2798                                        "embed"
     2799                                    ],
     2800                                    "readonly": true
     2801                                }
     2802                            },
     2803                            "required": false
    22152804                        },
    22162805                        "description": {
    2217                             "required": false,
    22182806                            "description": "The attachment description.",
    2219                             "type": "object"
     2807                            "type": "object",
     2808                            "properties": {
     2809                                "raw": {
     2810                                    "description": "Description for the object, as it exists in the database.",
     2811                                    "type": "string",
     2812                                    "context": [
     2813                                        "edit"
     2814                                    ]
     2815                                },
     2816                                "rendered": {
     2817                                    "description": "HTML description for the object, transformed for display.",
     2818                                    "type": "string",
     2819                                    "context": [
     2820                                        "view",
     2821                                        "edit"
     2822                                    ],
     2823                                    "readonly": true
     2824                                }
     2825                            },
     2826                            "required": false
    22202827                        },
    22212828                        "post": {
    2222                             "required": false,
    22232829                            "description": "The ID for the associated post of the attachment.",
    2224                             "type": "integer"
     2830                            "type": "integer",
     2831                            "required": false
    22252832                        }
    22262833                    }
     
    22472854                    "args": {
    22482855                        "id": {
    2249                             "required": false,
    22502856                            "description": "Unique identifier for the object.",
    2251                             "type": "integer"
     2857                            "type": "integer",
     2858                            "required": false
    22522859                        },
    22532860                        "context": {
    2254                             "required": false,
    2255                             "default": "view",
     2861                            "description": "Scope under which the request is made; determines fields present in response.",
     2862                            "type": "string",
    22562863                            "enum": [
    22572864                                "view",
     
    22592866                                "edit"
    22602867                            ],
    2261                             "description": "Scope under which the request is made; determines fields present in response.",
    2262                             "type": "string"
     2868                            "default": "view",
     2869                            "required": false
    22632870                        }
    22642871                    }
     
    22722879                    "args": {
    22732880                        "id": {
    2274                             "required": false,
    22752881                            "description": "Unique identifier for the object.",
    2276                             "type": "integer"
     2882                            "type": "integer",
     2883                            "required": false
    22772884                        },
    22782885                        "date": {
    2279                             "required": false,
    22802886                            "description": "The date the object was published, in the site's timezone.",
    22812887                            "type": [
    22822888                                "string",
    22832889                                "null"
    2284                             ]
     2890                            ],
     2891                            "format": "date-time",
     2892                            "required": false
    22852893                        },
    22862894                        "date_gmt": {
    2287                             "required": false,
    22882895                            "description": "The date the object was published, as GMT.",
    22892896                            "type": [
    22902897                                "string",
    22912898                                "null"
    2292                             ]
     2899                            ],
     2900                            "format": "date-time",
     2901                            "required": false
    22932902                        },
    22942903                        "slug": {
    2295                             "required": false,
    22962904                            "description": "An alphanumeric identifier for the object unique to its type.",
    2297                             "type": "string"
     2905                            "type": "string",
     2906                            "required": false
    22982907                        },
    22992908                        "status": {
    2300                             "required": false,
     2909                            "description": "A named status for the object.",
     2910                            "type": "string",
    23012911                            "enum": [
    23022912                                "publish",
     
    23062916                                "private"
    23072917                            ],
    2308                             "description": "A named status for the object.",
    2309                             "type": "string"
     2918                            "required": false
    23102919                        },
    23112920                        "title": {
    2312                             "required": false,
    23132921                            "description": "The title for the object.",
    2314                             "type": "object"
     2922                            "type": "object",
     2923                            "properties": {
     2924                                "raw": {
     2925                                    "description": "Title for the object, as it exists in the database.",
     2926                                    "type": "string",
     2927                                    "context": [
     2928                                        "edit"
     2929                                    ]
     2930                                },
     2931                                "rendered": {
     2932                                    "description": "HTML title for the object, transformed for display.",
     2933                                    "type": "string",
     2934                                    "context": [
     2935                                        "view",
     2936                                        "edit",
     2937                                        "embed"
     2938                                    ],
     2939                                    "readonly": true
     2940                                }
     2941                            },
     2942                            "required": false
    23152943                        },
    23162944                        "author": {
    2317                             "required": false,
    23182945                            "description": "The ID for the author of the object.",
    2319                             "type": "integer"
     2946                            "type": "integer",
     2947                            "required": false
    23202948                        },
    23212949                        "comment_status": {
    2322                             "required": false,
     2950                            "description": "Whether or not comments are open on the object.",
     2951                            "type": "string",
    23232952                            "enum": [
    23242953                                "open",
    23252954                                "closed"
    23262955                            ],
    2327                             "description": "Whether or not comments are open on the object.",
    2328                             "type": "string"
     2956                            "required": false
    23292957                        },
    23302958                        "ping_status": {
    2331                             "required": false,
     2959                            "description": "Whether or not the object can be pinged.",
     2960                            "type": "string",
    23322961                            "enum": [
    23332962                                "open",
    23342963                                "closed"
    23352964                            ],
    2336                             "description": "Whether or not the object can be pinged.",
    2337                             "type": "string"
     2965                            "required": false
    23382966                        },
    23392967                        "meta": {
    2340                             "required": false,
    23412968                            "description": "Meta fields.",
    2342                             "type": "object"
     2969                            "type": "object",
     2970                            "properties": [],
     2971                            "required": false
    23432972                        },
    23442973                        "template": {
    2345                             "required": false,
    23462974                            "description": "The theme file to use to display the object.",
    2347                             "type": "string"
     2975                            "type": "string",
     2976                            "required": false
    23482977                        },
    23492978                        "alt_text": {
    2350                             "required": false,
    23512979                            "description": "Alternative text to display when attachment is not displayed.",
    2352                             "type": "string"
     2980                            "type": "string",
     2981                            "required": false
    23532982                        },
    23542983                        "caption": {
    2355                             "required": false,
    23562984                            "description": "The attachment caption.",
    2357                             "type": "object"
     2985                            "type": "object",
     2986                            "properties": {
     2987                                "raw": {
     2988                                    "description": "Caption for the attachment, as it exists in the database.",
     2989                                    "type": "string",
     2990                                    "context": [
     2991                                        "edit"
     2992                                    ]
     2993                                },
     2994                                "rendered": {
     2995                                    "description": "HTML caption for the attachment, transformed for display.",
     2996                                    "type": "string",
     2997                                    "context": [
     2998                                        "view",
     2999                                        "edit",
     3000                                        "embed"
     3001                                    ],
     3002                                    "readonly": true
     3003                                }
     3004                            },
     3005                            "required": false
    23583006                        },
    23593007                        "description": {
    2360                             "required": false,
    23613008                            "description": "The attachment description.",
    2362                             "type": "object"
     3009                            "type": "object",
     3010                            "properties": {
     3011                                "raw": {
     3012                                    "description": "Description for the object, as it exists in the database.",
     3013                                    "type": "string",
     3014                                    "context": [
     3015                                        "edit"
     3016                                    ]
     3017                                },
     3018                                "rendered": {
     3019                                    "description": "HTML description for the object, transformed for display.",
     3020                                    "type": "string",
     3021                                    "context": [
     3022                                        "view",
     3023                                        "edit"
     3024                                    ],
     3025                                    "readonly": true
     3026                                }
     3027                            },
     3028                            "required": false
    23633029                        },
    23643030                        "post": {
    2365                             "required": false,
    23663031                            "description": "The ID for the associated post of the attachment.",
    2367                             "type": "integer"
     3032                            "type": "integer",
     3033                            "required": false
    23683034                        }
    23693035                    }
     
    23753041                    "args": {
    23763042                        "id": {
    2377                             "required": false,
    23783043                            "description": "Unique identifier for the object.",
    2379                             "type": "integer"
     3044                            "type": "integer",
     3045                            "required": false
    23803046                        },
    23813047                        "force": {
    2382                             "required": false,
     3048                            "type": "boolean",
    23833049                            "default": false,
    23843050                            "description": "Whether to bypass Trash and force deletion.",
    2385                             "type": "boolean"
     3051                            "required": false
    23863052                        }
    23873053                    }
     
    24013067                    "args": {
    24023068                        "id": {
    2403                             "required": false,
    24043069                            "description": "Unique identifier for the object.",
    2405                             "type": "integer"
     3070                            "type": "integer",
     3071                            "required": false
    24063072                        },
    24073073                        "action": {
    2408                             "required": true,
     3074                            "type": "string",
    24093075                            "enum": [
    24103076                                "create-image-subsizes"
    24113077                            ],
    2412                             "type": "string"
     3078                            "required": true
    24133079                        }
    24143080                    }
     
    24283094                    "args": {
    24293095                        "rotation": {
    2430                             "required": false,
    24313096                            "description": "The amount to rotate the image clockwise in degrees.",
    2432                             "type": "integer"
     3097                            "type": "integer",
     3098                            "minimum": 0,
     3099                            "exclusiveMinimum": true,
     3100                            "maximum": 360,
     3101                            "exclusiveMaximum": true,
     3102                            "required": false
    24333103                        },
    24343104                        "x": {
    2435                             "required": false,
    24363105                            "description": "As a percentage of the image, the x position to start the crop from.",
    2437                             "type": "number"
     3106                            "type": "number",
     3107                            "minimum": 0,
     3108                            "maximum": 100,
     3109                            "required": false
    24383110                        },
    24393111                        "y": {
    2440                             "required": false,
    24413112                            "description": "As a percentage of the image, the y position to start the crop from.",
    2442                             "type": "number"
     3113                            "type": "number",
     3114                            "minimum": 0,
     3115                            "maximum": 100,
     3116                            "required": false
    24433117                        },
    24443118                        "width": {
    2445                             "required": false,
    24463119                            "description": "As a percentage of the image, the width to crop the image to.",
    2447                             "type": "number"
     3120                            "type": "number",
     3121                            "minimum": 0,
     3122                            "maximum": 100,
     3123                            "required": false
    24483124                        },
    24493125                        "height": {
    2450                             "required": false,
    24513126                            "description": "As a percentage of the image, the height to crop the image to.",
    2452                             "type": "number"
     3127                            "type": "number",
     3128                            "minimum": 0,
     3129                            "maximum": 100,
     3130                            "required": false
    24533131                        },
    24543132                        "src": {
    2455                             "required": true,
    24563133                            "description": "URL to the edited image file.",
    2457                             "type": "string"
     3134                            "type": "string",
     3135                            "format": "uri",
     3136                            "required": true
    24583137                        }
    24593138                    }
     
    24743153                    "args": {
    24753154                        "context": {
    2476                             "required": false,
    2477                             "default": "view",
     3155                            "description": "Scope under which the request is made; determines fields present in response.",
     3156                            "type": "string",
    24783157                            "enum": [
    24793158                                "view",
     
    24813160                                "edit"
    24823161                            ],
    2483                             "description": "Scope under which the request is made; determines fields present in response.",
    2484                             "type": "string"
     3162                            "default": "view",
     3163                            "required": false
    24853164                        },
    24863165                        "page": {
    2487                             "required": false,
     3166                            "description": "Current page of the collection.",
     3167                            "type": "integer",
    24883168                            "default": 1,
    2489                             "description": "Current page of the collection.",
    2490                             "type": "integer"
     3169                            "minimum": 1,
     3170                            "required": false
    24913171                        },
    24923172                        "per_page": {
    2493                             "required": false,
     3173                            "description": "Maximum number of items to be returned in result set.",
     3174                            "type": "integer",
    24943175                            "default": 10,
    2495                             "description": "Maximum number of items to be returned in result set.",
    2496                             "type": "integer"
     3176                            "minimum": 1,
     3177                            "maximum": 100,
     3178                            "required": false
    24973179                        },
    24983180                        "search": {
    2499                             "required": false,
    25003181                            "description": "Limit results to those matching a string.",
    2501                             "type": "string"
     3182                            "type": "string",
     3183                            "required": false
    25023184                        },
    25033185                        "after": {
    2504                             "required": false,
    25053186                            "description": "Limit response to posts published after a given ISO8601 compliant date.",
    2506                             "type": "string"
     3187                            "type": "string",
     3188                            "format": "date-time",
     3189                            "required": false
    25073190                        },
    25083191                        "before": {
    2509                             "required": false,
    25103192                            "description": "Limit response to posts published before a given ISO8601 compliant date.",
    2511                             "type": "string"
     3193                            "type": "string",
     3194                            "format": "date-time",
     3195                            "required": false
    25123196                        },
    25133197                        "exclude": {
    2514                             "required": false,
    2515                             "default": [],
    25163198                            "description": "Ensure result set excludes specific IDs.",
    25173199                            "type": "array",
    25183200                            "items": {
    25193201                                "type": "integer"
    2520                             }
     3202                            },
     3203                            "default": [],
     3204                            "required": false
    25213205                        },
    25223206                        "include": {
    2523                             "required": false,
    2524                             "default": [],
    25253207                            "description": "Limit result set to specific IDs.",
    25263208                            "type": "array",
    25273209                            "items": {
    25283210                                "type": "integer"
    2529                             }
     3211                            },
     3212                            "default": [],
     3213                            "required": false
    25303214                        },
    25313215                        "offset": {
    2532                             "required": false,
    25333216                            "description": "Offset the result set by a specific number of items.",
    2534                             "type": "integer"
     3217                            "type": "integer",
     3218                            "required": false
    25353219                        },
    25363220                        "order": {
    2537                             "required": false,
     3221                            "description": "Order sort attribute ascending or descending.",
     3222                            "type": "string",
    25383223                            "default": "desc",
    25393224                            "enum": [
     
    25413226                                "desc"
    25423227                            ],
    2543                             "description": "Order sort attribute ascending or descending.",
    2544                             "type": "string"
     3228                            "required": false
    25453229                        },
    25463230                        "orderby": {
    2547                             "required": false,
     3231                            "description": "Sort collection by object attribute.",
     3232                            "type": "string",
    25483233                            "default": "date",
    25493234                            "enum": [
     
    25593244                                "title"
    25603245                            ],
    2561                             "description": "Sort collection by object attribute.",
    2562                             "type": "string"
     3246                            "required": false
    25633247                        },
    25643248                        "slug": {
    2565                             "required": false,
    25663249                            "description": "Limit result set to posts with one or more specific slugs.",
    25673250                            "type": "array",
    25683251                            "items": {
    25693252                                "type": "string"
    2570                             }
     3253                            },
     3254                            "required": false
    25713255                        },
    25723256                        "status": {
    2573                             "required": false,
    25743257                            "default": "publish",
    25753258                            "description": "Limit result set to posts assigned one or more statuses.",
     
    25923275                                ],
    25933276                                "type": "string"
    2594                             }
     3277                            },
     3278                            "required": false
    25953279                        }
    25963280                    }
     
    26023286                    "args": {
    26033287                        "date": {
    2604                             "required": false,
    26053288                            "description": "The date the object was published, in the site's timezone.",
    26063289                            "type": [
    26073290                                "string",
    26083291                                "null"
    2609                             ]
     3292                            ],
     3293                            "format": "date-time",
     3294                            "required": false
    26103295                        },
    26113296                        "date_gmt": {
    2612                             "required": false,
    26133297                            "description": "The date the object was published, as GMT.",
    26143298                            "type": [
    26153299                                "string",
    26163300                                "null"
    2617                             ]
     3301                            ],
     3302                            "format": "date-time",
     3303                            "required": false
    26183304                        },
    26193305                        "slug": {
    2620                             "required": false,
    26213306                            "description": "An alphanumeric identifier for the object unique to its type.",
    2622                             "type": "string"
     3307                            "type": "string",
     3308                            "required": false
    26233309                        },
    26243310                        "status": {
    2625                             "required": false,
     3311                            "description": "A named status for the object.",
     3312                            "type": "string",
    26263313                            "enum": [
    26273314                                "publish",
     
    26313318                                "private"
    26323319                            ],
    2633                             "description": "A named status for the object.",
    2634                             "type": "string"
     3320                            "required": false
    26353321                        },
    26363322                        "password": {
    2637                             "required": false,
    26383323                            "description": "A password to protect access to the content and excerpt.",
    2639                             "type": "string"
     3324                            "type": "string",
     3325                            "required": false
    26403326                        },
    26413327                        "title": {
    2642                             "required": false,
    26433328                            "description": "The title for the object.",
    2644                             "type": "object"
     3329                            "type": "object",
     3330                            "properties": {
     3331                                "raw": {
     3332                                    "description": "Title for the object, as it exists in the database.",
     3333                                    "type": "string",
     3334                                    "context": [
     3335                                        "view",
     3336                                        "edit"
     3337                                    ]
     3338                                }
     3339                            },
     3340                            "required": false
    26453341                        },
    26463342                        "content": {
    2647                             "required": false,
    26483343                            "description": "The content for the object.",
    2649                             "type": "object"
     3344                            "type": "object",
     3345                            "properties": {
     3346                                "raw": {
     3347                                    "description": "Content for the object, as it exists in the database.",
     3348                                    "type": "string",
     3349                                    "context": [
     3350                                        "view",
     3351                                        "edit"
     3352                                    ]
     3353                                },
     3354                                "block_version": {
     3355                                    "description": "Version of the content block format used by the object.",
     3356                                    "type": "integer",
     3357                                    "context": [
     3358                                        "edit"
     3359                                    ],
     3360                                    "readonly": true
     3361                                },
     3362                                "protected": {
     3363                                    "description": "Whether the content is protected with a password.",
     3364                                    "type": "boolean",
     3365                                    "context": [
     3366                                        "view",
     3367                                        "edit",
     3368                                        "embed"
     3369                                    ],
     3370                                    "readonly": true
     3371                                }
     3372                            },
     3373                            "required": false
    26503374                        },
    26513375                        "template": {
    2652                             "required": false,
    26533376                            "description": "The theme file to use to display the object.",
    2654                             "type": "string"
     3377                            "type": "string",
     3378                            "required": false
    26553379                        }
    26563380                    }
     
    26773401                    "args": {
    26783402                        "id": {
    2679                             "required": false,
    26803403                            "description": "Unique identifier for the object.",
    2681                             "type": "integer"
     3404                            "type": "integer",
     3405                            "required": false
    26823406                        },
    26833407                        "context": {
    2684                             "required": false,
    2685                             "default": "view",
     3408                            "description": "Scope under which the request is made; determines fields present in response.",
     3409                            "type": "string",
    26863410                            "enum": [
    26873411                                "view",
     
    26893413                                "edit"
    26903414                            ],
    2691                             "description": "Scope under which the request is made; determines fields present in response.",
    2692                             "type": "string"
     3415                            "default": "view",
     3416                            "required": false
    26933417                        },
    26943418                        "password": {
    2695                             "required": false,
    26963419                            "description": "The password for the post if it is password protected.",
    2697                             "type": "string"
     3420                            "type": "string",
     3421                            "required": false
    26983422                        }
    26993423                    }
     
    27073431                    "args": {
    27083432                        "id": {
    2709                             "required": false,
    27103433                            "description": "Unique identifier for the object.",
    2711                             "type": "integer"
     3434                            "type": "integer",
     3435                            "required": false
    27123436                        },
    27133437                        "date": {
    2714                             "required": false,
    27153438                            "description": "The date the object was published, in the site's timezone.",
    27163439                            "type": [
    27173440                                "string",
    27183441                                "null"
    2719                             ]
     3442                            ],
     3443                            "format": "date-time",
     3444                            "required": false
    27203445                        },
    27213446                        "date_gmt": {
    2722                             "required": false,
    27233447                            "description": "The date the object was published, as GMT.",
    27243448                            "type": [
    27253449                                "string",
    27263450                                "null"
    2727                             ]
     3451                            ],
     3452                            "format": "date-time",
     3453                            "required": false
    27283454                        },
    27293455                        "slug": {
    2730                             "required": false,
    27313456                            "description": "An alphanumeric identifier for the object unique to its type.",
    2732                             "type": "string"
     3457                            "type": "string",
     3458                            "required": false
    27333459                        },
    27343460                        "status": {
    2735                             "required": false,
     3461                            "description": "A named status for the object.",
     3462                            "type": "string",
    27363463                            "enum": [
    27373464                                "publish",
     
    27413468                                "private"
    27423469                            ],
    2743                             "description": "A named status for the object.",
    2744                             "type": "string"
     3470                            "required": false
    27453471                        },
    27463472                        "password": {
    2747                             "required": false,
    27483473                            "description": "A password to protect access to the content and excerpt.",
    2749                             "type": "string"
     3474                            "type": "string",
     3475                            "required": false
    27503476                        },
    27513477                        "title": {
    2752                             "required": false,
    27533478                            "description": "The title for the object.",
    2754                             "type": "object"
     3479                            "type": "object",
     3480                            "properties": {
     3481                                "raw": {
     3482                                    "description": "Title for the object, as it exists in the database.",
     3483                                    "type": "string",
     3484                                    "context": [
     3485                                        "view",
     3486                                        "edit"
     3487                                    ]
     3488                                }
     3489                            },
     3490                            "required": false
    27553491                        },
    27563492                        "content": {
    2757                             "required": false,
    27583493                            "description": "The content for the object.",
    2759                             "type": "object"
     3494                            "type": "object",
     3495                            "properties": {
     3496                                "raw": {
     3497                                    "description": "Content for the object, as it exists in the database.",
     3498                                    "type": "string",
     3499                                    "context": [
     3500                                        "view",
     3501                                        "edit"
     3502                                    ]
     3503                                },
     3504                                "block_version": {
     3505                                    "description": "Version of the content block format used by the object.",
     3506                                    "type": "integer",
     3507                                    "context": [
     3508                                        "edit"
     3509                                    ],
     3510                                    "readonly": true
     3511                                },
     3512                                "protected": {
     3513                                    "description": "Whether the content is protected with a password.",
     3514                                    "type": "boolean",
     3515                                    "context": [
     3516                                        "view",
     3517                                        "edit",
     3518                                        "embed"
     3519                                    ],
     3520                                    "readonly": true
     3521                                }
     3522                            },
     3523                            "required": false
    27603524                        },
    27613525                        "template": {
    2762                             "required": false,
    27633526                            "description": "The theme file to use to display the object.",
    2764                             "type": "string"
     3527                            "type": "string",
     3528                            "required": false
    27653529                        }
    27663530                    }
     
    27723536                    "args": {
    27733537                        "id": {
    2774                             "required": false,
    27753538                            "description": "Unique identifier for the object.",
    2776                             "type": "integer"
     3539                            "type": "integer",
     3540                            "required": false
    27773541                        },
    27783542                        "force": {
    2779                             "required": false,
     3543                            "type": "boolean",
    27803544                            "default": false,
    27813545                            "description": "Whether to bypass Trash and force deletion.",
    2782                             "type": "boolean"
     3546                            "required": false
    27833547                        }
    27843548                    }
     
    27993563                    "args": {
    28003564                        "parent": {
    2801                             "required": false,
    28023565                            "description": "The ID for the parent of the object.",
    2803                             "type": "integer"
     3566                            "type": "integer",
     3567                            "required": false
    28043568                        },
    28053569                        "context": {
    2806                             "required": false,
    2807                             "default": "view",
     3570                            "description": "Scope under which the request is made; determines fields present in response.",
     3571                            "type": "string",
    28083572                            "enum": [
    28093573                                "view",
     
    28113575                                "edit"
    28123576                            ],
    2813                             "description": "Scope under which the request is made; determines fields present in response.",
    2814                             "type": "string"
     3577                            "default": "view",
     3578                            "required": false
    28153579                        }
    28163580                    }
     
    28223586                    "args": {
    28233587                        "parent": {
    2824                             "required": false,
    28253588                            "description": "The ID for the parent of the object.",
    2826                             "type": "integer"
     3589                            "type": "integer",
     3590                            "required": false
    28273591                        },
    28283592                        "date": {
    2829                             "required": false,
    28303593                            "description": "The date the object was published, in the site's timezone.",
    28313594                            "type": [
    28323595                                "string",
    28333596                                "null"
    2834                             ]
     3597                            ],
     3598                            "format": "date-time",
     3599                            "required": false
    28353600                        },
    28363601                        "date_gmt": {
    2837                             "required": false,
    28383602                            "description": "The date the object was published, as GMT.",
    28393603                            "type": [
    28403604                                "string",
    28413605                                "null"
    2842                             ]
     3606                            ],
     3607                            "format": "date-time",
     3608                            "required": false
    28433609                        },
    28443610                        "slug": {
    2845                             "required": false,
    28463611                            "description": "An alphanumeric identifier for the object unique to its type.",
    2847                             "type": "string"
     3612                            "type": "string",
     3613                            "required": false
    28483614                        },
    28493615                        "status": {
    2850                             "required": false,
     3616                            "description": "A named status for the object.",
     3617                            "type": "string",
    28513618                            "enum": [
    28523619                                "publish",
     
    28563623                                "private"
    28573624                            ],
    2858                             "description": "A named status for the object.",
    2859                             "type": "string"
     3625                            "required": false
    28603626                        },
    28613627                        "password": {
    2862                             "required": false,
    28633628                            "description": "A password to protect access to the content and excerpt.",
    2864                             "type": "string"
     3629                            "type": "string",
     3630                            "required": false
    28653631                        },
    28663632                        "title": {
    2867                             "required": false,
    28683633                            "description": "The title for the object.",
    2869                             "type": "object"
     3634                            "type": "object",
     3635                            "properties": {
     3636                                "raw": {
     3637                                    "description": "Title for the object, as it exists in the database.",
     3638                                    "type": "string",
     3639                                    "context": [
     3640                                        "view",
     3641                                        "edit"
     3642                                    ]
     3643                                }
     3644                            },
     3645                            "required": false
    28703646                        },
    28713647                        "content": {
    2872                             "required": false,
    28733648                            "description": "The content for the object.",
    2874                             "type": "object"
     3649                            "type": "object",
     3650                            "properties": {
     3651                                "raw": {
     3652                                    "description": "Content for the object, as it exists in the database.",
     3653                                    "type": "string",
     3654                                    "context": [
     3655                                        "view",
     3656                                        "edit"
     3657                                    ]
     3658                                },
     3659                                "block_version": {
     3660                                    "description": "Version of the content block format used by the object.",
     3661                                    "type": "integer",
     3662                                    "context": [
     3663                                        "edit"
     3664                                    ],
     3665                                    "readonly": true
     3666                                },
     3667                                "protected": {
     3668                                    "description": "Whether the content is protected with a password.",
     3669                                    "type": "boolean",
     3670                                    "context": [
     3671                                        "view",
     3672                                        "edit",
     3673                                        "embed"
     3674                                    ],
     3675                                    "readonly": true
     3676                                }
     3677                            },
     3678                            "required": false
    28753679                        },
    28763680                        "template": {
    2877                             "required": false,
    28783681                            "description": "The theme file to use to display the object.",
    2879                             "type": "string"
     3682                            "type": "string",
     3683                            "required": false
    28803684                        }
    28813685                    }
     
    28953699                    "args": {
    28963700                        "parent": {
    2897                             "required": false,
    28983701                            "description": "The ID for the parent of the object.",
    2899                             "type": "integer"
     3702                            "type": "integer",
     3703                            "required": false
    29003704                        },
    29013705                        "id": {
    2902                             "required": false,
    29033706                            "description": "The ID for the object.",
    2904                             "type": "integer"
     3707                            "type": "integer",
     3708                            "required": false
    29053709                        },
    29063710                        "context": {
    2907                             "required": false,
    2908                             "default": "view",
     3711                            "description": "Scope under which the request is made; determines fields present in response.",
     3712                            "type": "string",
    29093713                            "enum": [
    29103714                                "view",
     
    29123716                                "edit"
    29133717                            ],
    2914                             "description": "Scope under which the request is made; determines fields present in response.",
    2915                             "type": "string"
     3718                            "default": "view",
     3719                            "required": false
    29163720                        }
    29173721                    }
     
    29313735                    "args": {
    29323736                        "context": {
    2933                             "required": false,
    2934                             "default": "view",
     3737                            "description": "Scope under which the request is made; determines fields present in response.",
     3738                            "type": "string",
    29353739                            "enum": [
    29363740                                "view",
     
    29383742                                "edit"
    29393743                            ],
    2940                             "description": "Scope under which the request is made; determines fields present in response.",
    2941                             "type": "string"
     3744                            "default": "view",
     3745                            "required": false
    29423746                        }
    29433747                    }
     
    29603764                    "args": {
    29613765                        "type": {
    2962                             "required": false,
    29633766                            "description": "An alphanumeric identifier for the post type.",
    2964                             "type": "string"
     3767                            "type": "string",
     3768                            "required": false
    29653769                        },
    29663770                        "context": {
    2967                             "required": false,
    2968                             "default": "view",
     3771                            "description": "Scope under which the request is made; determines fields present in response.",
     3772                            "type": "string",
    29693773                            "enum": [
    29703774                                "view",
     
    29723776                                "edit"
    29733777                            ],
    2974                             "description": "Scope under which the request is made; determines fields present in response.",
    2975                             "type": "string"
     3778                            "default": "view",
     3779                            "required": false
    29763780                        }
    29773781                    }
     
    29913795                    "args": {
    29923796                        "context": {
    2993                             "required": false,
    2994                             "default": "view",
     3797                            "description": "Scope under which the request is made; determines fields present in response.",
     3798                            "type": "string",
    29953799                            "enum": [
    29963800                                "view",
     
    29983802                                "edit"
    29993803                            ],
    3000                             "description": "Scope under which the request is made; determines fields present in response.",
    3001                             "type": "string"
     3804                            "default": "view",
     3805                            "required": false
    30023806                        }
    30033807                    }
     
    30203824                    "args": {
    30213825                        "status": {
    3022                             "required": false,
    30233826                            "description": "An alphanumeric identifier for the status.",
    3024                             "type": "string"
     3827                            "type": "string",
     3828                            "required": false
    30253829                        },
    30263830                        "context": {
    3027                             "required": false,
    3028                             "default": "view",
     3831                            "description": "Scope under which the request is made; determines fields present in response.",
     3832                            "type": "string",
    30293833                            "enum": [
    30303834                                "view",
     
    30323836                                "edit"
    30333837                            ],
    3034                             "description": "Scope under which the request is made; determines fields present in response.",
    3035                             "type": "string"
     3838                            "default": "view",
     3839                            "required": false
    30363840                        }
    30373841                    }
     
    30513855                    "args": {
    30523856                        "context": {
    3053                             "required": false,
    3054                             "default": "view",
     3857                            "description": "Scope under which the request is made; determines fields present in response.",
     3858                            "type": "string",
    30553859                            "enum": [
    30563860                                "view",
     
    30583862                                "edit"
    30593863                            ],
    3060                             "description": "Scope under which the request is made; determines fields present in response.",
    3061                             "type": "string"
     3864                            "default": "view",
     3865                            "required": false
    30623866                        },
    30633867                        "type": {
    3064                             "required": false,
    30653868                            "description": "Limit results to taxonomies associated with a specific post type.",
    3066                             "type": "string"
     3869                            "type": "string",
     3870                            "required": false
    30673871                        }
    30683872                    }
     
    30853889                    "args": {
    30863890                        "taxonomy": {
    3087                             "required": false,
    30883891                            "description": "An alphanumeric identifier for the taxonomy.",
    3089                             "type": "string"
     3892                            "type": "string",
     3893                            "required": false
    30903894                        },
    30913895                        "context": {
    3092                             "required": false,
    3093                             "default": "view",
     3896                            "description": "Scope under which the request is made; determines fields present in response.",
     3897                            "type": "string",
    30943898                            "enum": [
    30953899                                "view",
     
    30973901                                "edit"
    30983902                            ],
    3099                             "description": "Scope under which the request is made; determines fields present in response.",
    3100                             "type": "string"
     3903                            "default": "view",
     3904                            "required": false
    31013905                        }
    31023906                    }
     
    31173921                    "args": {
    31183922                        "context": {
    3119                             "required": false,
    3120                             "default": "view",
     3923                            "description": "Scope under which the request is made; determines fields present in response.",
     3924                            "type": "string",
    31213925                            "enum": [
    31223926                                "view",
     
    31243928                                "edit"
    31253929                            ],
    3126                             "description": "Scope under which the request is made; determines fields present in response.",
    3127                             "type": "string"
     3930                            "default": "view",
     3931                            "required": false
    31283932                        },
    31293933                        "page": {
    3130                             "required": false,
     3934                            "description": "Current page of the collection.",
     3935                            "type": "integer",
    31313936                            "default": 1,
    3132                             "description": "Current page of the collection.",
    3133                             "type": "integer"
     3937                            "minimum": 1,
     3938                            "required": false
    31343939                        },
    31353940                        "per_page": {
    3136                             "required": false,
     3941                            "description": "Maximum number of items to be returned in result set.",
     3942                            "type": "integer",
    31373943                            "default": 10,
    3138                             "description": "Maximum number of items to be returned in result set.",
    3139                             "type": "integer"
     3944                            "minimum": 1,
     3945                            "maximum": 100,
     3946                            "required": false
    31403947                        },
    31413948                        "search": {
    3142                             "required": false,
    31433949                            "description": "Limit results to those matching a string.",
    3144                             "type": "string"
     3950                            "type": "string",
     3951                            "required": false
    31453952                        },
    31463953                        "exclude": {
    3147                             "required": false,
    3148                             "default": [],
    31493954                            "description": "Ensure result set excludes specific IDs.",
    31503955                            "type": "array",
    31513956                            "items": {
    31523957                                "type": "integer"
    3153                             }
     3958                            },
     3959                            "default": [],
     3960                            "required": false
    31543961                        },
    31553962                        "include": {
    3156                             "required": false,
    3157                             "default": [],
    31583963                            "description": "Limit result set to specific IDs.",
    31593964                            "type": "array",
    31603965                            "items": {
    31613966                                "type": "integer"
    3162                             }
     3967                            },
     3968                            "default": [],
     3969                            "required": false
    31633970                        },
    31643971                        "order": {
    3165                             "required": false,
     3972                            "description": "Order sort attribute ascending or descending.",
     3973                            "type": "string",
    31663974                            "default": "asc",
    31673975                            "enum": [
     
    31693977                                "desc"
    31703978                            ],
    3171                             "description": "Order sort attribute ascending or descending.",
    3172                             "type": "string"
     3979                            "required": false
    31733980                        },
    31743981                        "orderby": {
    3175                             "required": false,
     3982                            "description": "Sort collection by term attribute.",
     3983                            "type": "string",
    31763984                            "default": "name",
    31773985                            "enum": [
     
    31853993                                "count"
    31863994                            ],
    3187                             "description": "Sort collection by term attribute.",
    3188                             "type": "string"
     3995                            "required": false
    31893996                        },
    31903997                        "hide_empty": {
    3191                             "required": false,
     3998                            "description": "Whether to hide terms not assigned to any posts.",
     3999                            "type": "boolean",
    31924000                            "default": false,
    3193                             "description": "Whether to hide terms not assigned to any posts.",
    3194                             "type": "boolean"
     4001                            "required": false
    31954002                        },
    31964003                        "parent": {
    3197                             "required": false,
    31984004                            "description": "Limit result set to terms assigned to a specific parent.",
    3199                             "type": "integer"
     4005                            "type": "integer",
     4006                            "required": false
    32004007                        },
    32014008                        "post": {
    3202                             "required": false,
    32034009                            "description": "Limit result set to terms assigned to a specific post.",
    3204                             "type": "integer"
     4010                            "type": "integer",
     4011                            "default": null,
     4012                            "required": false
    32054013                        },
    32064014                        "slug": {
    3207                             "required": false,
    32084015                            "description": "Limit result set to terms with one or more specific slugs.",
    32094016                            "type": "array",
    32104017                            "items": {
    32114018                                "type": "string"
    3212                             }
     4019                            },
     4020                            "required": false
    32134021                        }
    32144022                    }
     
    32204028                    "args": {
    32214029                        "description": {
    3222                             "required": false,
    32234030                            "description": "HTML description of the term.",
    3224                             "type": "string"
     4031                            "type": "string",
     4032                            "required": false
    32254033                        },
    32264034                        "name": {
    3227                             "required": true,
    32284035                            "description": "HTML title for the term.",
    3229                             "type": "string"
     4036                            "type": "string",
     4037                            "required": true
    32304038                        },
    32314039                        "slug": {
    3232                             "required": false,
    32334040                            "description": "An alphanumeric identifier for the term unique to its type.",
    3234                             "type": "string"
     4041                            "type": "string",
     4042                            "required": false
    32354043                        },
    32364044                        "parent": {
    3237                             "required": false,
    32384045                            "description": "The parent term ID.",
    3239                             "type": "integer"
     4046                            "type": "integer",
     4047                            "required": false
    32404048                        },
    32414049                        "meta": {
    3242                             "required": false,
    32434050                            "description": "Meta fields.",
    3244                             "type": "object"
     4051                            "type": "object",
     4052                            "properties": [],
     4053                            "required": false
    32454054                        }
    32464055                    }
     
    32674076                    "args": {
    32684077                        "id": {
    3269                             "required": false,
    32704078                            "description": "Unique identifier for the term.",
    3271                             "type": "integer"
     4079                            "type": "integer",
     4080                            "required": false
    32724081                        },
    32734082                        "context": {
    3274                             "required": false,
    3275                             "default": "view",
     4083                            "description": "Scope under which the request is made; determines fields present in response.",
     4084                            "type": "string",
    32764085                            "enum": [
    32774086                                "view",
     
    32794088                                "edit"
    32804089                            ],
    3281                             "description": "Scope under which the request is made; determines fields present in response.",
    3282                             "type": "string"
     4090                            "default": "view",
     4091                            "required": false
    32834092                        }
    32844093                    }
     
    32924101                    "args": {
    32934102                        "id": {
    3294                             "required": false,
    32954103                            "description": "Unique identifier for the term.",
    3296                             "type": "integer"
     4104                            "type": "integer",
     4105                            "required": false
    32974106                        },
    32984107                        "description": {
    3299                             "required": false,
    33004108                            "description": "HTML description of the term.",
    3301                             "type": "string"
     4109                            "type": "string",
     4110                            "required": false
    33024111                        },
    33034112                        "name": {
    3304                             "required": false,
    33054113                            "description": "HTML title for the term.",
    3306                             "type": "string"
     4114                            "type": "string",
     4115                            "required": false
    33074116                        },
    33084117                        "slug": {
    3309                             "required": false,
    33104118                            "description": "An alphanumeric identifier for the term unique to its type.",
    3311                             "type": "string"
     4119                            "type": "string",
     4120                            "required": false
    33124121                        },
    33134122                        "parent": {
    3314                             "required": false,
    33154123                            "description": "The parent term ID.",
    3316                             "type": "integer"
     4124                            "type": "integer",
     4125                            "required": false
    33174126                        },
    33184127                        "meta": {
    3319                             "required": false,
    33204128                            "description": "Meta fields.",
    3321                             "type": "object"
     4129                            "type": "object",
     4130                            "properties": [],
     4131                            "required": false
    33224132                        }
    33234133                    }
     
    33294139                    "args": {
    33304140                        "id": {
    3331                             "required": false,
    33324141                            "description": "Unique identifier for the term.",
    3333                             "type": "integer"
     4142                            "type": "integer",
     4143                            "required": false
    33344144                        },
    33354145                        "force": {
    3336                             "required": false,
     4146                            "type": "boolean",
    33374147                            "default": false,
    33384148                            "description": "Required to be true, as terms do not support trashing.",
    3339                             "type": "boolean"
     4149                            "required": false
    33404150                        }
    33414151                    }
     
    33564166                    "args": {
    33574167                        "context": {
    3358                             "required": false,
    3359                             "default": "view",
     4168                            "description": "Scope under which the request is made; determines fields present in response.",
     4169                            "type": "string",
    33604170                            "enum": [
    33614171                                "view",
     
    33634173                                "edit"
    33644174                            ],
    3365                             "description": "Scope under which the request is made; determines fields present in response.",
    3366                             "type": "string"
     4175                            "default": "view",
     4176                            "required": false
    33674177                        },
    33684178                        "page": {
    3369                             "required": false,
     4179                            "description": "Current page of the collection.",
     4180                            "type": "integer",
    33704181                            "default": 1,
    3371                             "description": "Current page of the collection.",
    3372                             "type": "integer"
     4182                            "minimum": 1,
     4183                            "required": false
    33734184                        },
    33744185                        "per_page": {
    3375                             "required": false,
     4186                            "description": "Maximum number of items to be returned in result set.",
     4187                            "type": "integer",
    33764188                            "default": 10,
    3377                             "description": "Maximum number of items to be returned in result set.",
    3378                             "type": "integer"
     4189                            "minimum": 1,
     4190                            "maximum": 100,
     4191                            "required": false
    33794192                        },
    33804193                        "search": {
    3381                             "required": false,
    33824194                            "description": "Limit results to those matching a string.",
    3383                             "type": "string"
     4195                            "type": "string",
     4196                            "required": false
    33844197                        },
    33854198                        "exclude": {
    3386                             "required": false,
    3387                             "default": [],
    33884199                            "description": "Ensure result set excludes specific IDs.",
    33894200                            "type": "array",
    33904201                            "items": {
    33914202                                "type": "integer"
    3392                             }
     4203                            },
     4204                            "default": [],
     4205                            "required": false
    33934206                        },
    33944207                        "include": {
    3395                             "required": false,
    3396                             "default": [],
    33974208                            "description": "Limit result set to specific IDs.",
    33984209                            "type": "array",
    33994210                            "items": {
    34004211                                "type": "integer"
    3401                             }
     4212                            },
     4213                            "default": [],
     4214                            "required": false
    34024215                        },
    34034216                        "offset": {
    3404                             "required": false,
    34054217                            "description": "Offset the result set by a specific number of items.",
    3406                             "type": "integer"
     4218                            "type": "integer",
     4219                            "required": false
    34074220                        },
    34084221                        "order": {
    3409                             "required": false,
     4222                            "description": "Order sort attribute ascending or descending.",
     4223                            "type": "string",
    34104224                            "default": "asc",
    34114225                            "enum": [
     
    34134227                                "desc"
    34144228                            ],
    3415                             "description": "Order sort attribute ascending or descending.",
    3416                             "type": "string"
     4229                            "required": false
    34174230                        },
    34184231                        "orderby": {
    3419                             "required": false,
     4232                            "description": "Sort collection by term attribute.",
     4233                            "type": "string",
    34204234                            "default": "name",
    34214235                            "enum": [
     
    34294243                                "count"
    34304244                            ],
    3431                             "description": "Sort collection by term attribute.",
    3432                             "type": "string"
     4245                            "required": false
    34334246                        },
    34344247                        "hide_empty": {
    3435                             "required": false,
     4248                            "description": "Whether to hide terms not assigned to any posts.",
     4249                            "type": "boolean",
    34364250                            "default": false,
    3437                             "description": "Whether to hide terms not assigned to any posts.",
    3438                             "type": "boolean"
     4251                            "required": false
    34394252                        },
    34404253                        "post": {
    3441                             "required": false,
    34424254                            "description": "Limit result set to terms assigned to a specific post.",
    3443                             "type": "integer"
     4255                            "type": "integer",
     4256                            "default": null,
     4257                            "required": false
    34444258                        },
    34454259                        "slug": {
    3446                             "required": false,
    34474260                            "description": "Limit result set to terms with one or more specific slugs.",
    34484261                            "type": "array",
    34494262                            "items": {
    34504263                                "type": "string"
    3451                             }
     4264                            },
     4265                            "required": false
    34524266                        }
    34534267                    }
     
    34594273                    "args": {
    34604274                        "description": {
    3461                             "required": false,
    34624275                            "description": "HTML description of the term.",
    3463                             "type": "string"
     4276                            "type": "string",
     4277                            "required": false
    34644278                        },
    34654279                        "name": {
    3466                             "required": true,
    34674280                            "description": "HTML title for the term.",
    3468                             "type": "string"
     4281                            "type": "string",
     4282                            "required": true
    34694283                        },
    34704284                        "slug": {
    3471                             "required": false,
    34724285                            "description": "An alphanumeric identifier for the term unique to its type.",
    3473                             "type": "string"
     4286                            "type": "string",
     4287                            "required": false
    34744288                        },
    34754289                        "meta": {
    3476                             "required": false,
    34774290                            "description": "Meta fields.",
    3478                             "type": "object"
     4291                            "type": "object",
     4292                            "properties": [],
     4293                            "required": false
    34794294                        }
    34804295                    }
     
    35014316                    "args": {
    35024317                        "id": {
    3503                             "required": false,
    35044318                            "description": "Unique identifier for the term.",
    3505                             "type": "integer"
     4319                            "type": "integer",
     4320                            "required": false
    35064321                        },
    35074322                        "context": {
    3508                             "required": false,
    3509                             "default": "view",
     4323                            "description": "Scope under which the request is made; determines fields present in response.",
     4324                            "type": "string",
    35104325                            "enum": [
    35114326                                "view",
     
    35134328                                "edit"
    35144329                            ],
    3515                             "description": "Scope under which the request is made; determines fields present in response.",
    3516                             "type": "string"
     4330                            "default": "view",
     4331                            "required": false
    35174332                        }
    35184333                    }
     
    35264341                    "args": {
    35274342                        "id": {
    3528                             "required": false,
    35294343                            "description": "Unique identifier for the term.",
    3530                             "type": "integer"
     4344                            "type": "integer",
     4345                            "required": false
    35314346                        },
    35324347                        "description": {
    3533                             "required": false,
    35344348                            "description": "HTML description of the term.",
    3535                             "type": "string"
     4349                            "type": "string",
     4350                            "required": false
    35364351                        },
    35374352                        "name": {
    3538                             "required": false,
    35394353                            "description": "HTML title for the term.",
    3540                             "type": "string"
     4354                            "type": "string",
     4355                            "required": false
    35414356                        },
    35424357                        "slug": {
    3543                             "required": false,
    35444358                            "description": "An alphanumeric identifier for the term unique to its type.",
    3545                             "type": "string"
     4359                            "type": "string",
     4360                            "required": false
    35464361                        },
    35474362                        "meta": {
    3548                             "required": false,
    35494363                            "description": "Meta fields.",
    3550                             "type": "object"
     4364                            "type": "object",
     4365                            "properties": [],
     4366                            "required": false
    35514367                        }
    35524368                    }
     
    35584374                    "args": {
    35594375                        "id": {
    3560                             "required": false,
    35614376                            "description": "Unique identifier for the term.",
    3562                             "type": "integer"
     4377                            "type": "integer",
     4378                            "required": false
    35634379                        },
    35644380                        "force": {
    3565                             "required": false,
     4381                            "type": "boolean",
    35664382                            "default": false,
    35674383                            "description": "Required to be true, as terms do not support trashing.",
    3568                             "type": "boolean"
     4384                            "required": false
    35694385                        }
    35704386                    }
     
    35854401                    "args": {
    35864402                        "context": {
    3587                             "required": false,
    3588                             "default": "view",
     4403                            "description": "Scope under which the request is made; determines fields present in response.",
     4404                            "type": "string",
    35894405                            "enum": [
    35904406                                "view",
     
    35924408                                "edit"
    35934409                            ],
    3594                             "description": "Scope under which the request is made; determines fields present in response.",
    3595                             "type": "string"
     4410                            "default": "view",
     4411                            "required": false
    35964412                        },
    35974413                        "page": {
    3598                             "required": false,
     4414                            "description": "Current page of the collection.",
     4415                            "type": "integer",
    35994416                            "default": 1,
    3600                             "description": "Current page of the collection.",
    3601                             "type": "integer"
     4417                            "minimum": 1,
     4418                            "required": false
    36024419                        },
    36034420                        "per_page": {
    3604                             "required": false,
     4421                            "description": "Maximum number of items to be returned in result set.",
     4422                            "type": "integer",
    36054423                            "default": 10,
    3606                             "description": "Maximum number of items to be returned in result set.",
    3607                             "type": "integer"
     4424                            "minimum": 1,
     4425                            "maximum": 100,
     4426                            "required": false
    36084427                        },
    36094428                        "search": {
    3610                             "required": false,
    36114429                            "description": "Limit results to those matching a string.",
    3612                             "type": "string"
     4430                            "type": "string",
     4431                            "required": false
    36134432                        },
    36144433                        "exclude": {
    3615                             "required": false,
    3616                             "default": [],
    36174434                            "description": "Ensure result set excludes specific IDs.",
    36184435                            "type": "array",
    36194436                            "items": {
    36204437                                "type": "integer"
    3621                             }
     4438                            },
     4439                            "default": [],
     4440                            "required": false
    36224441                        },
    36234442                        "include": {
    3624                             "required": false,
    3625                             "default": [],
    36264443                            "description": "Limit result set to specific IDs.",
    36274444                            "type": "array",
    36284445                            "items": {
    36294446                                "type": "integer"
    3630                             }
     4447                            },
     4448                            "default": [],
     4449                            "required": false
    36314450                        },
    36324451                        "offset": {
    3633                             "required": false,
    36344452                            "description": "Offset the result set by a specific number of items.",
    3635                             "type": "integer"
     4453                            "type": "integer",
     4454                            "required": false
    36364455                        },
    36374456                        "order": {
    3638                             "required": false,
    36394457                            "default": "asc",
     4458                            "description": "Order sort attribute ascending or descending.",
    36404459                            "enum": [
    36414460                                "asc",
    36424461                                "desc"
    36434462                            ],
    3644                             "description": "Order sort attribute ascending or descending.",
    3645                             "type": "string"
     4463                            "type": "string",
     4464                            "required": false
    36464465                        },
    36474466                        "orderby": {
    3648                             "required": false,
    36494467                            "default": "name",
     4468                            "description": "Sort collection by object attribute.",
    36504469                            "enum": [
    36514470                                "id",
     
    36584477                                "url"
    36594478                            ],
    3660                             "description": "Sort collection by object attribute.",
    3661                             "type": "string"
     4479                            "type": "string",
     4480                            "required": false
    36624481                        },
    36634482                        "slug": {
    3664                             "required": false,
    36654483                            "description": "Limit result set to users with one or more specific slugs.",
    36664484                            "type": "array",
    36674485                            "items": {
    36684486                                "type": "string"
    3669                             }
     4487                            },
     4488                            "required": false
    36704489                        },
    36714490                        "roles": {
    3672                             "required": false,
    36734491                            "description": "Limit result set to users matching at least one specific role provided. Accepts csv list or single role.",
    36744492                            "type": "array",
    36754493                            "items": {
    36764494                                "type": "string"
    3677                             }
     4495                            },
     4496                            "required": false
    36784497                        },
    36794498                        "who": {
    3680                             "required": false,
     4499                            "description": "Limit result set to users who are considered authors.",
     4500                            "type": "string",
    36814501                            "enum": [
    36824502                                "authors"
    36834503                            ],
    3684                             "description": "Limit result set to users who are considered authors.",
    3685                             "type": "string"
     4504                            "required": false
    36864505                        }
    36874506                    }
     
    36934512                    "args": {
    36944513                        "username": {
    3695                             "required": true,
    36964514                            "description": "Login name for the user.",
    3697                             "type": "string"
     4515                            "type": "string",
     4516                            "required": true
    36984517                        },
    36994518                        "name": {
    3700                             "required": false,
    37014519                            "description": "Display name for the user.",
    3702                             "type": "string"
     4520                            "type": "string",
     4521                            "required": false
    37034522                        },
    37044523                        "first_name": {
    3705                             "required": false,
    37064524                            "description": "First name for the user.",
    3707                             "type": "string"
     4525                            "type": "string",
     4526                            "required": false
    37084527                        },
    37094528                        "last_name": {
    3710                             "required": false,
    37114529                            "description": "Last name for the user.",
    3712                             "type": "string"
     4530                            "type": "string",
     4531                            "required": false
    37134532                        },
    37144533                        "email": {
    3715                             "required": true,
    37164534                            "description": "The email address for the user.",
    3717                             "type": "string"
     4535                            "type": "string",
     4536                            "format": "email",
     4537                            "required": true
    37184538                        },
    37194539                        "url": {
    3720                             "required": false,
    37214540                            "description": "URL of the user.",
    3722                             "type": "string"
     4541                            "type": "string",
     4542                            "format": "uri",
     4543                            "required": false
    37234544                        },
    37244545                        "description": {
    3725                             "required": false,
    37264546                            "description": "Description of the user.",
    3727                             "type": "string"
     4547                            "type": "string",
     4548                            "required": false
    37284549                        },
    37294550                        "locale": {
    3730                             "required": false,
     4551                            "description": "Locale for the user.",
     4552                            "type": "string",
    37314553                            "enum": [
    37324554                                "",
     
    37374559                                "ja_JP"
    37384560                            ],
    3739                             "description": "Locale for the user.",
    3740                             "type": "string"
     4561                            "required": false
    37414562                        },
    37424563                        "nickname": {
    3743                             "required": false,
    37444564                            "description": "The nickname for the user.",
    3745                             "type": "string"
     4565                            "type": "string",
     4566                            "required": false
    37464567                        },
    37474568                        "slug": {
    3748                             "required": false,
    37494569                            "description": "An alphanumeric identifier for the user.",
    3750                             "type": "string"
     4570                            "type": "string",
     4571                            "required": false
    37514572                        },
    37524573                        "roles": {
    3753                             "required": false,
    37544574                            "description": "Roles assigned to the user.",
    37554575                            "type": "array",
    37564576                            "items": {
    37574577                                "type": "string"
    3758                             }
     4578                            },
     4579                            "required": false
    37594580                        },
    37604581                        "password": {
    3761                             "required": true,
    37624582                            "description": "Password for the user (never included).",
    3763                             "type": "string"
     4583                            "type": "string",
     4584                            "required": true
    37644585                        },
    37654586                        "meta": {
    3766                             "required": false,
    37674587                            "description": "Meta fields.",
    3768                             "type": "object"
     4588                            "type": "object",
     4589                            "properties": [],
     4590                            "required": false
    37694591                        }
    37704592                    }
     
    37914613                    "args": {
    37924614                        "id": {
    3793                             "required": false,
    37944615                            "description": "Unique identifier for the user.",
    3795                             "type": "integer"
     4616                            "type": "integer",
     4617                            "required": false
    37964618                        },
    37974619                        "context": {
    3798                             "required": false,
    3799                             "default": "view",
     4620                            "description": "Scope under which the request is made; determines fields present in response.",
     4621                            "type": "string",
    38004622                            "enum": [
    38014623                                "view",
     
    38034625                                "edit"
    38044626                            ],
    3805                             "description": "Scope under which the request is made; determines fields present in response.",
    3806                             "type": "string"
     4627                            "default": "view",
     4628                            "required": false
    38074629                        }
    38084630                    }
     
    38164638                    "args": {
    38174639                        "id": {
    3818                             "required": false,
    38194640                            "description": "Unique identifier for the user.",
    3820                             "type": "integer"
     4641                            "type": "integer",
     4642                            "required": false
    38214643                        },
    38224644                        "username": {
    3823                             "required": false,
    38244645                            "description": "Login name for the user.",
    3825                             "type": "string"
     4646                            "type": "string",
     4647                            "required": false
    38264648                        },
    38274649                        "name": {
    3828                             "required": false,
    38294650                            "description": "Display name for the user.",
    3830                             "type": "string"
     4651                            "type": "string",
     4652                            "required": false
    38314653                        },
    38324654                        "first_name": {
    3833                             "required": false,
    38344655                            "description": "First name for the user.",
    3835                             "type": "string"
     4656                            "type": "string",
     4657                            "required": false
    38364658                        },
    38374659                        "last_name": {
    3838                             "required": false,
    38394660                            "description": "Last name for the user.",
    3840                             "type": "string"
     4661                            "type": "string",
     4662                            "required": false
    38414663                        },
    38424664                        "email": {
    3843                             "required": false,
    38444665                            "description": "The email address for the user.",
    3845                             "type": "string"
     4666                            "type": "string",
     4667                            "format": "email",
     4668                            "required": false
    38464669                        },
    38474670                        "url": {
    3848                             "required": false,
    38494671                            "description": "URL of the user.",
    3850                             "type": "string"
     4672                            "type": "string",
     4673                            "format": "uri",
     4674                            "required": false
    38514675                        },
    38524676                        "description": {
    3853                             "required": false,
    38544677                            "description": "Description of the user.",
    3855                             "type": "string"
     4678                            "type": "string",
     4679                            "required": false
    38564680                        },
    38574681                        "locale": {
    3858                             "required": false,
     4682                            "description": "Locale for the user.",
     4683                            "type": "string",
    38594684                            "enum": [
    38604685                                "",
     
    38654690                                "ja_JP"
    38664691                            ],
    3867                             "description": "Locale for the user.",
    3868                             "type": "string"
     4692                            "required": false
    38694693                        },
    38704694                        "nickname": {
    3871                             "required": false,
    38724695                            "description": "The nickname for the user.",
    3873                             "type": "string"
     4696                            "type": "string",
     4697                            "required": false
    38744698                        },
    38754699                        "slug": {
    3876                             "required": false,
    38774700                            "description": "An alphanumeric identifier for the user.",
    3878                             "type": "string"
     4701                            "type": "string",
     4702                            "required": false
    38794703                        },
    38804704                        "roles": {
    3881                             "required": false,
    38824705                            "description": "Roles assigned to the user.",
    38834706                            "type": "array",
    38844707                            "items": {
    38854708                                "type": "string"
    3886                             }
     4709                            },
     4710                            "required": false
    38874711                        },
    38884712                        "password": {
    3889                             "required": false,
    38904713                            "description": "Password for the user (never included).",
    3891                             "type": "string"
     4714                            "type": "string",
     4715                            "required": false
    38924716                        },
    38934717                        "meta": {
    3894                             "required": false,
    38954718                            "description": "Meta fields.",
    3896                             "type": "object"
     4719                            "type": "object",
     4720                            "properties": [],
     4721                            "required": false
    38974722                        }
    38984723                    }
     
    39044729                    "args": {
    39054730                        "id": {
    3906                             "required": false,
    39074731                            "description": "Unique identifier for the user.",
    3908                             "type": "integer"
     4732                            "type": "integer",
     4733                            "required": false
    39094734                        },
    39104735                        "force": {
    3911                             "required": false,
     4736                            "type": "boolean",
    39124737                            "default": false,
    39134738                            "description": "Required to be true, as users do not support trashing.",
    3914                             "type": "boolean"
     4739                            "required": false
    39154740                        },
    39164741                        "reassign": {
    3917                             "required": true,
     4742                            "type": "integer",
    39184743                            "description": "Reassign the deleted user's posts and links to this user ID.",
    3919                             "type": "integer"
     4744                            "required": true
    39204745                        }
    39214746                    }
     
    39394764                    "args": {
    39404765                        "context": {
    3941                             "required": false,
    3942                             "default": "view",
     4766                            "description": "Scope under which the request is made; determines fields present in response.",
     4767                            "type": "string",
    39434768                            "enum": [
    39444769                                "view",
     
    39464771                                "edit"
    39474772                            ],
    3948                             "description": "Scope under which the request is made; determines fields present in response.",
    3949                             "type": "string"
     4773                            "default": "view",
     4774                            "required": false
    39504775                        }
    39514776                    }
     
    39594784                    "args": {
    39604785                        "username": {
    3961                             "required": false,
    39624786                            "description": "Login name for the user.",
    3963                             "type": "string"
     4787                            "type": "string",
     4788                            "required": false
    39644789                        },
    39654790                        "name": {
    3966                             "required": false,
    39674791                            "description": "Display name for the user.",
    3968                             "type": "string"
     4792                            "type": "string",
     4793                            "required": false
    39694794                        },
    39704795                        "first_name": {
    3971                             "required": false,
    39724796                            "description": "First name for the user.",
    3973                             "type": "string"
     4797                            "type": "string",
     4798                            "required": false
    39744799                        },
    39754800                        "last_name": {
    3976                             "required": false,
    39774801                            "description": "Last name for the user.",
    3978                             "type": "string"
     4802                            "type": "string",
     4803                            "required": false
    39794804                        },
    39804805                        "email": {
    3981                             "required": false,
    39824806                            "description": "The email address for the user.",
    3983                             "type": "string"
     4807                            "type": "string",
     4808                            "format": "email",
     4809                            "required": false
    39844810                        },
    39854811                        "url": {
    3986                             "required": false,
    39874812                            "description": "URL of the user.",
    3988                             "type": "string"
     4813                            "type": "string",
     4814                            "format": "uri",
     4815                            "required": false
    39894816                        },
    39904817                        "description": {
    3991                             "required": false,
    39924818                            "description": "Description of the user.",
    3993                             "type": "string"
     4819                            "type": "string",
     4820                            "required": false
    39944821                        },
    39954822                        "locale": {
    3996                             "required": false,
     4823                            "description": "Locale for the user.",
     4824                            "type": "string",
    39974825                            "enum": [
    39984826                                "",
     
    40034831                                "ja_JP"
    40044832                            ],
    4005                             "description": "Locale for the user.",
    4006                             "type": "string"
     4833                            "required": false
    40074834                        },
    40084835                        "nickname": {
    4009                             "required": false,
    40104836                            "description": "The nickname for the user.",
    4011                             "type": "string"
     4837                            "type": "string",
     4838                            "required": false
    40124839                        },
    40134840                        "slug": {
    4014                             "required": false,
    40154841                            "description": "An alphanumeric identifier for the user.",
    4016                             "type": "string"
     4842                            "type": "string",
     4843                            "required": false
    40174844                        },
    40184845                        "roles": {
    4019                             "required": false,
    40204846                            "description": "Roles assigned to the user.",
    40214847                            "type": "array",
    40224848                            "items": {
    40234849                                "type": "string"
    4024                             }
     4850                            },
     4851                            "required": false
    40254852                        },
    40264853                        "password": {
    4027                             "required": false,
    40284854                            "description": "Password for the user (never included).",
    4029                             "type": "string"
     4855                            "type": "string",
     4856                            "required": false
    40304857                        },
    40314858                        "meta": {
    4032                             "required": false,
    40334859                            "description": "Meta fields.",
    4034                             "type": "object"
     4860                            "type": "object",
     4861                            "properties": [],
     4862                            "required": false
    40354863                        }
    40364864                    }
     
    40424870                    "args": {
    40434871                        "force": {
    4044                             "required": false,
     4872                            "type": "boolean",
    40454873                            "default": false,
    40464874                            "description": "Required to be true, as users do not support trashing.",
    4047                             "type": "boolean"
     4875                            "required": false
    40484876                        },
    40494877                        "reassign": {
    4050                             "required": true,
     4878                            "type": "integer",
    40514879                            "description": "Reassign the deleted user's posts and links to this user ID.",
    4052                             "type": "integer"
     4880                            "required": true
    40534881                        }
    40544882                    }
     
    40734901                    "args": {
    40744902                        "context": {
    4075                             "required": false,
    4076                             "default": "view",
     4903                            "description": "Scope under which the request is made; determines fields present in response.",
     4904                            "type": "string",
    40774905                            "enum": [
    40784906                                "view",
     
    40804908                                "edit"
    40814909                            ],
    4082                             "description": "Scope under which the request is made; determines fields present in response.",
    4083                             "type": "string"
     4910                            "default": "view",
     4911                            "required": false
    40844912                        }
    40854913                    }
     
    40914919                    "args": {
    40924920                        "name": {
    4093                             "required": true,
    40944921                            "description": "The name of the application password.",
    4095                             "type": "string"
     4922                            "type": "string",
     4923                            "required": true
    40964924                        }
    40974925                    }
     
    41214949                    "args": {
    41224950                        "context": {
    4123                             "required": false,
    4124                             "default": "view",
     4951                            "description": "Scope under which the request is made; determines fields present in response.",
     4952                            "type": "string",
    41254953                            "enum": [
    41264954                                "view",
     
    41284956                                "edit"
    41294957                            ],
    4130                             "description": "Scope under which the request is made; determines fields present in response.",
    4131                             "type": "string"
     4958                            "default": "view",
     4959                            "required": false
    41324960                        }
    41334961                    }
     
    41414969                    "args": {
    41424970                        "name": {
    4143                             "required": false,
    41444971                            "description": "The name of the application password.",
    4145                             "type": "string"
     4972                            "type": "string",
     4973                            "required": false
    41464974                        }
    41474975                    }
     
    41684996                    "args": {
    41694997                        "context": {
    4170                             "required": false,
    4171                             "default": "view",
     4998                            "description": "Scope under which the request is made; determines fields present in response.",
     4999                            "type": "string",
    41725000                            "enum": [
    41735001                                "view",
     
    41755003                                "edit"
    41765004                            ],
    4177                             "description": "Scope under which the request is made; determines fields present in response.",
    4178                             "type": "string"
     5005                            "default": "view",
     5006                            "required": false
    41795007                        },
    41805008                        "page": {
    4181                             "required": false,
     5009                            "description": "Current page of the collection.",
     5010                            "type": "integer",
    41825011                            "default": 1,
    4183                             "description": "Current page of the collection.",
    4184                             "type": "integer"
     5012                            "minimum": 1,
     5013                            "required": false
    41855014                        },
    41865015                        "per_page": {
    4187                             "required": false,
     5016                            "description": "Maximum number of items to be returned in result set.",
     5017                            "type": "integer",
    41885018                            "default": 10,
    4189                             "description": "Maximum number of items to be returned in result set.",
    4190                             "type": "integer"
     5019                            "minimum": 1,
     5020                            "maximum": 100,
     5021                            "required": false
    41915022                        },
    41925023                        "search": {
    4193                             "required": false,
    41945024                            "description": "Limit results to those matching a string.",
    4195                             "type": "string"
     5025                            "type": "string",
     5026                            "required": false
    41965027                        },
    41975028                        "after": {
    4198                             "required": false,
    41995029                            "description": "Limit response to comments published after a given ISO8601 compliant date.",
    4200                             "type": "string"
     5030                            "type": "string",
     5031                            "format": "date-time",
     5032                            "required": false
    42015033                        },
    42025034                        "author": {
    4203                             "required": false,
    42045035                            "description": "Limit result set to comments assigned to specific user IDs. Requires authorization.",
    42055036                            "type": "array",
    42065037                            "items": {
    42075038                                "type": "integer"
    4208                             }
     5039                            },
     5040                            "required": false
    42095041                        },
    42105042                        "author_exclude": {
    4211                             "required": false,
    42125043                            "description": "Ensure result set excludes comments assigned to specific user IDs. Requires authorization.",
    42135044                            "type": "array",
    42145045                            "items": {
    42155046                                "type": "integer"
    4216                             }
     5047                            },
     5048                            "required": false
    42175049                        },
    42185050                        "author_email": {
    4219                             "required": false,
     5051                            "default": null,
    42205052                            "description": "Limit result set to that from a specific author email. Requires authorization.",
    4221                             "type": "string"
     5053                            "format": "email",
     5054                            "type": "string",
     5055                            "required": false
    42225056                        },
    42235057                        "before": {
    4224                             "required": false,
    42255058                            "description": "Limit response to comments published before a given ISO8601 compliant date.",
    4226                             "type": "string"
     5059                            "type": "string",
     5060                            "format": "date-time",
     5061                            "required": false
    42275062                        },
    42285063                        "exclude": {
    4229                             "required": false,
    4230                             "default": [],
    42315064                            "description": "Ensure result set excludes specific IDs.",
    42325065                            "type": "array",
    42335066                            "items": {
    42345067                                "type": "integer"
    4235                             }
     5068                            },
     5069                            "default": [],
     5070                            "required": false
    42365071                        },
    42375072                        "include": {
    4238                             "required": false,
    4239                             "default": [],
    42405073                            "description": "Limit result set to specific IDs.",
    42415074                            "type": "array",
    42425075                            "items": {
    42435076                                "type": "integer"
    4244                             }
     5077                            },
     5078                            "default": [],
     5079                            "required": false
    42455080                        },
    42465081                        "offset": {
    4247                             "required": false,
    42485082                            "description": "Offset the result set by a specific number of items.",
    4249                             "type": "integer"
     5083                            "type": "integer",
     5084                            "required": false
    42505085                        },
    42515086                        "order": {
    4252                             "required": false,
     5087                            "description": "Order sort attribute ascending or descending.",
     5088                            "type": "string",
    42535089                            "default": "desc",
    42545090                            "enum": [
     
    42565092                                "desc"
    42575093                            ],
    4258                             "description": "Order sort attribute ascending or descending.",
    4259                             "type": "string"
     5094                            "required": false
    42605095                        },
    42615096                        "orderby": {
    4262                             "required": false,
     5097                            "description": "Sort collection by object attribute.",
     5098                            "type": "string",
    42635099                            "default": "date_gmt",
    42645100                            "enum": [
     
    42715107                                "type"
    42725108                            ],
    4273                             "description": "Sort collection by object attribute.",
    4274                             "type": "string"
     5109                            "required": false
    42755110                        },
    42765111                        "parent": {
    4277                             "required": false,
    42785112                            "default": [],
    42795113                            "description": "Limit result set to comments of specific parent IDs.",
     
    42815115                            "items": {
    42825116                                "type": "integer"
    4283                             }
     5117                            },
     5118                            "required": false
    42845119                        },
    42855120                        "parent_exclude": {
    4286                             "required": false,
    42875121                            "default": [],
    42885122                            "description": "Ensure result set excludes specific parent IDs.",
     
    42905124                            "items": {
    42915125                                "type": "integer"
    4292                             }
     5126                            },
     5127                            "required": false
    42935128                        },
    42945129                        "post": {
    4295                             "required": false,
    42965130                            "default": [],
    42975131                            "description": "Limit result set to comments assigned to specific post IDs.",
     
    42995133                            "items": {
    43005134                                "type": "integer"
    4301                             }
     5135                            },
     5136                            "required": false
    43025137                        },
    43035138                        "status": {
    4304                             "required": false,
    43055139                            "default": "approve",
    43065140                            "description": "Limit result set to comments assigned a specific status. Requires authorization.",
    4307                             "type": "string"
     5141                            "type": "string",
     5142                            "required": false
    43085143                        },
    43095144                        "type": {
    4310                             "required": false,
    43115145                            "default": "comment",
    43125146                            "description": "Limit result set to comments assigned a specific type. Requires authorization.",
    4313                             "type": "string"
     5147                            "type": "string",
     5148                            "required": false
    43145149                        },
    43155150                        "password": {
    4316                             "required": false,
    43175151                            "description": "The password for the post if it is password protected.",
    4318                             "type": "string"
     5152                            "type": "string",
     5153                            "required": false
    43195154                        }
    43205155                    }
     
    43265161                    "args": {
    43275162                        "author": {
    4328                             "required": false,
    43295163                            "description": "The ID of the user object, if author was a user.",
    4330                             "type": "integer"
     5164                            "type": "integer",
     5165                            "required": false
    43315166                        },
    43325167                        "author_email": {
    4333                             "required": false,
    43345168                            "description": "Email address for the object author.",
    4335                             "type": "string"
     5169                            "type": "string",
     5170                            "format": "email",
     5171                            "required": false
    43365172                        },
    43375173                        "author_ip": {
    4338                             "required": false,
    43395174                            "description": "IP address for the object author.",
    4340                             "type": "string"
     5175                            "type": "string",
     5176                            "format": "ip",
     5177                            "required": false
    43415178                        },
    43425179                        "author_name": {
    4343                             "required": false,
    43445180                            "description": "Display name for the object author.",
    4345                             "type": "string"
     5181                            "type": "string",
     5182                            "required": false
    43465183                        },
    43475184                        "author_url": {
    4348                             "required": false,
    43495185                            "description": "URL for the object author.",
    4350                             "type": "string"
     5186                            "type": "string",
     5187                            "format": "uri",
     5188                            "required": false
    43515189                        },
    43525190                        "author_user_agent": {
    4353                             "required": false,
    43545191                            "description": "User agent for the object author.",
    4355                             "type": "string"
     5192                            "type": "string",
     5193                            "required": false
    43565194                        },
    43575195                        "content": {
    4358                             "required": false,
    43595196                            "description": "The content for the object.",
    4360                             "type": "object"
     5197                            "type": "object",
     5198                            "properties": {
     5199                                "raw": {
     5200                                    "description": "Content for the object, as it exists in the database.",
     5201                                    "type": "string",
     5202                                    "context": [
     5203                                        "edit"
     5204                                    ]
     5205                                },
     5206                                "rendered": {
     5207                                    "description": "HTML content for the object, transformed for display.",
     5208                                    "type": "string",
     5209                                    "context": [
     5210                                        "view",
     5211                                        "edit",
     5212                                        "embed"
     5213                                    ],
     5214                                    "readonly": true
     5215                                }
     5216                            },
     5217                            "required": false
    43615218                        },
    43625219                        "date": {
    4363                             "required": false,
    43645220                            "description": "The date the object was published, in the site's timezone.",
    4365                             "type": "string"
     5221                            "type": "string",
     5222                            "format": "date-time",
     5223                            "required": false
    43665224                        },
    43675225                        "date_gmt": {
    4368                             "required": false,
    43695226                            "description": "The date the object was published, as GMT.",
    4370                             "type": "string"
     5227                            "type": "string",
     5228                            "format": "date-time",
     5229                            "required": false
    43715230                        },
    43725231                        "parent": {
    4373                             "required": false,
    43745232                            "default": 0,
    43755233                            "description": "The ID for the parent of the object.",
    4376                             "type": "integer"
     5234                            "type": "integer",
     5235                            "required": false
    43775236                        },
    43785237                        "post": {
    4379                             "required": false,
    43805238                            "default": 0,
    43815239                            "description": "The ID of the associated post object.",
    4382                             "type": "integer"
     5240                            "type": "integer",
     5241                            "required": false
    43835242                        },
    43845243                        "status": {
    4385                             "required": false,
    43865244                            "description": "State of the object.",
    4387                             "type": "string"
     5245                            "type": "string",
     5246                            "required": false
    43885247                        },
    43895248                        "meta": {
    4390                             "required": false,
    43915249                            "description": "Meta fields.",
    4392                             "type": "object"
     5250                            "type": "object",
     5251                            "properties": [],
     5252                            "required": false
    43935253                        }
    43945254                    }
     
    44155275                    "args": {
    44165276                        "id": {
    4417                             "required": false,
    44185277                            "description": "Unique identifier for the object.",
    4419                             "type": "integer"
     5278                            "type": "integer",
     5279                            "required": false
    44205280                        },
    44215281                        "context": {
    4422                             "required": false,
    4423                             "default": "view",
     5282                            "description": "Scope under which the request is made; determines fields present in response.",
     5283                            "type": "string",
    44245284                            "enum": [
    44255285                                "view",
     
    44275287                                "edit"
    44285288                            ],
    4429                             "description": "Scope under which the request is made; determines fields present in response.",
    4430                             "type": "string"
     5289                            "default": "view",
     5290                            "required": false
    44315291                        },
    44325292                        "password": {
    4433                             "required": false,
    44345293                            "description": "The password for the parent post of the comment (if the post is password protected).",
    4435                             "type": "string"
     5294                            "type": "string",
     5295                            "required": false
    44365296                        }
    44375297                    }
     
    44455305                    "args": {
    44465306                        "id": {
    4447                             "required": false,
    44485307                            "description": "Unique identifier for the object.",
    4449                             "type": "integer"
     5308                            "type": "integer",
     5309                            "required": false
    44505310                        },
    44515311                        "author": {
    4452                             "required": false,
    44535312                            "description": "The ID of the user object, if author was a user.",
    4454                             "type": "integer"
     5313                            "type": "integer",
     5314                            "required": false
    44555315                        },
    44565316                        "author_email": {
    4457                             "required": false,
    44585317                            "description": "Email address for the object author.",
    4459                             "type": "string"
     5318                            "type": "string",
     5319                            "format": "email",
     5320                            "required": false
    44605321                        },
    44615322                        "author_ip": {
    4462                             "required": false,
    44635323                            "description": "IP address for the object author.",
    4464                             "type": "string"
     5324                            "type": "string",
     5325                            "format": "ip",
     5326                            "required": false
    44655327                        },
    44665328                        "author_name": {
    4467                             "required": false,
    44685329                            "description": "Display name for the object author.",
    4469                             "type": "string"
     5330                            "type": "string",
     5331                            "required": false
    44705332                        },
    44715333                        "author_url": {
    4472                             "required": false,
    44735334                            "description": "URL for the object author.",
    4474                             "type": "string"
     5335                            "type": "string",
     5336                            "format": "uri",
     5337                            "required": false
    44755338                        },
    44765339                        "author_user_agent": {
    4477                             "required": false,
    44785340                            "description": "User agent for the object author.",
    4479                             "type": "string"
     5341                            "type": "string",
     5342                            "required": false
    44805343                        },
    44815344                        "content": {
    4482                             "required": false,
    44835345                            "description": "The content for the object.",
    4484                             "type": "object"
     5346                            "type": "object",
     5347                            "properties": {
     5348                                "raw": {
     5349                                    "description": "Content for the object, as it exists in the database.",
     5350                                    "type": "string",
     5351                                    "context": [
     5352                                        "edit"
     5353                                    ]
     5354                                },
     5355                                "rendered": {
     5356                                    "description": "HTML content for the object, transformed for display.",
     5357                                    "type": "string",
     5358                                    "context": [
     5359                                        "view",
     5360                                        "edit",
     5361                                        "embed"
     5362                                    ],
     5363                                    "readonly": true
     5364                                }
     5365                            },
     5366                            "required": false
    44855367                        },
    44865368                        "date": {
    4487                             "required": false,
    44885369                            "description": "The date the object was published, in the site's timezone.",
    4489                             "type": "string"
     5370                            "type": "string",
     5371                            "format": "date-time",
     5372                            "required": false
    44905373                        },
    44915374                        "date_gmt": {
    4492                             "required": false,
    44935375                            "description": "The date the object was published, as GMT.",
    4494                             "type": "string"
     5376                            "type": "string",
     5377                            "format": "date-time",
     5378                            "required": false
    44955379                        },
    44965380                        "parent": {
    4497                             "required": false,
    44985381                            "description": "The ID for the parent of the object.",
    4499                             "type": "integer"
     5382                            "type": "integer",
     5383                            "required": false
    45005384                        },
    45015385                        "post": {
    4502                             "required": false,
    45035386                            "description": "The ID of the associated post object.",
    4504                             "type": "integer"
     5387                            "type": "integer",
     5388                            "required": false
    45055389                        },
    45065390                        "status": {
    4507                             "required": false,
    45085391                            "description": "State of the object.",
    4509                             "type": "string"
     5392                            "type": "string",
     5393                            "required": false
    45105394                        },
    45115395                        "meta": {
    4512                             "required": false,
    45135396                            "description": "Meta fields.",
    4514                             "type": "object"
     5397                            "type": "object",
     5398                            "properties": [],
     5399                            "required": false
    45155400                        }
    45165401                    }
     
    45225407                    "args": {
    45235408                        "id": {
    4524                             "required": false,
    45255409                            "description": "Unique identifier for the object.",
    4526                             "type": "integer"
     5410                            "type": "integer",
     5411                            "required": false
    45275412                        },
    45285413                        "force": {
    4529                             "required": false,
     5414                            "type": "boolean",
    45305415                            "default": false,
    45315416                            "description": "Whether to bypass Trash and force deletion.",
    4532                             "type": "boolean"
     5417                            "required": false
    45335418                        },
    45345419                        "password": {
    4535                             "required": false,
    45365420                            "description": "The password for the parent post of the comment (if the post is password protected).",
    4537                             "type": "string"
     5421                            "type": "string",
     5422                            "required": false
    45385423                        }
    45395424                    }
     
    45535438                    "args": {
    45545439                        "context": {
    4555                             "required": false,
    4556                             "default": "view",
     5440                            "description": "Scope under which the request is made; determines fields present in response.",
     5441                            "type": "string",
    45575442                            "enum": [
    45585443                                "view",
    45595444                                "embed"
    45605445                            ],
    4561                             "description": "Scope under which the request is made; determines fields present in response.",
    4562                             "type": "string"
     5446                            "default": "view",
     5447                            "required": false
    45635448                        },
    45645449                        "page": {
    4565                             "required": false,
     5450                            "description": "Current page of the collection.",
     5451                            "type": "integer",
    45665452                            "default": 1,
    4567                             "description": "Current page of the collection.",
    4568                             "type": "integer"
     5453                            "minimum": 1,
     5454                            "required": false
    45695455                        },
    45705456                        "per_page": {
    4571                             "required": false,
     5457                            "description": "Maximum number of items to be returned in result set.",
     5458                            "type": "integer",
    45725459                            "default": 10,
    4573                             "description": "Maximum number of items to be returned in result set.",
    4574                             "type": "integer"
     5460                            "minimum": 1,
     5461                            "maximum": 100,
     5462                            "required": false
    45755463                        },
    45765464                        "search": {
    4577                             "required": false,
    45785465                            "description": "Limit results to those matching a string.",
    4579                             "type": "string"
     5466                            "type": "string",
     5467                            "required": false
    45805468                        },
    45815469                        "type": {
    4582                             "required": false,
    45835470                            "default": "post",
     5471                            "description": "Limit results to items of an object type.",
     5472                            "type": "string",
    45845473                            "enum": [
    45855474                                "post",
     
    45875476                                "post-format"
    45885477                            ],
    4589                             "description": "Limit results to items of an object type.",
    4590                             "type": "string"
     5478                            "required": false
    45915479                        },
    45925480                        "subtype": {
    4593                             "required": false,
    45945481                            "default": "any",
    45955482                            "description": "Limit results to items of one or more object subtypes.",
     
    46045491                                ],
    46055492                                "type": "string"
    4606                             }
     5493                            },
     5494                            "required": false
    46075495                        }
    46085496                    }
     
    46275515                    "args": {
    46285516                        "name": {
    4629                             "required": false,
    46305517                            "description": "Unique registered name for the block.",
    4631                             "type": "string"
     5518                            "type": "string",
     5519                            "required": false
    46325520                        },
    46335521                        "context": {
    4634                             "required": false,
     5522                            "description": "Scope under which the request is made; determines fields present in response.",
     5523                            "type": "string",
     5524                            "enum": [
     5525                                "edit"
     5526                            ],
    46355527                            "default": "view",
    4636                             "enum": [
    4637                                 "edit"
    4638                             ],
    4639                             "description": "Scope under which the request is made; determines fields present in response.",
    4640                             "type": "string"
     5528                            "required": false
    46415529                        },
    46425530                        "attributes": {
    4643                             "required": false,
     5531                            "description": "Attributes for the block.",
     5532                            "type": "object",
    46445533                            "default": [],
    4645                             "description": "Attributes for the block.",
    4646                             "type": "object"
     5534                            "required": false
    46475535                        },
    46485536                        "post_id": {
    4649                             "required": false,
    46505537                            "description": "ID of the post context.",
    4651                             "type": "integer"
     5538                            "type": "integer",
     5539                            "required": false
    46525540                        }
    46535541                    }
     
    46675555                    "args": {
    46685556                        "context": {
    4669                             "required": false,
    4670                             "default": "view",
     5557                            "description": "Scope under which the request is made; determines fields present in response.",
     5558                            "type": "string",
    46715559                            "enum": [
    46725560                                "view",
     
    46745562                                "edit"
    46755563                            ],
    4676                             "description": "Scope under which the request is made; determines fields present in response.",
    4677                             "type": "string"
     5564                            "default": "view",
     5565                            "required": false
    46785566                        },
    46795567                        "namespace": {
    4680                             "required": false,
    46815568                            "description": "Block namespace.",
    4682                             "type": "string"
     5569                            "type": "string",
     5570                            "required": false
    46835571                        }
    46845572                    }
     
    47055593                    "args": {
    47065594                        "context": {
    4707                             "required": false,
    4708                             "default": "view",
     5595                            "description": "Scope under which the request is made; determines fields present in response.",
     5596                            "type": "string",
    47095597                            "enum": [
    47105598                                "view",
     
    47125600                                "edit"
    47135601                            ],
    4714                             "description": "Scope under which the request is made; determines fields present in response.",
    4715                             "type": "string"
     5602                            "default": "view",
     5603                            "required": false
    47165604                        },
    47175605                        "namespace": {
    4718                             "required": false,
    47195606                            "description": "Block namespace.",
    4720                             "type": "string"
     5607                            "type": "string",
     5608                            "required": false
    47215609                        }
    47225610                    }
     
    47365624                    "args": {
    47375625                        "name": {
    4738                             "required": false,
    47395626                            "description": "Block name.",
    4740                             "type": "string"
     5627                            "type": "string",
     5628                            "required": false
    47415629                        },
    47425630                        "namespace": {
    4743                             "required": false,
    47445631                            "description": "Block namespace.",
    4745                             "type": "string"
     5632                            "type": "string",
     5633                            "required": false
    47465634                        },
    47475635                        "context": {
    4748                             "required": false,
    4749                             "default": "view",
     5636                            "description": "Scope under which the request is made; determines fields present in response.",
     5637                            "type": "string",
    47505638                            "enum": [
    47515639                                "view",
     
    47535641                                "edit"
    47545642                            ],
    4755                             "description": "Scope under which the request is made; determines fields present in response.",
    4756                             "type": "string"
     5643                            "default": "view",
     5644                            "required": false
    47575645                        }
    47585646                    }
     
    47835671                    "args": {
    47845672                        "title": {
    4785                             "required": false,
    47865673                            "description": "Site title.",
    4787                             "type": "string"
     5674                            "type": "string",
     5675                            "required": false
    47885676                        },
    47895677                        "description": {
    4790                             "required": false,
    47915678                            "description": "Site tagline.",
    4792                             "type": "string"
     5679                            "type": "string",
     5680                            "required": false
    47935681                        },
    47945682                        "url": {
    4795                             "required": false,
    47965683                            "description": "Site URL.",
    4797                             "type": "string"
     5684                            "type": "string",
     5685                            "format": "uri",
     5686                            "required": false
    47985687                        },
    47995688                        "email": {
    4800                             "required": false,
    48015689                            "description": "This address is used for admin purposes, like new user notification.",
    4802                             "type": "string"
     5690                            "type": "string",
     5691                            "format": "email",
     5692                            "required": false
    48035693                        },
    48045694                        "timezone": {
    4805                             "required": false,
    48065695                            "description": "A city in the same timezone as you.",
    4807                             "type": "string"
     5696                            "type": "string",
     5697                            "required": false
    48085698                        },
    48095699                        "date_format": {
    4810                             "required": false,
    48115700                            "description": "A date format for all date strings.",
    4812                             "type": "string"
     5701                            "type": "string",
     5702                            "required": false
    48135703                        },
    48145704                        "time_format": {
    4815                             "required": false,
    48165705                            "description": "A time format for all time strings.",
    4817                             "type": "string"
     5706                            "type": "string",
     5707                            "required": false
    48185708                        },
    48195709                        "start_of_week": {
    4820                             "required": false,
    48215710                            "description": "A day number of the week that the week should start on.",
    4822                             "type": "integer"
     5711                            "type": "integer",
     5712                            "required": false
    48235713                        },
    48245714                        "language": {
    4825                             "required": false,
    48265715                            "description": "WordPress locale code.",
    4827                             "type": "string"
     5716                            "type": "string",
     5717                            "required": false
    48285718                        },
    48295719                        "use_smilies": {
    4830                             "required": false,
    48315720                            "description": "Convert emoticons like :-) and :-P to graphics on display.",
    4832                             "type": "boolean"
     5721                            "type": "boolean",
     5722                            "required": false
    48335723                        },
    48345724                        "default_category": {
    4835                             "required": false,
    48365725                            "description": "Default post category.",
    4837                             "type": "integer"
     5726                            "type": "integer",
     5727                            "required": false
    48385728                        },
    48395729                        "default_post_format": {
    4840                             "required": false,
    48415730                            "description": "Default post format.",
    4842                             "type": "string"
     5731                            "type": "string",
     5732                            "required": false
    48435733                        },
    48445734                        "posts_per_page": {
    4845                             "required": false,
    48465735                            "description": "Blog pages show at most.",
    4847                             "type": "integer"
     5736                            "type": "integer",
     5737                            "required": false
    48485738                        },
    48495739                        "default_ping_status": {
    4850                             "required": false,
     5740                            "description": "Allow link notifications from other blogs (pingbacks and trackbacks) on new articles.",
     5741                            "type": "string",
    48515742                            "enum": [
    48525743                                "open",
    48535744                                "closed"
    48545745                            ],
    4855                             "description": "Allow link notifications from other blogs (pingbacks and trackbacks) on new articles.",
    4856                             "type": "string"
     5746                            "required": false
    48575747                        },
    48585748                        "default_comment_status": {
    4859                             "required": false,
     5749                            "description": "Allow people to submit comments on new posts.",
     5750                            "type": "string",
    48605751                            "enum": [
    48615752                                "open",
    48625753                                "closed"
    48635754                            ],
    4864                             "description": "Allow people to submit comments on new posts.",
    4865                             "type": "string"
     5755                            "required": false
    48665756                        }
    48675757                    }
     
    48845774                    "args": {
    48855775                        "context": {
    4886                             "required": false,
    48875776                            "description": "Scope under which the request is made; determines fields present in response.",
    4888                             "type": "string"
     5777                            "type": "string",
     5778                            "required": false
    48895779                        },
    48905780                        "page": {
    4891                             "required": false,
     5781                            "description": "Current page of the collection.",
     5782                            "type": "integer",
    48925783                            "default": 1,
    4893                             "description": "Current page of the collection.",
    4894                             "type": "integer"
     5784                            "minimum": 1,
     5785                            "required": false
    48955786                        },
    48965787                        "per_page": {
    4897                             "required": false,
     5788                            "description": "Maximum number of items to be returned in result set.",
     5789                            "type": "integer",
    48985790                            "default": 10,
    4899                             "description": "Maximum number of items to be returned in result set.",
    4900                             "type": "integer"
     5791                            "minimum": 1,
     5792                            "maximum": 100,
     5793                            "required": false
    49015794                        },
    49025795                        "search": {
    4903                             "required": false,
    49045796                            "description": "Limit results to those matching a string.",
    4905                             "type": "string"
     5797                            "type": "string",
     5798                            "required": false
    49065799                        },
    49075800                        "status": {
    4908                             "required": true,
    49095801                            "description": "Limit result set to themes assigned one or more statuses.",
    49105802                            "type": "array",
     
    49145806                                ],
    49155807                                "type": "string"
    4916                             }
     5808                            },
     5809                            "required": true
    49175810                        }
    49185811                    }
     
    49365829                    "args": {
    49375830                        "context": {
    4938                             "required": false,
    4939                             "default": "view",
     5831                            "description": "Scope under which the request is made; determines fields present in response.",
     5832                            "type": "string",
    49405833                            "enum": [
    49415834                                "view",
     
    49435836                                "edit"
    49445837                            ],
    4945                             "description": "Scope under which the request is made; determines fields present in response.",
    4946                             "type": "string"
     5838                            "default": "view",
     5839                            "required": false
    49475840                        },
    49485841                        "search": {
    4949                             "required": false,
    49505842                            "description": "Limit results to those matching a string.",
    4951                             "type": "string"
     5843                            "type": "string",
     5844                            "required": false
    49525845                        },
    49535846                        "status": {
    4954                             "required": false,
    49555847                            "description": "Limits results to plugins with the given status.",
    49565848                            "type": "array",
     
    49615853                                    "active"
    49625854                                ]
    4963                             }
     5855                            },
     5856                            "required": false
    49645857                        }
    49655858                    }
     
    49715864                    "args": {
    49725865                        "slug": {
    4973                             "required": true,
     5866                            "type": "string",
    49745867                            "description": "WordPress.org plugin directory slug.",
    4975                             "type": "string"
     5868                            "pattern": "[\\w\\-]+",
     5869                            "required": true
    49765870                        },
    49775871                        "status": {
    4978                             "required": false,
    4979                             "default": "inactive",
     5872                            "description": "The plugin activation status.",
     5873                            "type": "string",
    49805874                            "enum": [
    49815875                                "inactive",
    49825876                                "active"
    49835877                            ],
    4984                             "description": "The plugin activation status.",
    4985                             "type": "string"
     5878                            "default": "inactive",
     5879                            "required": false
    49865880                        }
    49875881                    }
     
    50125906                    "args": {
    50135907                        "context": {
    5014                             "required": false,
    5015                             "default": "view",
     5908                            "description": "Scope under which the request is made; determines fields present in response.",
     5909                            "type": "string",
    50165910                            "enum": [
    50175911                                "view",
     
    50195913                                "edit"
    50205914                            ],
    5021                             "description": "Scope under which the request is made; determines fields present in response.",
    5022                             "type": "string"
     5915                            "default": "view",
     5916                            "required": false
    50235917                        },
    50245918                        "plugin": {
    5025                             "required": false,
    5026                             "type": "string"
     5919                            "type": "string",
     5920                            "pattern": "[^.\\/]+(?:\\/[^.\\/]+)?",
     5921                            "required": false
    50275922                        }
    50285923                    }
     
    50365931                    "args": {
    50375932                        "context": {
    5038                             "required": false,
    5039                             "default": "view",
     5933                            "description": "Scope under which the request is made; determines fields present in response.",
     5934                            "type": "string",
    50405935                            "enum": [
    50415936                                "view",
     
    50435938                                "edit"
    50445939                            ],
    5045                             "description": "Scope under which the request is made; determines fields present in response.",
    5046                             "type": "string"
     5940                            "default": "view",
     5941                            "required": false
    50475942                        },
    50485943                        "plugin": {
    5049                             "required": false,
    5050                             "type": "string"
     5944                            "type": "string",
     5945                            "pattern": "[^.\\/]+(?:\\/[^.\\/]+)?",
     5946                            "required": false
    50515947                        },
    50525948                        "status": {
    5053                             "required": false,
     5949                            "description": "The plugin activation status.",
     5950                            "type": "string",
    50545951                            "enum": [
    50555952                                "inactive",
    50565953                                "active"
    50575954                            ],
    5058                             "description": "The plugin activation status.",
    5059                             "type": "string"
     5955                            "required": false
    50605956                        }
    50615957                    }
     
    50675963                    "args": {
    50685964                        "context": {
    5069                             "required": false,
    5070                             "default": "view",
     5965                            "description": "Scope under which the request is made; determines fields present in response.",
     5966                            "type": "string",
    50715967                            "enum": [
    50725968                                "view",
     
    50745970                                "edit"
    50755971                            ],
    5076                             "description": "Scope under which the request is made; determines fields present in response.",
    5077                             "type": "string"
     5972                            "default": "view",
     5973                            "required": false
    50785974                        },
    50795975                        "plugin": {
    5080                             "required": false,
    5081                             "type": "string"
     5976                            "type": "string",
     5977                            "pattern": "[^.\\/]+(?:\\/[^.\\/]+)?",
     5978                            "required": false
    50825979                        }
    50835980                    }
     
    50975994                    "args": {
    50985995                        "context": {
    5099                             "required": false,
     5996                            "description": "Scope under which the request is made; determines fields present in response.",
     5997                            "type": "string",
     5998                            "enum": [
     5999                                "view"
     6000                            ],
    51006001                            "default": "view",
    5101                             "enum": [
    5102                                 "view"
    5103                             ],
    5104                             "description": "Scope under which the request is made; determines fields present in response.",
    5105                             "type": "string"
     6002                            "required": false
    51066003                        },
    51076004                        "page": {
    5108                             "required": false,
     6005                            "description": "Current page of the collection.",
     6006                            "type": "integer",
    51096007                            "default": 1,
    5110                             "description": "Current page of the collection.",
    5111                             "type": "integer"
     6008                            "minimum": 1,
     6009                            "required": false
    51126010                        },
    51136011                        "per_page": {
    5114                             "required": false,
     6012                            "description": "Maximum number of items to be returned in result set.",
     6013                            "type": "integer",
    51156014                            "default": 10,
    5116                             "description": "Maximum number of items to be returned in result set.",
    5117                             "type": "integer"
     6015                            "minimum": 1,
     6016                            "maximum": 100,
     6017                            "required": false
    51186018                        },
    51196019                        "term": {
    5120                             "required": true,
    51216020                            "description": "Limit result set to blocks matching the search term.",
    5122                             "type": "string"
     6021                            "type": "string",
     6022                            "minLength": 1,
     6023                            "required": true
    51236024                        }
    51246025                    }
     
    51456046                    "args": {
    51466047                        "namespace": {
    5147                             "required": false,
    5148                             "default": "wp-site-health/v1"
     6048                            "default": "wp-site-health/v1",
     6049                            "required": false
    51496050                        },
    51506051                        "context": {
    5151                             "required": false,
    5152                             "default": "view"
     6052                            "default": "view",
     6053                            "required": false
    51536054                        }
    51546055                    }
     
    52656166                    "args": {
    52666167                        "namespace": {
    5267                             "required": false,
    5268                             "default": "oembed/1.0"
     6168                            "default": "oembed/1.0",
     6169                            "required": false
    52696170                        },
    52706171                        "context": {
    5271                             "required": false,
    5272                             "default": "view"
     6172                            "default": "view",
     6173                            "required": false
    52736174                        }
    52746175                    }
     
    52916192                    "args": {
    52926193                        "url": {
    5293                             "required": true,
    52946194                            "description": "The URL of the resource for which to fetch oEmbed data.",
    5295                             "type": "string"
     6195                            "type": "string",
     6196                            "format": "uri",
     6197                            "required": true
    52966198                        },
    52976199                        "format": {
    5298                             "required": false,
    5299                             "default": "json"
     6200                            "default": "json",
     6201                            "required": false
    53006202                        },
    53016203                        "maxwidth": {
    5302                             "required": false,
    5303                             "default": 600
     6204                            "default": 600,
     6205                            "required": false
    53046206                        }
    53056207                    }
     
    53226224                    "args": {
    53236225                        "url": {
    5324                             "required": true,
    53256226                            "description": "The URL of the resource for which to fetch oEmbed data.",
    5326                             "type": "string"
     6227                            "type": "string",
     6228                            "format": "uri",
     6229                            "required": true
    53276230                        },
    53286231                        "format": {
    5329                             "required": false,
     6232                            "description": "The oEmbed format to use.",
     6233                            "type": "string",
    53306234                            "default": "json",
    53316235                            "enum": [
     
    53336237                                "xml"
    53346238                            ],
    5335                             "description": "The oEmbed format to use.",
    5336                             "type": "string"
     6239                            "required": false
    53376240                        },
    53386241                        "maxwidth": {
    5339                             "required": false,
     6242                            "description": "The maximum width of the embed frame in pixels.",
     6243                            "type": "integer",
    53406244                            "default": 600,
    5341                             "description": "The maximum width of the embed frame in pixels.",
    5342                             "type": "integer"
     6245                            "required": false
    53436246                        },
    53446247                        "maxheight": {
    5345                             "required": false,
    53466248                            "description": "The maximum height of the embed frame in pixels.",
    5347                             "type": "integer"
     6249                            "type": "integer",
     6250                            "required": false
    53486251                        },
    53496252                        "discover": {
    5350                             "required": false,
     6253                            "description": "Whether to perform an oEmbed discovery request for unsanctioned providers.",
     6254                            "type": "boolean",
    53516255                            "default": true,
    5352                             "description": "Whether to perform an oEmbed discovery request for unsanctioned providers.",
    5353                             "type": "boolean"
     6256                            "required": false
    53546257                        }
    53556258                    }
Note: See TracChangeset for help on using the changeset viewer.