X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=code%2Fnetwork-generator%2Fnetwork_generation%2Fparameter_validator.py;h=4c1dabe940f5d9ba8d9614536d2649040bcc69b9;hb=refs%2Fheads%2Fmaster;hp=2c472991d908379acf719eb975644bb97a3ef10b;hpb=75e7c88e53a85bad86adef4d0e717c1ef964ac74;p=oam.git diff --git a/code/network-generator/network_generation/parameter_validator.py b/code/network-generator/network_generation/parameter_validator.py index 2c47299..4c1dabe 100644 --- a/code/network-generator/network_generation/parameter_validator.py +++ b/code/network-generator/network_generation/parameter_validator.py @@ -12,13 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/usr/bin/python +# !/usr/bin/python """ Module containing a class for parameter validation """ import json import os import os.path +from typing import Any import jsonschema @@ -39,9 +40,8 @@ class ParameterValidator: __is_valid: bool = False # constructor - def __init__(self, args): + def __init__(self, args: list[str]) -> None: self.args = args - if len(self.args) > 1: self.__config_file = args[1] @@ -83,15 +83,17 @@ class ParameterValidator: def error_message(self) -> str: """ - Getter for the error message after validation process or an empty sting, - when configuration is valid. + Getter for the error message after validation process or an + empty sting, when configuration is valid. :return Error message as string. """ return self.__error_message # private - def __is_json_valid(self, json_data, json_schema) -> bool: + def __is_json_valid( + self, json_data: dict[str, Any], json_schema: dict[str, Any] + ) -> bool: """ Method validating json against a schema """