Skip to content

Update System.Text.Json and enable transitive pinning - #938

Merged
Lee Miller (lemillermicrosoft) merged 4 commits into
microsoft:mainfrom
lemillermicrosoft:510_newton
May 11, 2023
Merged

Lee Miller (lemillermicrosoft) merged 4 commits into
microsoft:mainfrom
lemillermicrosoft:510_newton

Conversation

@lemillermicrosoft

@lemillermicrosoft Lee Miller (lemillermicrosoft) commented May 11, 2023 •

Copy link
Copy Markdown
Member

This commit updates the System.Text.Json package version to 7.0.0 and enables the CentralPackageTransitivePinningEnabled property in the Directory.Packages.props file. This property allows the central package management feature to pin the versions of transitive dependencies to the ones specified in the props file, avoiding potential conflicts or inconsistencies. This change improves the reliability and maintainability of the dotnet projects that use the Directory.Packages.props file.

The test ReadFromJsonThrowsWithInvalidJson was passing an invalid JSON string to the JsonSerializer.Deserialize method, which was expected to throw a JsonException. However, the method actually throws an ArgumentNullException in System.Text.Json 7.0.0 when the named property is missing. This commit fixes the test by updating the expected exception type. It also adds a pragma directive to suppress the JSON001 warning for the invalid JSON string.

Central Package Management | Microsoft Learn
Update dependencies | Docs - Microsoft Open Source

Contribution Checklist

@lemillermicrosoft Lee Miller (lemillermicrosoft) changed the title 📦 Resolve dependency conflict for Newtonsoft.Json Resolve dependency conflict for Newtonsoft.Json May 11, 2023
@lemillermicrosoft
Lee Miller (lemillermicrosoft) marked this pull request as ready for review May 11, 2023 05:01
@lemillermicrosoft
Lee Miller (lemillermicrosoft) marked this pull request as draft May 11, 2023 05:03
@lemillermicrosoft Lee Miller (lemillermicrosoft) changed the title Resolve dependency conflict for Newtonsoft.Json Enable transitive pinning for central package management May 11, 2023
@lemillermicrosoft
Lee Miller (lemillermicrosoft) marked this pull request as ready for review May 11, 2023 05:09
@lemillermicrosoft
Lee Miller (lemillermicrosoft) marked this pull request as draft May 11, 2023 05:12
This commit updates the System.Text.Json package version to 7.0.0 and
enables the CentralPackageTransitivePinningEnabled property in the
Directory.Packages.props file. This property allows the central package
management feature to pin the versions of transitive dependencies to the
ones specified in the props file, avoiding potential conflicts or
inconsistencies. This change improves the reliability and maintainability
of the dotnet projects that use the Directory.Packages.props file.
@lemillermicrosoft
Lee Miller (lemillermicrosoft) marked this pull request as ready for review May 11, 2023 05:16
@lemillermicrosoft Lee Miller (lemillermicrosoft) changed the title Enable transitive pinning for central package management Update System.Text.Json and enable transitive pinning May 11, 2023
The test ReadFromJsonThrowsWithInvalidJson was passing an invalid JSON
string to the JsonSerializer.Deserialize method, which was expected to
throw a JsonException. However, the method actually throws an
ArgumentNullException when the input is null or empty. This commit fixes
the test by passing a null string instead of an invalid one, and
updating the expected exception type. It also adds a pragma directive to
suppress the JSON001 warning for the invalid JSON string.
@github-actions github-actions Bot added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels May 11, 2023
Comment thread dotnet/Directory.Packages.props Resolved
@lemillermicrosoft
Lee Miller (lemillermicrosoft) merged commit 7573efb into microsoft:main May 11, 2023
Shawn Callegari (shawncal) pushed a commit to johnoliver/semantic-kernel that referenced this pull request May 19, 2023
This commit updates the System.Text.Json package version to 7.0.0 and
enables the CentralPackageTransitivePinningEnabled property in the
Directory.Packages.props file. This property allows the central package
management feature to pin the versions of transitive dependencies to the
ones specified in the props file, avoiding potential conflicts or
inconsistencies. This change improves the reliability and
maintainability of the dotnet projects that use the
Directory.Packages.props file.

The test ReadFromJsonThrowsWithInvalidJson was passing an invalid JSON
string to the JsonSerializer.Deserialize method, which was expected to
throw a JsonException. However, the method actually throws an
ArgumentNullException in System.Text.Json 7.0.0 when the named property
is missing. This commit fixes the test by updating the expected
exception type. It also adds a pragma directive to suppress the JSON001
warning for the invalid JSON string.

[Central Package Management | Microsoft
Learn](https://learn.microsoft.com/en-us/nuget/consume-packages/Central-Package-Management)
[Update dependencies | Docs - Microsoft Open
Source](https://docs.opensource.microsoft.com/tools/cg/how-to/updating-dependencies/#nuget)
Shawn Callegari (shawncal) pushed a commit to johnoliver/semantic-kernel that referenced this pull request May 19, 2023
Desmond Howard (dehoward) pushed a commit to lemillermicrosoft/semantic-kernel that referenced this pull request Jun 1, 2023
This commit updates the System.Text.Json package version to 7.0.0 and
enables the CentralPackageTransitivePinningEnabled property in the
Directory.Packages.props file. This property allows the central package
management feature to pin the versions of transitive dependencies to the
ones specified in the props file, avoiding potential conflicts or
inconsistencies. This change improves the reliability and
maintainability of the dotnet projects that use the
Directory.Packages.props file.

The test ReadFromJsonThrowsWithInvalidJson was passing an invalid JSON
string to the JsonSerializer.Deserialize method, which was expected to
throw a JsonException. However, the method actually throws an
ArgumentNullException in System.Text.Json 7.0.0 when the named property
is missing. This commit fixes the test by updating the expected
exception type. It also adds a pragma directive to suppress the JSON001
warning for the invalid JSON string.

[Central Package Management | Microsoft
Learn](https://learn.microsoft.com/en-us/nuget/consume-packages/Central-Package-Management)
[Update dependencies | Docs - Microsoft Open
Source](https://docs.opensource.microsoft.com/tools/cg/how-to/updating-dependencies/#nuget)
Desmond Howard (dehoward) pushed a commit to lemillermicrosoft/semantic-kernel that referenced this pull request Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants