Skip to content

Fix additionalProperty Union spacing and construction (#266) #273

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Dec 21, 2020
Merged
Prev Previous commit
Next Next commit
Update golden record
  • Loading branch information
packyg committed Dec 19, 2020
commit bfab9d4312a4717324eb9fc5f6214c62ec2b904b
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,20 @@ def httpx_request(
json_union_prop: Union[Unset, float, str]
if isinstance(union_prop, Unset):
json_union_prop = UNSET
elif isinstance(union_prop, float):
json_union_prop = union_prop
else:
json_union_prop = union_prop

json_union_prop_with_ref: Union[Unset, float, AnEnum]
if isinstance(union_prop_with_ref, Unset):
json_union_prop_with_ref = UNSET
elif isinstance(union_prop_with_ref, float):
json_union_prop_with_ref = union_prop_with_ref
else:
elif isinstance(union_prop_with_ref, AnEnum):
json_union_prop_with_ref = UNSET
if not isinstance(union_prop_with_ref, Unset):
json_union_prop_with_ref = union_prop_with_ref

else:
json_union_prop_with_ref = union_prop_with_ref

json_enum_prop: Union[Unset, AnEnum] = UNSET
if not isinstance(enum_prop, Unset):
json_enum_prop = enum_prop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ def to_dict(self) -> Dict[str, Any]:
elif isinstance(prop, list):
field_dict[prop_name] = prop

elif isinstance(prop, str):
field_dict[prop_name] = prop
elif isinstance(prop, float):
field_dict[prop_name] = prop
elif isinstance(prop, int):
field_dict[prop_name] = prop
else:
field_dict[prop_name] = prop

Expand Down Expand Up @@ -65,9 +59,6 @@ def _parse_additional_property(
except: # noqa: E722
pass
return cast(str, data)
return cast(float, data)
return cast(int, data)
return cast(bool, data)

additional_property = _parse_additional_property(prop_dict)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,20 @@ def _get_kwargs(
json_union_prop: Union[Unset, float, str]
if isinstance(union_prop, Unset):
json_union_prop = UNSET
elif isinstance(union_prop, float):
json_union_prop = union_prop
else:
json_union_prop = union_prop

json_union_prop_with_ref: Union[Unset, float, AnEnum]
if isinstance(union_prop_with_ref, Unset):
json_union_prop_with_ref = UNSET
elif isinstance(union_prop_with_ref, float):
json_union_prop_with_ref = union_prop_with_ref
else:
elif isinstance(union_prop_with_ref, AnEnum):
json_union_prop_with_ref = UNSET
if not isinstance(union_prop_with_ref, Unset):
json_union_prop_with_ref = union_prop_with_ref

else:
json_union_prop_with_ref = union_prop_with_ref

json_enum_prop: Union[Unset, AnEnum] = UNSET
if not isinstance(enum_prop, Unset):
json_enum_prop = enum_prop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ def to_dict(self) -> Dict[str, Any]:
elif isinstance(prop, list):
field_dict[prop_name] = prop

elif isinstance(prop, str):
field_dict[prop_name] = prop
elif isinstance(prop, float):
field_dict[prop_name] = prop
elif isinstance(prop, int):
field_dict[prop_name] = prop
else:
field_dict[prop_name] = prop

Expand Down Expand Up @@ -65,9 +59,6 @@ def _parse_additional_property(
except: # noqa: E722
pass
return cast(str, data)
return cast(float, data)
return cast(int, data)
return cast(bool, data)

additional_property = _parse_additional_property(prop_dict)

Expand Down