Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 9 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change Log

### 2021-02-03 - 5.6.2

Autorest core version: 3.0.6318

Modelerfour version: 4.15.456

**Bug Fixes**
- Bump `Modelerfour` minimum version to [correctly deal with](https://github.com/Azure/autorest.modelerfour/pull/385) parameters specified as `'required': false` in swagger #877

### 2021-01-27 - 5.6.1

Autorest core version: 3.0.6318
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pass-thru:
- subset-reducer
version: ^3.0.6318
use-extension:
"@autorest/modelerfour": 4.15.442
"@autorest/modelerfour": 4.15.456

modelerfour:
group-parameters: true
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@autorest/python",
"version": "5.6.1",
"version": "5.6.2",
"description": "The Python extension for generators in AutoRest.",
"scripts": {
"prepare": "node run-python3.js prepare.py",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async def analyze_body(self, input: Optional[Union[IO, "_models.SourcePath"]] =
analyze_body.metadata = {"url": "/mediatypes/analyze"} # type: ignore

@distributed_trace_async
async def content_type_with_encoding(self, input: str, **kwargs) -> str:
async def content_type_with_encoding(self, input: Optional[str] = None, **kwargs) -> str:
"""Pass in contentType 'text/plain; encoding=UTF-8' to pass test. Value for input does not matter.

:param input: Input parameter.
Expand Down Expand Up @@ -123,7 +123,10 @@ async def content_type_with_encoding(self, input: str, **kwargs) -> str:
header_parameters["Accept"] = self._serialize.header("accept", accept, "str")

body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(input, "str")
if input is not None:
body_content = self._serialize.body(input, "str")
else:
body_content = None
body_content_kwargs["content"] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def analyze_body(
@distributed_trace
def content_type_with_encoding(
self,
input, # type: str
input=None, # type: Optional[str]
**kwargs # type: Any
):
# type: (...) -> str
Expand Down Expand Up @@ -137,7 +137,10 @@ def content_type_with_encoding(
header_parameters["Accept"] = self._serialize.header("accept", accept, "str")

body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(input, "str")
if input is not None:
body_content = self._serialize.body(input, "str")
else:
body_content = None
body_content_kwargs["content"] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
Expand Down