@@ -125,6 +125,19 @@ def decode_property(
125125 location : Mapping [str , Any ],
126126 ) -> Any :
127127 if self .encoding is None or prop_name not in self .encoding :
128+ prop_schema_type = prop_schema .getkey ("type" , "" )
129+ if (
130+ self .mimetype == "application/x-www-form-urlencoded"
131+ and prop_schema_type in ["array" , "object" ]
132+ ):
133+ # default serialization strategy for complex objects
134+ # in the application/x-www-form-urlencoded
135+ return self .decode_property_style (
136+ prop_name ,
137+ prop_schema ,
138+ location ,
139+ SchemaPath .from_dict ({"style" : "form" }),
140+ )
128141 return self .decode_property_content_type (
129142 prop_name , prop_schema , location
130143 )
@@ -163,20 +176,24 @@ def decode_property_content_type(
163176 prop_name : str ,
164177 prop_schema : SchemaPath ,
165178 location : Mapping [str , Any ],
166- prep_encoding : Optional [SchemaPath ] = None ,
179+ prop_encoding : Optional [SchemaPath ] = None ,
167180 ) -> Any :
168- prop_content_type = get_content_type (prop_schema , prep_encoding )
181+ prop_content_type = get_content_type (prop_schema , prop_encoding )
169182 prop_deserializer = self .evolve (
170183 prop_content_type ,
171184 prop_schema ,
172185 )
173186 prop_schema_type = prop_schema .getkey ("type" , "" )
174- if prop_schema_type == "array" :
187+ if (
188+ self .mimetype .startswith ("multipart" )
189+ and prop_schema_type == "array"
190+ ):
175191 if isinstance (location , SuportsGetAll ):
176192 value = location .getall (prop_name )
193+ return list (map (prop_deserializer .deserialize , value ))
177194 if isinstance (location , SuportsGetList ):
178195 value = location .getlist (prop_name )
179- return list (map (prop_deserializer .deserialize , value ))
180- else :
181- value = location [prop_name ]
182- return prop_deserializer .deserialize (value )
196+ return list (map (prop_deserializer .deserialize , value ))
197+
198+ value = location [prop_name ]
199+ return prop_deserializer .deserialize (value )
0 commit comments