Skip to content

Commit

Permalink
Merge pull request #13 from MarketSquare/support_nested_models_in_schema
Browse files Browse the repository at this point in the history
Support nested models in schema
  • Loading branch information
robinmackaij authored Apr 5, 2024
2 parents 44c41d6 + 6dffd8a commit 94a9d7d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/OpenApiLibCore/openapi_libcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,8 +1087,17 @@ def get_dependent_id(
properties_schema = schema["properties"][property_name]

property_type = properties_schema.get("type")
if not property_type:
selected_type_schema = choice(properties_schema["types"])
if property_type is None:
property_types = properties_schema.get("types")
if property_types is None:
if properties_schema.get("properties") is not None:
nested_data = self.get_json_data_for_dto_class(
schema=properties_schema,
dto_class=DefaultDto,
)
json_data[property_name] = nested_data
continue
selected_type_schema = choice(property_types)
property_type = selected_type_schema["type"]
if properties_schema.get("readOnly", False):
continue
Expand Down

0 comments on commit 94a9d7d

Please sign in to comment.