Skip to content

Commit

Permalink
fix(openapi): convert more sub-schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
rkojedzinszky committed Oct 9, 2024
1 parent ecc63ff commit 3e4f112
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/middlewared/middlewared/restful.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,13 @@ def _convert_schema(self, schema):
if item.get('type') == 'null':
items.remove(item)
if len(items) > 1:
schema['items'] = {'oneOf': items}
schema['items'] = {'oneOf': list(map(self._convert_schema, items))}
elif len(items) > 0:
schema['items'] = items[0]
schema['items'] = self._convert_schema(items[0])
else:
schema['items'] = {}
if anyOf := schema.get('anyOf', None):
schema['anyOf'] = list(map(self._convert_schema, anyOf))
return schema

def _returns_to_request(self, methodname, method_returns):
Expand Down

0 comments on commit 3e4f112

Please sign in to comment.