diff --git a/jsf/schema_types/base.py b/jsf/schema_types/base.py index 65da271..fd7acc1 100644 --- a/jsf/schema_types/base.py +++ b/jsf/schema_types/base.py @@ -33,7 +33,7 @@ class BaseSchema(BaseModel): provider: Optional[str] = Field(None, alias="$provider") set_state: Optional[Dict[str, str]] = Field(None, alias="$state") is_nullable: bool = False - allow_none_optionals: float = 0.5 + allow_none_optionals: float = Field(0.5, ge=0.0, le=1.0) @classmethod def from_dict(cls, d: Dict): diff --git a/jsf/schema_types/string_utils/content_type/text__plain.py b/jsf/schema_types/string_utils/content_type/text__plain.py index 69ed7f9..c609b7e 100644 --- a/jsf/schema_types/string_utils/content_type/text__plain.py +++ b/jsf/schema_types/string_utils/content_type/text__plain.py @@ -16,7 +16,7 @@ def random_fixed_length_sentence(_min: int = 0, _max: int = 50) -> str: valid_words = list(filter(lambda s: len(s) <= remaining, LOREM)) if len(valid_words) == 0: break - if len(output) >= _min and random.uniform(0, 1) > 0.5: + if len(output) >= _min and random.uniform(0, 1) > 0.9: break output += random.choice(valid_words) + " " output = output.strip()