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=4dd5e7ef732288c1c168a5b09cf426f55a3e994a;hp=2d035a3185e2ae831de2390cacfc28678b293a87;hpb=bb15362ac54aed461611cd130b2cf26068a3f478;p=oam.git diff --git a/code/network-generator/network_generation/parameter_validator.py b/code/network-generator/network_generation/parameter_validator.py index 2d035a3..4c1dabe 100644 --- a/code/network-generator/network_generation/parameter_validator.py +++ b/code/network-generator/network_generation/parameter_validator.py @@ -12,13 +12,15 @@ # 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 -import json +from typing import Any + import jsonschema @@ -38,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] @@ -82,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 """