1 | <?php |
2 | |
3 | require_once __DIR__ . "/BAD_REQUEST.php"; |
4 | require_once __DIR__ . "/ProblemDetails.php"; |
5 | |
6 | function validaJson($objeto) |
7 | { |
8 | |
9 | if ($objeto === null) |
10 | throw new ProblemDetails( |
11 | status: BAD_REQUEST, |
12 | title: "Los datos recibidos no son JSON.", |
13 | type: "/error/datosnojson.html", |
14 | detail: "Los datos recibidos no están en formato JSON.O", |
15 | ); |
16 | |
17 | return $objeto; |
18 | } |
19 |