From 340ba9cca9aa87dd676d2f082d07b1b0e17ea3ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=B8nner=C3=B8d=20Madsen?= Date: Thu, 7 Nov 2019 08:50:12 +0100 Subject: [PATCH] Renaming CloudEventInputFormatter to CloudEventJsonInputFormatter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tobias Lønnerød Madsen --- README.md | 4 ++-- samples/CloudNative.CloudEvents.AspNetCoreSample/Startup.cs | 2 +- ...EventInputFormatter.cs => CloudEventJsonInputFormatter.cs} | 4 ++-- .../CloudNative.CloudEvents.IntegrationTests.csproj | 1 - 4 files changed, 5 insertions(+), 6 deletions(-) rename src/CloudNative.CloudEvents.AspNetCore/{CloudEventInputFormatter.cs => CloudEventJsonInputFormatter.cs} (93%) diff --git a/README.md b/README.md index 8c44b1c..de12aa0 100644 --- a/README.md +++ b/README.md @@ -224,14 +224,14 @@ var cloudEvent = await HttpContext.Request.ReadCloudEventAsync(); ### HTTP - ASP.NET Core MVC If you would like to deserialize CloudEvents in actions directly, you can register the -`CloudEventInputFormatter` in the MVC options: +`CloudEventJsonInputFormatter` in the MVC options: ```C# public void ConfigureServices(IServiceCollection services) { services.AddMvc(opts => { - opts.InputFormatters.Insert(0, new CloudEventInputFormatter()); + opts.InputFormatters.Insert(0, new CloudEventJsonInputFormatter()); }); } ``` diff --git a/samples/CloudNative.CloudEvents.AspNetCoreSample/Startup.cs b/samples/CloudNative.CloudEvents.AspNetCoreSample/Startup.cs index db3eb1f..567c52e 100644 --- a/samples/CloudNative.CloudEvents.AspNetCoreSample/Startup.cs +++ b/samples/CloudNative.CloudEvents.AspNetCoreSample/Startup.cs @@ -25,7 +25,7 @@ namespace CloudNative.CloudEvents.AspNetCoreSample { services.AddControllers(opts => { - opts.InputFormatters.Insert(0, new CloudEventInputFormatter()); + opts.InputFormatters.Insert(0, new CloudEventJsonInputFormatter()); }); } diff --git a/src/CloudNative.CloudEvents.AspNetCore/CloudEventInputFormatter.cs b/src/CloudNative.CloudEvents.AspNetCore/CloudEventJsonInputFormatter.cs similarity index 93% rename from src/CloudNative.CloudEvents.AspNetCore/CloudEventInputFormatter.cs rename to src/CloudNative.CloudEvents.AspNetCore/CloudEventJsonInputFormatter.cs index d7607dc..e160aa7 100644 --- a/src/CloudNative.CloudEvents.AspNetCore/CloudEventInputFormatter.cs +++ b/src/CloudNative.CloudEvents.AspNetCore/CloudEventJsonInputFormatter.cs @@ -10,9 +10,9 @@ namespace CloudNative.CloudEvents using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.Net.Http.Headers; - public class CloudEventInputFormatter : TextInputFormatter + public class CloudEventJsonInputFormatter : TextInputFormatter { - public CloudEventInputFormatter() + public CloudEventJsonInputFormatter() { SupportedMediaTypes.Add(MediaTypeHeaderValue.Parse("application/json")); SupportedMediaTypes.Add(MediaTypeHeaderValue.Parse("application/cloudevents")); diff --git a/test/CloudNative.CloudEvents.IntegrationTests/CloudNative.CloudEvents.IntegrationTests.csproj b/test/CloudNative.CloudEvents.IntegrationTests/CloudNative.CloudEvents.IntegrationTests.csproj index 0a32970..4eca15e 100644 --- a/test/CloudNative.CloudEvents.IntegrationTests/CloudNative.CloudEvents.IntegrationTests.csproj +++ b/test/CloudNative.CloudEvents.IntegrationTests/CloudNative.CloudEvents.IntegrationTests.csproj @@ -6,7 +6,6 @@ -