protected function createJsonDefinition($json)
    {
        $errors = $this->validator->validateJsonDefinition($json);
        if (!empty($errors)) {
            throw new ValidationException($errors);
        }

        $definition = $this->serializer->deserialize(
            $json,
            'Graviton\\GeneratorBundle\\Definition\\Schema\\Definition',
            'json'
        );

        return new JsonDefinition($definition);
    }