Index: tests/phpunit/tests/rest-api.php
===================================================================
--- tests/phpunit/tests/rest-api.php	(revision 41745)
+++ tests/phpunit/tests/rest-api.php	(working copy)
@@ -430,6 +430,40 @@
 	}
 
 	/**
+		* Ensure that nested fields may be whitelisted with request['_fields'].
+		*/
+	public function test_rest_filter_response_fields_nested_field_filter() {
+		$response = new WP_REST_Response();
+
+		$response->set_data( array(
+			'a' => 0,
+			'b' => array(
+				'1' => 1,
+				'2' => 2,
+			),
+			'c' => 3,
+			'd' => array(
+				'4' => 4,
+				'5' => 5,
+			),
+		) );
+		$request = array(
+			'_fields' => array( 'b.1', 'c', 'd.5' )
+		);
+
+		$response = rest_filter_response_fields( $response, null, $request );
+		$this->assertEquals( array(
+			'b' => array(
+				'1' => 1,
+			),
+			'c' => 3,
+			'd' => array(
+				'5' => 5,
+			),
+		), $response->get_data() );
+	}
+
+	/**
 	 * The get_rest_url function should return a URL consistently terminated with a "/",
 	 * whether the blog is configured with pretty permalink support or not.
 	 */
