Skip to content

Commit

Permalink
Fix for ignored parameters = null (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
tspence authored Oct 30, 2024
1 parent 1cde483 commit f34497b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/SdkGenerator/Diff/PatchNotesGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,14 @@ private static List<string> GetEndpointChanges(GeneratorContext context, Endpoin
{
if (diff.Object2 is ParameterField p2 && diff.Object1 == null)
{
if (context.Project.IgnoredParameters.All(ip => !string.Equals(ip.Name, p2.Name, StringComparison.OrdinalIgnoreCase)))
if (context.Project.IgnoredParameters == null || context.Project.IgnoredParameters.All(ip => !string.Equals(ip.Name, p2.Name, StringComparison.OrdinalIgnoreCase)))
{
differences.Add($"{MakeApiName(item)} removed {p2.Location} parameter `{p2.Name}`");
}
}
else if (diff.Object1 is ParameterField p1 && diff.Object2 == null)
{
if (context.Project.IgnoredParameters.All(ip => !string.Equals(ip.Name, p1.Name, StringComparison.OrdinalIgnoreCase)))
if (context.Project.IgnoredParameters == null || context.Project.IgnoredParameters.All(ip => !string.Equals(ip.Name, p1.Name, StringComparison.OrdinalIgnoreCase)))
{
differences.Add($"{MakeApiName(item)} added {p1.Location} parameter `{p1.Name}`");
}
Expand Down
5 changes: 5 additions & 0 deletions src/SdkGenerator/PatchNotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 1.3.8
October 20, 2024

* Fixed issue where ignored parameters could be null

# 1.3.7
October 20, 2024

Expand Down
6 changes: 3 additions & 3 deletions src/SdkGenerator/SdkGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
<PackageTags>SDK generator swagger openapi swashbuckle</PackageTags>
<Copyright>Copyright 2021 - 2024</Copyright>
<PackageReleaseNotes>
# 1.3.7
# 1.3.8
October 20, 2024

* Fixed a minor typo that caused Typescript and Python-only build configs to fail
* Fixed an issue with ignored parameters
</PackageReleaseNotes>
<PackageIcon>docs/icons-puzzle.png</PackageIcon>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Version>1.3.7</Version>
<Version>1.3.8</Version>
<Authors>Ted Spence</Authors>
<!-- Project Url is filled in by sourcelink in the .NET 8 SDK, but you can add it explicitly via
package -->
Expand Down

0 comments on commit f34497b

Please sign in to comment.