WordPress/wp-includes/rest-api
danielbachhuber 6b781c6823 REST API: Preserve unknown, respect null in server-side block rendering.
* Skips validation where there is no attribute definition, but keeps the attribute value. Previously, the attribute would be omitted from the attributes passed to `render_callback`. Notably, this resolves an issue where `render_callback` cannot receive a block's `align` and `customClassName` attribute values, since these are defined as a client-side filter.
* Validates `null` as a proper value in its own right. Previously, a client implementation of a block could track `{"attribute":null}` as an explicitly empty value, and the server would wrongly initiate defaulting behavior. The new behavior will now only populate a default value if the attribute is not defined at all, including when unset in its being invalid per the attribute schema.

Props aduth, noisysocks, youknowriad.
See #45145 for the patch, #45098 for the original ticket.

Built from https://develop.svn.wordpress.org/branches/5.0@43918


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-11-21 14:44:48 +00:00
..
endpoints REST API: Preserve unknown, respect null in server-side block rendering. 2018-11-21 14:44:48 +00:00
fields REST API: Slash existing meta values when comparing with incoming meta upates. 2018-10-17 20:10:25 +00:00
search REST API: Introduce controller for searching across post types. 2018-10-17 17:03:26 +00:00
class-wp-rest-request.php
class-wp-rest-response.php
class-wp-rest-server.php