Skip to content

Commit

Permalink
Revert "Change body serialization for complex type"
Browse files Browse the repository at this point in the history
This reverts commit 3e34c1695efe9a765bc74d13325c9177d9c4a26d.
  • Loading branch information
annatisch committed May 17, 2016
1 parent 24cd72e commit 6500965
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,32 +64,17 @@
{
@:body_content = upload_gen(@parameter.Name)
break;
}
}
}
}
else if (Model.RequestBody.IsRequired)
{

if (Model.RequestBody.Type is CompositeType)
{
@:body_content = self._serialize.body(@Model.RequestBody.Name, models.@(Model.RequestBody.Type.ToPythonRuntimeTypeString()))
}
else
{
}
else if (Model.RequestBody.IsRequired)
{
@:body_content = self._serialize.body(@Model.RequestBody.Name, '@(Model.RequestBody.Type.ToPythonRuntimeTypeString())')
}
}
else
{
}
else
{
@:if @Model.RequestBody.Name is not None:
if (Model.RequestBody.Type is CompositeType)
{
@:body_content = self._serialize.body(@Model.RequestBody.Name, models.@(Model.RequestBody.Type.ToPythonRuntimeTypeString()))
}
else
{
@:body_content = self._serialize.body(@Model.RequestBody.Name, '@(Model.RequestBody.Type.ToPythonRuntimeTypeString())')
}
@:else:
@:body_content = None
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,27 +59,13 @@
{
@:# Construct body
if (Model.RequestBody.IsRequired)
{
if (Model.RequestBody.Type is CompositeType)
{
@:body_content = self._serialize.body(@Model.RequestBody.Name, models.@(Model.RequestBody.Type.ToPythonRuntimeTypeString()))
}
else
{
{
@:body_content = self._serialize.body(@Model.RequestBody.Name, '@(Model.RequestBody.Type.ToPythonRuntimeTypeString())')
}
}
else
{
}
else
{
@:if @Model.RequestBody.Name is not None:
if (Model.RequestBody.Type is CompositeType)
{
@:body_content = self._serialize.body(@Model.RequestBody.Name, models.@(Model.RequestBody.Type.ToPythonRuntimeTypeString()))
}
else
{
@:body_content = self._serialize.body(@Model.RequestBody.Name, '@(Model.RequestBody.Type.ToPythonRuntimeTypeString())')
}
@:else:
@:body_content = None
}
Expand Down
30 changes: 8 additions & 22 deletions AutoRest/Generators/Python/Python/Templates/MethodTemplate.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -64,31 +64,17 @@
{
@:body_content = self._client.stream_upload(@parameter.Name, callback)
break;
}
}
}
else if (Model.RequestBody.IsRequired)
{
if (Model.RequestBody.Type is CompositeType)
{
@:body_content = self._serialize.body(@Model.RequestBody.Name, models.@(Model.RequestBody.Type.ToPythonRuntimeTypeString()))
}
else
{
}
}
}
else if (Model.RequestBody.IsRequired)
{
@:body_content = self._serialize.body(@Model.RequestBody.Name, '@(Model.RequestBody.Type.ToPythonRuntimeTypeString())')
}
}
else
{
}
else
{
@:if @Model.RequestBody.Name is not None:
if (Model.RequestBody.Type is CompositeType)
{
@:body_content = self._serialize.body(@Model.RequestBody.Name, models.@(Model.RequestBody.Type.ToPythonRuntimeTypeString()))
}
else
{
@:body_content = self._serialize.body(@Model.RequestBody.Name, '@(Model.RequestBody.Type.ToPythonRuntimeTypeString())')
}
@:else:
@:body_content = None
}
Expand Down

0 comments on commit 6500965

Please sign in to comment.