Merge branch 'main' into andrueastman/revertTrimming

This commit is contained in:
Vincent Biret 2024-08-09 12:45:24 -04:00 коммит произвёл GitHub
Родитель fc209a8b61 1eb16cd658
Коммит 682a646afe
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
4 изменённых файлов: 16 добавлений и 7 удалений

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

@ -11,7 +11,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Adds generation of default 'color.png`and`outline.png` files when generating plugins. [#4993](https://github.com/microsoft/kiota/issues/4993)
### Changed
- Reverts modification of responses in output openApi file when generating plugings [#4945](https://github.com/microsoft/kiota/issues/4945)
## [1.17.0] - 2024-08-09
### Added
- Adds generation of default `color.png` and `outline.png` files when generating plugins. [#4993](https://github.com/microsoft/kiota/issues/4993)
### Changed
@ -23,7 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Exclude the `x-openai-isConsequential` extension from cleanup. [#4962](https://github.com/microsoft/kiota/issues/4962)
- Fixed file name and namespace sanitization when generating plugins. [#5019](https://github.com/microsoft/kiota/issues/5019)
- Added TypeScript typecheck suppression to generated method prototype, where anused arguments can cause build fail in projects which use `noUnusedLocals: true` compiler option. [#5095](https://github.com/microsoft/kiota/issues/5095)
- Reverts modification of responses in output openApi file when generating plugings [#4945](https://github.com/microsoft/kiota/issues/4945)
- Fixed a bug where defensive programming would consider some default values as invalid in Python.
## [1.16.0] - 2024-07-05
@ -1406,3 +1414,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Initial GitHub release

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

@ -61,7 +61,7 @@
<None Include="../../README.md" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="../../resources/color.png"/>
<EmbeddedResource Include="../../resources/outline.png"/>
<EmbeddedResource Include="../../resources/color.png" />
<EmbeddedResource Include="../../resources/outline.png" />
</ItemGroup>
</Project>

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

@ -43,7 +43,7 @@ public class CodeMethodWriter : BaseElementWriter<CodeMethod, PythonConventionSe
foreach (var parameter in codeElement.Parameters.Where(static x => !x.Optional).OrderBy(static x => x.Name))
{
var parameterName = parameter.Name;
writer.StartBlock($"if not {parameterName}:");
writer.StartBlock($"if {parameterName} is None:");
writer.WriteLine($"raise TypeError(\"{parameterName} cannot be null.\")");
writer.DecreaseIndent();
}

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

@ -2086,7 +2086,7 @@ public sealed class CodeMethodWriterTests : IDisposable
});
writer.Write(method);
var result = tw.ToString();
Assert.Contains("if not original_name:", result);
Assert.Contains("if original_name is None:", result);
Assert.Contains("if original_name == \"select\":", result);
Assert.Contains("return \"%24select\"", result);
Assert.Contains("if original_name == \"expand\":", result);
@ -2124,7 +2124,7 @@ public sealed class CodeMethodWriterTests : IDisposable
});
writer.Write(method);
var result = tw.ToString();
Assert.Contains("if not original_name:", result);
Assert.Contains("if original_name is None:", result);
Assert.Contains("if original_name == \"start_date_time\":", result);
Assert.Contains("return \"startDateTime\"", result);
Assert.Contains("return original_name", result);