Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2022-04-06 23:12:58 -07:00
parent 5bcbf4251b
commit 429c341f84
6 changed files with 38 additions and 0 deletions

View File

@ -735,6 +735,10 @@ def generateType(path: str, name: str, schema: dict):
property_type = property_schema['items']['$ref']
property_type = property_type.replace(
'#/components/schemas/', '')
f.write(
"\tfrom ...models import " +
property_type +
"\n")
f.write(
"\t" +
property_name +
@ -839,6 +843,10 @@ def generateType(path: str, name: str, schema: dict):
property_type = property_schema['items']['$ref']
property_type = property_type.replace(
'#/components/schemas/', '')
f.write(
"\t\tfrom ...models import " +
property_type +
"\n")
f.write(
"\t\t" +
property_name +
@ -993,6 +1001,16 @@ def generateType(path: str, name: str, schema: dict):
property_type = property_schema['items']['$ref']
property_type = property_type.replace(
'#/components/schemas/', '')
f.write(
"\t\tfrom ...models import " +
property_type +
"\n")
f.write(
"\t\t" +
property_name +
" = cast(List[" + property_type + "], d.pop(\"" +
property_name +
"\", UNSET))\n")
f.write(
"\t\t" +
property_name +