Merge pull request #5333 from microsoft/shem/fix_boolean_conversion_to_string_python

remove stringify from constructor properties
This commit is contained in:
Vincent Biret 2024-09-11 08:21:39 -04:00 коммит произвёл GitHub
Родитель ee4dbb0450 e5f9d44bf6
Коммит 8e4ade3b70
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed a bug where function descriptions in plugin manifest defaults to path summary instead of description. [#5301](https://github.com/microsoft/kiota/issues/5301)
- Fixed a bug where TypeScript would not properly build URIs with uppercase first characters query parameter names.[#5382](https://github.com/microsoft/kiota/issues/5382)
- Fixed a bug where the description special characters are encoded. [5286](https://github.com/microsoft/kiota/issues/5286)
- Fixed a bug where python constructor parameters are being cast to strings leading to bugs as the types is unknown on graph call. [microsoftgraph/msgraph-sdk-python#165](https://github.com/microsoftgraph/msgraph-sdk-python/issues/165)
## [1.18.0] - 2024-09-05

Просмотреть файл

@ -344,7 +344,7 @@ public class CodeMethodWriter : BaseElementWriter<CodeMethod, PythonConventionSe
foreach (var parameter in pathParameters)
{
var (name, identName) = parameter;
writer.WriteLine($"{pathParametersParameter.Name}['{name}'] = str({identName})");
writer.WriteLine($"{pathParametersParameter.Name}['{name}'] = {identName}");
}
writer.DecreaseIndent();
}

Просмотреть файл

@ -1719,7 +1719,7 @@ public sealed class CodeMethodWriterTests : IDisposable
Assert.Contains("def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[Dict[str, Any], str],", result);
Assert.Contains("username: Optional[str] = None", result);
Assert.Contains("if isinstance(path_parameters, dict):", result);
Assert.Contains("path_parameters['username'] = str(username)", result);
Assert.Contains("path_parameters['username'] = username", result);
Assert.DoesNotContain("This property has a description", result);
Assert.DoesNotContain($"self.{propName}: Optional[str] = {defaultValue}", result);
Assert.DoesNotContain("get_path_parameters(", result);