Skip to content

Commit

Permalink
modifying descriptions and correcting count and seed value
Browse files Browse the repository at this point in the history
  • Loading branch information
Vibaswan committed Jun 23, 2024
1 parent b9d3b82 commit 1bf95b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
24 changes: 8 additions & 16 deletions openapiart/bundler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1080,23 +1080,27 @@ def _generate_value_schema(
"type": "object",
"properties": {
"min": {
"description": "The minimum value to be provided for the random range.",
"description": "The minimum possible value generated by the random value generator.",
"type": type_name,
"x-field-uid": random_auto_field.uid,
},
"max": {
"description": "The maximum value to be provided for the random range.",
"description": "The maximum possible value generated by the random value generator.",
"type": type_name,
"x-field-uid": random_auto_field.uid,
},
"seed": {
"description": "The seed value to be provided for the random number generation.",
"description": "The seed value to initialize the random value generator to a deterministic state.",
"type": "integer",
"default": 1,
"format": "uint32",
"x-field-uid": random_auto_field.uid,
},
"count": {
"description": "The numbere of values to be genrated.",
"description": "The total number of values to be generated by the random value generator.",
"type": "integer",
"default": 1,
"format": "uint32",
"x-field-uid": random_auto_field.uid,
},
},
Expand All @@ -1113,18 +1117,6 @@ def _generate_value_schema(
fmt,
property_name="max",
)
self._apply_common_x_field_pattern_properties(
random_schema["properties"]["seed"],
xpattern,
pattern_fmt,
property_name="seed",
)
self._apply_common_x_field_pattern_properties(
random_schema["properties"]["count"],
xpattern,
pattern_fmt,
property_name="count",
)

self._content["components"]["schemas"][
random_pattern_name
Expand Down
2 changes: 0 additions & 2 deletions openapiart/tests/test_random_pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@ def test_random_pattern_integer_format(default_config):

assert rnd._TYPES.get("count").get("format") == "uint32"
assert rnd._TYPES.get("count").get("type") == int
assert rnd._TYPES.get("count").get("maximum") == 255
assert rnd._DEFAULTS.get("count") == 1

assert rnd._TYPES.get("seed").get("format") == "uint32"
assert rnd._TYPES.get("seed").get("type") == int
assert rnd._TYPES.get("seed").get("maximum") == 255
assert rnd._DEFAULTS.get("seed") == 1

data = default_config.serialize("dict")
Expand Down

0 comments on commit 1bf95b9

Please sign in to comment.