summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI.Web/Startup.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-09-22 03:01:40 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-09-22 03:01:40 -0400
commit86d4827df211cc28549acb88ee7cb08d6cc4d4aa (patch)
treecfe021ee92fb8312b12ca83eda8575e4271cf8a6 /src/StardewModdingAPI.Web/Startup.cs
parent399b98b36b6111d364702b117fff3c5f21b8783a (diff)
downloadSMAPI-86d4827df211cc28549acb88ee7cb08d6cc4d4aa.tar.gz
SMAPI-86d4827df211cc28549acb88ee7cb08d6cc4d4aa.tar.bz2
SMAPI-86d4827df211cc28549acb88ee7cb08d6cc4d4aa.zip
simplify input & output format (#336)
Diffstat (limited to 'src/StardewModdingAPI.Web/Startup.cs')
-rw-r--r--src/StardewModdingAPI.Web/Startup.cs16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/StardewModdingAPI.Web/Startup.cs b/src/StardewModdingAPI.Web/Startup.cs
index 2d9a95f1..abae06ec 100644
--- a/src/StardewModdingAPI.Web/Startup.cs
+++ b/src/StardewModdingAPI.Web/Startup.cs
@@ -1,12 +1,9 @@
-using System.Linq;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Mvc.ModelBinding.Binders;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
-using StardewModdingAPI.Web.Framework;
namespace StardewModdingAPI.Web
{
@@ -40,17 +37,8 @@ namespace StardewModdingAPI.Web
public void ConfigureServices(IServiceCollection services)
{
services
- .AddMvc(options =>
- {
- // add support for comma-delimited parameters
- ArrayModelBinderProvider arrayModelBinderProvider = options.ModelBinderProviders.OfType<ArrayModelBinderProvider>().First();
- options.ModelBinderProviders.Insert(options.ModelBinderProviders.IndexOf(arrayModelBinderProvider), new CommaDelimitedModelBinderProvider());
- })
- .AddJsonOptions(options =>
- {
- // suppress null values in JSON responses
- options.SerializerSettings.NullValueHandling = NullValueHandling.Ignore;
- });
+ .AddMvc()
+ .AddJsonOptions(options => options.SerializerSettings.NullValueHandling = NullValueHandling.Ignore); // suppress null values in JSON responses
}
/// <summary>The method called by the runtime to configure the HTTP request pipeline.</summary>