-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Issue with multipart/form-data post and json.net deserializtion (using interfaces) #4868
Copy link
Copy link
Open
Open
Copy link
Labels
Needs: DesignThis issue requires design work before implementating.This issue requires design work before implementating.affected-mediumThis issue impacts approximately half of our customersThis issue impacts approximately half of our customersarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-model-bindingseverity-blockingThis label is used by an internal toolThis label is used by an internal tool
Milestone
Metadata
Metadata
Assignees
Labels
Needs: DesignThis issue requires design work before implementating.This issue requires design work before implementating.affected-mediumThis issue impacts approximately half of our customersThis issue impacts approximately half of our customersarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-model-bindingseverity-blockingThis label is used by an internal toolThis label is used by an internal tool
Type
Fields
Give feedbackNo fields configured for Feature.
We use the aspnetcore 2.
We have configured JsonOptions in startup like this.
In our controller we have 2 methods
2.. The second one is called PostΜultipart in which we make a http post request with content-type : multipart/form-data.
The first method works fine, and the deserialization works fine. In the second method deserialization fails.
The error is:
Model bound complex types must not be abstract or value types and must have a parameterless constructor.That's because the JsonOptions isn't applied.
When we remove the jsonOptions from the startup.cs, we get the same error in both cases.