Skip to content

Commit d9b885b

Browse files
authored
Simplify Microsoft.OpenApi package references (#3035)
* Simplify Microsoft.OpenApi package references * Update Microsoft.OpenApi.YamlReader.csproj * Apply suggestions from code review Co-authored-by: Youssef Fahmy <youssefvictor00@gmail.com>
1 parent 310ced7 commit d9b885b

2 files changed

Lines changed: 8 additions & 19 deletions

File tree

src/Microsoft.OpenApi.YamlReader/Microsoft.OpenApi.YamlReader.csproj

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,12 @@
2828

2929
<ItemGroup>
3030

31-
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="5.6.0">
32-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
33-
<PrivateAssets>all</PrivateAssets>
34-
</PackageReference>
31+
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="5.6.0" PrivateAssets="all" />
3532

36-
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="18.7.23">
37-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
38-
<PrivateAssets>all</PrivateAssets>
39-
</PackageReference>
33+
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="18.7.23" PrivateAssets="all" />
4034

4135
<PackageReference Include="SharpYaml" Version="2.1.5" />
42-
<PackageReference Include="System.Text.Json" Version="[8.0.5,)" />
43-
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-hh2w-p6rv-4g7w" />
44-
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-8g4q-xg66-9fp4" />
36+
<PackageReference Include="System.Text.Json" Version="[8.0.5,)" Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))" />
4537
</ItemGroup>
4638

4739
<ItemGroup>
@@ -71,4 +63,4 @@
7163
<ItemGroup>
7264
<None Include="../../README.md" Pack="true" PackagePath="" />
7365
</ItemGroup>
74-
</Project>
66+
</Project>

src/Microsoft.OpenApi/Microsoft.OpenApi.csproj

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,10 @@
2424
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
2525
</PropertyGroup>
2626
<ItemGroup>
27-
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="5.6.0">
28-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
29-
<PrivateAssets>all</PrivateAssets>
30-
</PackageReference>
31-
<PackageReference Include="System.Text.Json" Version="[8.0.5,)" />
32-
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-hh2w-p6rv-4g7w" />
33-
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-8g4q-xg66-9fp4" />
27+
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="5.6.0" PrivateAssets="all" />
28+
29+
<!-- We don't need the package reference under .NET 8. We get STJ from the BCL. -->
30+
<PackageReference Include="System.Text.Json" Version="[8.0.5,)" Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))" />
3431
</ItemGroup>
3532

3633
<ItemGroup>

0 commit comments

Comments
 (0)