Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge upstream/main
  • Loading branch information
forest-benchling committed Feb 11, 2021
commit 2c4fdf8724abc9b8073ac2401e0f0a3660305357
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def httpx_request(
union_prop_with_ref: Union[AnEnum, Unset, float] = 0.6,
enum_prop: Union[Unset, AnEnum] = UNSET,
model_prop: Union[Unset, ModelWithUnionProperty] = UNSET,
required_model_prop: ModelWithUnionProperty,
) -> Response[Union[None, HTTPValidationError]]:

json_not_required_not_nullable_datetime_prop: Union[Unset, str] = UNSET
Expand Down Expand Up @@ -110,10 +111,6 @@ def httpx_request(
if not isinstance(model_prop, Unset):
json_model_prop = model_prop.to_dict()

json_model_prop: Union[Unset, Dict[str, Any]] = UNSET
if not isinstance(model_prop, Unset):
json_model_prop = model_prop.to_dict()

json_required_model_prop = required_model_prop.to_dict()

params: Dict[str, Any] = {
Expand All @@ -130,7 +127,6 @@ def httpx_request(
"union_prop": json_union_prop,
"union_prop_with_ref": json_union_prop_with_ref,
"enum_prop": json_enum_prop,
"model_prop": json_model_prop,
}
if not isinstance(json_model_prop, Unset):
params.update(json_model_prop)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def _get_kwargs(
union_prop_with_ref: Union[AnEnum, Unset, float] = 0.6,
enum_prop: Union[Unset, AnEnum] = UNSET,
model_prop: Union[Unset, ModelWithUnionProperty] = UNSET,
required_model_prop: ModelWithUnionProperty,
) -> Dict[str, Any]:
url = "{}/tests/defaults".format(client.base_url)

Expand Down Expand Up @@ -86,10 +87,6 @@ def _get_kwargs(
if not isinstance(model_prop, Unset):
json_model_prop = model_prop.to_dict()

json_model_prop: Union[Unset, Dict[str, Any]] = UNSET
if not isinstance(model_prop, Unset):
json_model_prop = model_prop.to_dict()

json_required_model_prop = required_model_prop.to_dict()

params: Dict[str, Any] = {
Expand All @@ -106,7 +103,6 @@ def _get_kwargs(
"union_prop": json_union_prop,
"union_prop_with_ref": json_union_prop_with_ref,
"enum_prop": json_enum_prop,
"model_prop": json_model_prop,
}
if not isinstance(json_model_prop, Unset):
params.update(json_model_prop)
Expand Down Expand Up @@ -160,6 +156,7 @@ def sync_detailed(
union_prop_with_ref: Union[AnEnum, Unset, float] = 0.6,
enum_prop: Union[Unset, AnEnum] = UNSET,
model_prop: Union[Unset, ModelWithUnionProperty] = UNSET,
required_model_prop: ModelWithUnionProperty,
) -> Response[Union[None, HTTPValidationError]]:
kwargs = _get_kwargs(
client=client,
Expand All @@ -177,6 +174,7 @@ def sync_detailed(
union_prop_with_ref=union_prop_with_ref,
enum_prop=enum_prop,
model_prop=model_prop,
required_model_prop=required_model_prop,
)

response = httpx.post(
Expand All @@ -203,6 +201,7 @@ def sync(
union_prop_with_ref: Union[AnEnum, Unset, float] = 0.6,
enum_prop: Union[Unset, AnEnum] = UNSET,
model_prop: Union[Unset, ModelWithUnionProperty] = UNSET,
required_model_prop: ModelWithUnionProperty,
) -> Optional[Union[None, HTTPValidationError]]:
""" """

Expand All @@ -222,6 +221,7 @@ def sync(
union_prop_with_ref=union_prop_with_ref,
enum_prop=enum_prop,
model_prop=model_prop,
required_model_prop=required_model_prop,
).parsed


Expand All @@ -242,6 +242,7 @@ async def asyncio_detailed(
union_prop_with_ref: Union[AnEnum, Unset, float] = 0.6,
enum_prop: Union[Unset, AnEnum] = UNSET,
model_prop: Union[Unset, ModelWithUnionProperty] = UNSET,
required_model_prop: ModelWithUnionProperty,
) -> Response[Union[None, HTTPValidationError]]:
kwargs = _get_kwargs(
client=client,
Expand All @@ -259,6 +260,7 @@ async def asyncio_detailed(
union_prop_with_ref=union_prop_with_ref,
enum_prop=enum_prop,
model_prop=model_prop,
required_model_prop=required_model_prop,
)

async with httpx.AsyncClient() as _client:
Expand All @@ -284,6 +286,7 @@ async def asyncio(
union_prop_with_ref: Union[AnEnum, Unset, float] = 0.6,
enum_prop: Union[Unset, AnEnum] = UNSET,
model_prop: Union[Unset, ModelWithUnionProperty] = UNSET,
required_model_prop: ModelWithUnionProperty,
) -> Optional[Union[None, HTTPValidationError]]:
""" """

Expand All @@ -304,5 +307,6 @@ async def asyncio(
union_prop_with_ref=union_prop_with_ref,
enum_prop=enum_prop,
model_prop=model_prop,
required_model_prop=required_model_prop,
)
).parsed
8 changes: 8 additions & 0 deletions end_to_end_tests/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,14 @@
},
"name": "model_prop",
"in": "query"
},
{
"required": true,
"schema": {
"$ref": "#/components/schemas/ModelWithUnionProperty"
},
"name": "required_model_prop",
"in": "query"
}
],
"responses": {
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.