Skip to content

Commit

Permalink
Merge branch 'main' into andrueastman/revertTrimming
Browse files Browse the repository at this point in the history
  • Loading branch information
baywet authored Aug 9, 2024
2 parents fc209a8 + 1eb16cd commit 682a646
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -1406,3 +1414,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Initial GitHub release

4 changes: 2 additions & 2 deletions src/Kiota.Builder/Kiota.Builder.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>
2 changes: 1 addition & 1 deletion src/Kiota.Builder/Writers/Python/CodeMethodWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public override void WriteCodeElement(CodeMethod codeElement, LanguageWriter wri
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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2086,7 +2086,7 @@ public void WritesNameMapperMethod()
});
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);
Expand Down Expand Up @@ -2124,7 +2124,7 @@ public void WritesNameMapperMethodWithUnescapedProperties()
});
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);
Expand Down

0 comments on commit 682a646

Please sign in to comment.