Some time ago I faced with strange problem. Suppose that we have POCO which is used as action post parameter:
Class structure is quite straightforward, all properties are public and have getter and setter. As you can see Request contains array of RequestItems objects. And it is used as parameter of controller’s post action:
The following json object is successfully passed to this action and deserialized with default model binder:
The problems however begin when items array contains only 1 element:
And the last thing which is needed is to register custom model binder:
However the original problem is still unclear. Need to mention that it is specific to this class only. There were another similar classes with arrays (they were more simple, i.e. contained less properties) and they were deserialized by default model binder successfully when array contained single element. So if you faced with this problem and know another solution, please share it in comments.