We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2dcfb45 commit 5452912Copy full SHA for 5452912
1 file changed
JsonApiToolkit/Extensions/ServiceCollectionExtensions.cs
@@ -95,6 +95,18 @@ public static IServiceCollection AddJsonApiToolkit(this IServiceCollection servi
95
{
96
jsonOutputFormatter.SupportedMediaTypes.Add("application/vnd.api+json");
97
}
98
+
99
+ SystemTextJsonInputFormatter? jsonInputFormatter = options
100
+ .InputFormatters.OfType<SystemTextJsonInputFormatter>()
101
+ .FirstOrDefault();
102
103
+ if (
104
+ jsonInputFormatter?.SupportedMediaTypes.Contains("application/vnd.api+json")
105
+ == false
106
+ )
107
+ {
108
+ jsonInputFormatter.SupportedMediaTypes.Add("application/vnd.api+json");
109
+ }
110
});
111
112
services.AddScoped<JsonApiExceptionFilter>();
0 commit comments