diff --git a/src/Mvc/Mvc.Core/src/JsonResult.cs b/src/Mvc/Mvc.Core/src/JsonResult.cs
index c62cf5e49ebd..6d43cc68323e 100644
--- a/src/Mvc/Mvc.Core/src/JsonResult.cs
+++ b/src/Mvc/Mvc.Core/src/JsonResult.cs
@@ -2,8 +2,8 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
+using System.Text.Json;
using System.Threading.Tasks;
-using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.Extensions.DependencyInjection;
@@ -27,14 +27,17 @@ public JsonResult(object value)
/// Creates a new with the given .
///
/// The value to format as JSON.
- /// The serializer settings to be used by the formatter.
+ ///
+ /// The serializer settings to be used by the formatter.
+ ///
+ /// When using System.Text.Json, this should be an instance of .
+ ///
+ ///
+ /// When using Newtonsoft.Json, this should be an instance of JsonSerializerSettings.
+ ///
+ ///
public JsonResult(object value, object serializerSettings)
{
- if (serializerSettings == null)
- {
- throw new ArgumentNullException(nameof(serializerSettings));
- }
-
Value = value;
SerializerSettings = serializerSettings;
}
@@ -46,6 +49,12 @@ public JsonResult(object value, object serializerSettings)
///
/// Gets or sets the serializer settings.
+ ///
+ /// When using System.Text.Json, this should be an instance of
+ ///
+ ///
+ /// When using Newtonsoft.Json, this should be an instance of JsonSerializerSettings.
+ ///
///
public object SerializerSettings { get; set; }
diff --git a/src/Mvc/Mvc.ViewFeatures/src/Controller.cs b/src/Mvc/Mvc.ViewFeatures/src/Controller.cs
index e90117df62b2..0171f04797f5 100644
--- a/src/Mvc/Mvc.ViewFeatures/src/Controller.cs
+++ b/src/Mvc/Mvc.ViewFeatures/src/Controller.cs
@@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
+using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.Mvc.ModelBinding;
@@ -298,7 +299,14 @@ public virtual JsonResult Json(object data)
/// to JSON.
///
/// The object to serialize.
- /// The serializer settings to be used by the formatter.
+ /// The serializer settings to be used by the formatter.
+ ///
+ /// When using System.Text.Json, this should be an instance of .
+ ///
+ ///
+ /// When using Newtonsoft.Json, this should be an instance of JsonSerializerSettings.
+ ///
+ ///
/// The created that serializes the specified
/// as JSON format for the response.
/// Callers should cache an instance of serializer settings to avoid
@@ -306,11 +314,6 @@ public virtual JsonResult Json(object data)
[NonAction]
public virtual JsonResult Json(object data, object serializerSettings)
{
- if (serializerSettings == null)
- {
- throw new ArgumentNullException(nameof(serializerSettings));
- }
-
return new JsonResult(data, serializerSettings);
}