Index: src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
===================================================================
--- src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php	(revision 49042)
+++ src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php	(working copy)
@@ -718,9 +718,9 @@
 		if ( in_array( 'media_details', $fields, true ) ) {
 			$data['media_details'] = wp_get_attachment_metadata( $post->ID );
 
-			// Ensure empty details is an empty object.
+			// Ensure empty details is an empty array.
 			if ( empty( $data['media_details'] ) ) {
-				$data['media_details'] = new stdClass;
+				$data['media_details'] = array();
 			} elseif ( ! empty( $data['media_details']['sizes'] ) ) {
 
 				foreach ( $data['media_details']['sizes'] as $size => &$size_data ) {
@@ -751,7 +751,7 @@
 					);
 				}
 			} else {
-				$data['media_details']['sizes'] = new stdClass;
+				$data['media_details']['sizes'] = array();
 			}
 		}
 
@@ -883,7 +883,7 @@
 
 		$schema['properties']['media_details'] = array(
 			'description' => __( 'Details about the media file, specific to its type.' ),
-			'type'        => 'object',
+			'type'        => 'array',
 			'context'     => array( 'view', 'edit', 'embed' ),
 			'readonly'    => true,
 		);
Index: tests/phpunit/tests/rest-api/rest-attachments-controller.php
===================================================================
--- tests/phpunit/tests/rest-api/rest-attachments-controller.php	(revision 49042)
+++ tests/phpunit/tests/rest-api/rest-attachments-controller.php	(working copy)
@@ -604,6 +604,8 @@
 		$original_image_src = wp_get_attachment_image_src( $attachment_id, 'full' );
 		remove_image_size( 'rest-api-test' );
 
+		$this->assertInternalType( 'array', $data['media_details'] );
+		$this->assertInternalType( 'array', $data['media_details']['sizes'] );
 		$this->assertSame( $image_src[0], $data['media_details']['sizes']['rest-api-test']['source_url'] );
 		$this->assertSame( 'image/jpeg', $data['media_details']['sizes']['rest-api-test']['mime_type'] );
 		$this->assertSame( $original_image_src[0], $data['media_details']['sizes']['full']['source_url'] );
