mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 14:36:52 +00:00
remove justinrainbow/json-schema again
Signed-off-by: Simon L <szaimen@e.mail.de> Co-Authored-By: szaimen <szaimen@users.noreply.github.com>
This commit is contained in:
parent
3e08843b14
commit
dbdefe273f
3 changed files with 9 additions and 96 deletions
|
|
@ -12,7 +12,6 @@ use AIO\Container\State\RunningState;
|
|||
use AIO\Data\ConfigurationManager;
|
||||
use AIO\Data\DataConst;
|
||||
use AIO\Docker\DockerActionManager;
|
||||
use JsonSchema\Validator;
|
||||
|
||||
class ContainerDefinitionFetcher
|
||||
{
|
||||
|
|
@ -41,27 +40,12 @@ class ContainerDefinitionFetcher
|
|||
throw new \Exception("The provided id " . $id . " was not found in the container definition.");
|
||||
}
|
||||
|
||||
private function validateJson(object $data): void {
|
||||
// Validate against json schema
|
||||
$validator = new Validator;
|
||||
$validator->validate($data, (object)[file_get_contents(__DIR__ . '/../containers-schema.json')]);
|
||||
if (!$validator->isValid()) {
|
||||
error_log("JSON does not validate. Violations:");
|
||||
foreach ($validator->getErrors() as $error) {
|
||||
error_log((string)printf("[%s] %s\n", $error['property'], $error['message']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
private function GetDefinition(bool $latest): array
|
||||
{
|
||||
$rawData = file_get_contents(__DIR__ . '/../containers.json');
|
||||
$objectData = json_decode($rawData, false);
|
||||
$this->validateJson($objectData);
|
||||
$data = json_decode($rawData, true);
|
||||
$data = json_decode(file_get_contents(__DIR__ . '/../containers.json'), true);
|
||||
|
||||
$containers = [];
|
||||
foreach ($data['aio_services_v1'] as $entry) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue