[SalesForce] How to pass map attribute to apex controller

I am in a complex situation here. I want to pass a map attribute defined lightning component(which is a map of maps as shown below) to apex controller.

Map Attributes

<aura:attribute name="settingsFieldMap" type="Map" default="{}"/> <!-- Map of maps with key as a custom object and value as the map below(fieldValuesMap): -->
<aura:attribute name="fieldValuesMap" type="Map" default="{}"/> <!--this is a map of String to String-->

like

settingsFieldMap[key]=fieldValuesMap;

It shows me all values properly when I iterate throug it in component controller, but when I pass it in Apex controller, it shows null.

definition of Apex controller method:

public static void updateEditedValues(Map<customObject__c, Map<String, String>> settingsFieldMap)

Best Answer

Figured out better way to pass data rather than this complex logic. Hence, closing it.

NOTE: I used a list of list custom settings records , stringified them, de-serialised them in apex and then used them. Related question to this was:

How to pass LIST custom setting list(array) from client side to server side controller in lightning?

Related Topic