diff --git a/core/modules/rest/src/Tests/NodeTest.php b/core/modules/rest/src/Tests/NodeTest.php
index 7169102..ece7810 100644
--- a/core/modules/rest/src/Tests/NodeTest.php
+++ b/core/modules/rest/src/Tests/NodeTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\rest\Tests;
 
 use Drupal\Core\Url;
+use Drupal\node\Entity\Node;
 use Drupal\rest\Tests\RESTTestBase;
 
 /**
@@ -90,4 +91,32 @@ public function testNodes() {
     // Make sure that the UUID of the node has not changed.
     $this->assertEqual($node->get('uuid')->getValue(), $updated_node->get('uuid')->getValue(), 'UUID was not changed.');
   }
+
+  /**
+   * Test creating a node using json serialization.
+   */
+  public function testCreate() {
+    // Test creating a node
+    // Check that a simple PATCH update to the node title works as expected.
+    $this->enableNodeConfiguration('POST', 'create');
+    $this->enableService('entity:node', 'POST', 'json');
+    $data = array(
+      'type' => array(
+        array(
+          'target_id' => 'resttest',
+        ),
+      ),
+      'title' => array(
+        array(
+          'value' => $this->randomString(),
+        ),
+      ),
+    );
+    $serialized = $this->container->get('serializer')->serialize($data, 'json');
+    $this->httpRequest('/entity/node', 'POST', $serialized, 'application/json');
+    $this->assertResponse(201);
+    $node = Node::load(1);
+    $this->assertHeader('Location', $node->url('canonical', ['absolute' => TRUE]));
+  }
+
 }
diff --git a/core/modules/serialization/src/Normalizer/EntityNormalizer.php b/core/modules/serialization/src/Normalizer/EntityNormalizer.php
index 5e81b5a..e2fb3d1 100644
--- a/core/modules/serialization/src/Normalizer/EntityNormalizer.php
+++ b/core/modules/serialization/src/Normalizer/EntityNormalizer.php
@@ -44,21 +44,19 @@ public function __construct(EntityManagerInterface $entity_manager) {
    * {@inheritdoc}
    */
   public function denormalize($data, $class, $format = NULL, array $context = array()) {
-    if (empty($context['entity_type'])) {
-      throw new UnexpectedValueException('Entity type parameter must be included in context.');
-    }
-
-    $entity_type = $this->entityManager->getDefinition($context['entity_type']);
-
-    // The bundle property behaves differently from other entity properties.
+    $entity_type_id = $this->entityManager->getEntityTypeFromClass($class);
+    $entity_type = $this->entityManager->getDefinition($entity_type_id);
+    // The bundle property might be an entity reference.behaves differently from other entity properties.
     // i.e. the nested structure with a 'value' key does not work.
     if ($entity_type->hasKey('bundle')) {
       $bundle_key = $entity_type->getKey('bundle');
-      $type = $data[$bundle_key][0]['value'];
-      $data[$bundle_key] = $type;
+      $data[$bundle_key] = !empty($data[$bundle_key][0]['target_id']) ? $data[$bundle_key][0]['target_id'] : $data[$bundle_key][0]['value'];
     }
+    $entity =  $this->entityManager->getStorage($entity_type_id)->create($data);
+    // Pass the names of the fields whose values can be merged.
+    $entity->_restSubmittedFields = array_keys($data);
 
-    return $this->entityManager->getStorage($context['entity_type'])->create($data);
+    return $entity;
   }
 
 }
