Skip to content

Commit 6179b80

Browse files
author
Yorick Girard
committed
Add exception in readFromJsonFile
The InvalidJsonPointerSyntaxException can be thrown in readFromJsonFile, users need to know it in order to catch it.
1 parent 310de02 commit 6179b80

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Reader.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use cebe\openapi\exceptions\IOException;
1111
use cebe\openapi\exceptions\TypeErrorException;
1212
use cebe\openapi\exceptions\UnresolvableReferenceException;
13+
use cebe\openapi\json\InvalidJsonPointerSyntaxException;
1314
use cebe\openapi\json\JsonPointer;
1415
use cebe\openapi\spec\OpenApi;
1516
use Symfony\Component\Yaml\Yaml;
@@ -69,6 +70,7 @@ public static function readFromYaml(string $yaml, string $baseType = OpenApi::cl
6970
* @throws TypeErrorException in case invalid spec data is supplied.
7071
* @throws UnresolvableReferenceException in case references could not be resolved.
7172
* @throws IOException when the file is not readable.
73+
* @throws InvalidJsonPointerSyntaxException in case an invalid JSON pointer string is passed to the spec references
7274
*/
7375
public static function readFromJsonFile(string $fileName, string $baseType = OpenApi::class, $resolveReferences = true): SpecObjectInterface
7476
{

0 commit comments

Comments
 (0)