[ 'self' => [ // @todo This can use a proper link once // https://www.drupal.org/project/drupal/issues/2907402 is complete. // This link matches what is generated from from File::url(), a // resource URL is currently not available. 'href' => file_create_url($normalization['uri'][0]['value']), ], 'type' => [ 'href' => $this->baseUrl . '/rest/type/file/file', ], $this->baseUrl . '/rest/relation/file/file/uid' => [ ['href' => $this->baseUrl . '/user/' . $this->account->id() . '?_format=hal_json'] ], ], '_embedded' => [ $this->baseUrl . '/rest/relation/file/file/uid' => [ [ '_links' => [ 'self' => [ 'href' => $this->baseUrl . '/user/' . $this->account->id() . '?_format=hal_json', ], 'type' => [ 'href' => $this->baseUrl . '/rest/type/user/user', ], ], 'uuid' => [ [ 'value' => $this->account->uuid(), ], ], ], ], ], ]; } /** * {@inheritdoc} * * @see \Drupal\Tests\hal\Functional\EntityResource\EntityTest\EntityTestHalJsonAnonTest::getNormalizedPostEntity() */ protected function getNormalizedPostEntity() { return parent::getNormalizedPostEntity() + [ '_links' => [ 'type' => [ 'href' => $this->baseUrl . '/rest/type/entity_test/entity_test', ], ], ]; } }