Skip to content

Commit bbdab5b

Browse files
committed
Do not require error links object to contain an about member
1 parent 911e667 commit bbdab5b

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

src/Parsers/LinksParser.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ public function parse($data, string $source): Links
4949
if (!is_object($data)) {
5050
throw new ValidationException(sprintf('Links MUST be an object, "%s" given.', gettype($data)));
5151
}
52-
if ($source === self::SOURCE_ERROR && !property_exists($data, 'about')) {
53-
throw new ValidationException('Error links object MUST contain at least one of the following properties: `about`.');
54-
}
5552
if ($source === self::SOURCE_RELATIONSHIP && !property_exists($data, 'self') && !property_exists($data, 'related')) {
5653
throw new ValidationException('Relationship links object MUST contain at least one of the following properties: `self`, `related`.');
5754
}

tests/Parsers/LinksParserTest.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,6 @@ public function it_throws_when_related_link_is_null()
127127
$parser->parse(json_decode('{"related": null}', false), LinksParser::SOURCE_DOCUMENT);
128128
}
129129

130-
/**
131-
* @test
132-
*/
133-
public function it_throws_when_error_links_misses_about_link()
134-
{
135-
$parser = new LinksParser($this->createMock(MetaParser::class));
136-
137-
$this->expectException(ValidationException::class);
138-
$this->expectExceptionMessage('Error links object MUST contain at least one of the following properties: `about`.');
139-
140-
$parser->parse(json_decode('{}', false), LinksParser::SOURCE_ERROR);
141-
}
142-
143130
/**
144131
* @test
145132
*/

0 commit comments

Comments
 (0)