diff --git a/jsf/schema_types/array.py b/jsf/schema_types/array.py index e24268e..bb047a1 100644 --- a/jsf/schema_types/array.py +++ b/jsf/schema_types/array.py @@ -29,7 +29,7 @@ def generate(self, context: Dict[str, Any]) -> Optional[List[Any]]: output = [ self.items.generate(context) - for _ in range(random.randint(self.minItems, self.maxItems)) + for _ in range(random.randint(int(self.minItems), int(self.maxItems))) ] if self.uniqueItems and self.items.type == "object": output = [dict(s) for s in {frozenset(d.items()) for d in output}] diff --git a/jsf/schema_types/number.py b/jsf/schema_types/number.py index 38cd63d..c98aa30 100644 --- a/jsf/schema_types/number.py +++ b/jsf/schema_types/number.py @@ -34,7 +34,7 @@ def generate(self, context: Dict[str, Any]) -> Optional[float]: _max = self.maximum return float( - step * random.randint(math.ceil(float(_min) / step), math.floor(float(_max) / step)) + step * random.uniform(math.ceil(float(_min) / step), math.floor(float(_max) / step)) ) def model(self, context: Dict[str, Any]): diff --git a/jsf/schema_types/string.py b/jsf/schema_types/string.py index 623615d..5611881 100644 --- a/jsf/schema_types/string.py +++ b/jsf/schema_types/string.py @@ -68,7 +68,7 @@ def temporal_duration( def mostly_zero_randint(_min: int, _max: int) -> int: - return 0 if random.random() > 0.8 else random.randint(_min, _max) + return 0 if random.random() > 0.8 else random.randint(int(_min), int(_max)) def fake_duration():