Skip to content

Commit

Permalink
Merge pull request #175 from hassanhabib/users/hassanhabib/controller…
Browse files Browse the repository at this point in the history
…s-handle-mapping

CONTROLLERS: Gracefully Handle Mapping Data
  • Loading branch information
hassanhabib authored May 2, 2024
2 parents 6751f7f + d1d7c69 commit 2205ea0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion RESTFulSense/Controllers/RESTFulController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,10 @@ private void MapExceptionDataToProblemDetail(

problemDetail.Errors.Add(
key: errorKey,
value: ((List<string>)error.Value)?.ToArray());

value: error.Value.GetType() == typeof(List<string>)
? ((List<string>)error.Value)?.ToArray()
: (string[]) error.Value);
}
}

Expand Down
6 changes: 3 additions & 3 deletions RESTFulSense/RESTFulSense.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageIcon>api.png</PackageIcon>
<PackageIconUrl />
<Version>2.19</Version>
<AssemblyVersion>2.19.0.0</AssemblyVersion>
<FileVersion>2.19.0.0</FileVersion>
<Version>2.20</Version>
<AssemblyVersion>2.20.0.0</AssemblyVersion>
<FileVersion>2.20.0.0</FileVersion>
<NeutralLanguage>en-US</NeutralLanguage>
<PackageLicenseExpression></PackageLicenseExpression>
<PackageProjectUrl>https://www.restfulsense.net</PackageProjectUrl>
Expand Down

0 comments on commit 2205ea0

Please # to comment.