Skip to content

Commit 7101b29

Browse files
Fix Newtonsoft.Json dependabot advisory in Web API examples
1 parent 0b24b66 commit 7101b29

File tree

12 files changed

+23
-9
lines changed

12 files changed

+23
-9
lines changed

Diff for: asp.sln

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ EndProject
119119
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AspNet", "AspNet", "{20CEA68A-6E76-4285-99B0-52EDC8F9A03C}"
120120
ProjectSection(SolutionItems) = preProject
121121
examples\AspNet\Directory.Build.props = examples\AspNet\Directory.Build.props
122+
examples\AspNet\Startup.Newtonsoft.cs = examples\AspNet\Startup.Newtonsoft.cs
122123
EndProjectSection
123124
EndProject
124125
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AspNetCore", "AspNetCore", "{4AA0D9F1-F837-430B-9CE2-AAC988E339E4}"

Diff for: examples/AspNet/Directory.Build.props

+4
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,8 @@
1818
</AssemblyAttribute>
1919
</ItemGroup>
2020

21+
<ItemGroup>
22+
<Compile Include="$(MSBuildThisFileDirectory)Startup.Newtonsoft.cs" DependentUpon="Startup.cs" />
23+
</ItemGroup>
24+
2125
</Project>

Diff for: examples/AspNet/OData/AdvancedODataWebApiExample/Startup.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using System.Web.Http;
99
using static System.Web.Http.RouteParameter;
1010

11-
public class Startup
11+
public partial class Startup
1212
{
1313
public void Configuration( IAppBuilder appBuilder )
1414
{

Diff for: examples/AspNet/OData/BasicODataWebApiExample/Startup.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using Owin;
77
using System.Web.Http;
88

9-
public class Startup
9+
public partial class Startup
1010
{
1111
public void Configuration( IAppBuilder appBuilder )
1212
{

Diff for: examples/AspNet/OData/ConventionsODataWebApiExample/Startup.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using Owin;
99
using System.Web.Http;
1010

11-
public class Startup
11+
public partial class Startup
1212
{
1313
public void Configuration( IAppBuilder appBuilder )
1414
{

Diff for: examples/AspNet/OData/OpenApiODataWebApiExample/Startup.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/// <summary>
2020
/// Represents the startup process for the application.
2121
/// </summary>
22-
public class Startup
22+
public partial class Startup
2323
{
2424
/// <summary>
2525
/// Configures the application using the provided builder.

Diff for: examples/AspNet/OData/SomeOpenApiODataWebApiExample/Startup.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/// <summary>
1818
/// Represents the startup process for the application.
1919
/// </summary>
20-
public class Startup
20+
public partial class Startup
2121
{
2222
/// <summary>
2323
/// Configures the application using the provided builder.

Diff for: examples/AspNet/Startup.Newtonsoft.cs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace ApiVersioning.Examples;
2+
3+
using Newtonsoft.Json;
4+
5+
public partial class Startup
6+
{
7+
// REF: https://github.com/advisories/GHSA-5crp-9r3c-p9vr
8+
static Startup() => JsonConvert.DefaultSettings = () => new() { MaxDepth = 128 };
9+
}

Diff for: examples/AspNet/WebApi/BasicWebApiExample/Startup.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.Web.Http;
66
using System.Web.Http.Routing;
77

8-
public class Startup
8+
public partial class Startup
99
{
1010
public void Configuration( IAppBuilder builder )
1111
{

Diff for: examples/AspNet/WebApi/ByNamespaceWebApiExample/Startup.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using Owin;
66
using System.Web.Http;
77

8-
public class Startup
8+
public partial class Startup
99
{
1010
public void Configuration( IAppBuilder builder )
1111
{

Diff for: examples/AspNet/WebApi/ConventionsWebApiExample/Startup.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using System.Web.Http;
88
using System.Web.Http.Routing;
99

10-
public class Startup
10+
public partial class Startup
1111
{
1212
public void Configuration( IAppBuilder builder )
1313
{

Diff for: examples/AspNet/WebApi/OpenApiWebApiExample/Startup.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/// <summary>
1515
/// Represents the startup process for the application.
1616
/// </summary>
17-
public class Startup
17+
public partial class Startup
1818
{
1919
/// <summary>
2020
/// Configures the application using the provided builder.

0 commit comments

Comments
 (0)