Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2022-04-06 22:41:11 -07:00
parent 16d7e95ce6
commit 0f66979c90
16 changed files with 3437 additions and 2716 deletions

View File

@ -729,6 +729,11 @@ def generateType(path: str, name: str, schema: dict):
"\t" +
property_name +
": Union[Unset, bool] = False\n")
elif property_type == 'array':
f.write(
"\t" +
property_name +
": Union[Unset, array] = []\n")
else:
raise Exception(" unknown type: ", property_type)
elif '$ref' in property_schema:
@ -815,6 +820,13 @@ def generateType(path: str, name: str, schema: dict):
" = self." +
property_name +
"\n")
elif property_type == 'array':
f.write(
"\t\t" +
property_name +
" = self." +
property_name +
"\n")
else:
raise Exception(" unknown type: ", property_type)
elif '$ref' in property_schema:
@ -945,6 +957,14 @@ def generateType(path: str, name: str, schema: dict):
property_name +
"\", UNSET)\n")
f.write("\n")
elif property_type == 'array':
f.write(
"\t\t" +
property_name +
" = d.pop(\"" +
property_name +
"\", UNSET)\n")
f.write("\n")
else:
print(" unknown type: ", property_type)
raise Exception(" unknown type: ", property_type)