You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// This is nearly a copy of aspnetcore's ApiBehaviorApplicationModelProvider which supplies a convention for the
20
20
/// [ApiController] attribute, however that convention is too strict for our purposes so we will have our own.
21
+
/// Uses UmbracoJsonModelBinder for complex parameters and those with BindingSource of Body, but leaves the rest alone see GH #11554
21
22
/// </para>
22
23
/// <para>
23
24
/// See https://shazwazza.com/post/custom-body-model-binding-per-controller-in-asp-net-core/
@@ -41,14 +42,12 @@ public UmbracoApiBehaviorApplicationModelProvider(IModelMetadataProvider modelMe
41
42
{
42
43
newClientErrorResultFilterConvention(),// Ensures the responses without any body is converted into a simple json object with info instead of a string like "Status Code: 404; Not Found"
43
44
newConsumesConstraintForFormFileParameterConvention(),// If an controller accepts files, it must accept multipart/form-data.
44
-
newInferParameterBindingInfoConvention(modelMetadataProvider),// no need for [FromBody] everywhere, A complex type parameter is assigned to FromBody
45
45
46
-
// This ensures that all parameters of type BindingSource.Body (based on the above InferParameterBindingInfoConvention) are bound
46
+
// This ensures that all parameters of type BindingSource.Body and those of complex type are bound
0 commit comments