Skip to content

Commit

Permalink
Fix dictionary issue with string objects
Browse files Browse the repository at this point in the history
  • Loading branch information
costeanadrian committed May 30, 2022
1 parent db566cb commit 859a2ac
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/snippets_generation/body_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@ def _generated_sample_by_model_spec(data_params, full_spec):
}

for key, value in data_params.items():
value_type = value.get("type", "object")
result[key] = processing_map.get(value_type, _get_default_value)(value, full_spec)

try:
value_type = value.get("type", "object")
result[key] = processing_map.get(value_type, _get_default_value)(value, full_spec)
except AttributeError:
# ignore errors for string values
pass
return result


Expand Down

0 comments on commit 859a2ac

Please sign in to comment.