File tree 3 files changed +11
-4
lines changed
modules/swagger-codegen/src/main
java/com/wordnik/swagger/codegen/languages
samples/client/petstore/csharp/src/main/csharp/io/swagger/client
3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ public CSharpClientCodegen() {
83
83
typeMapping .put ("file" , "string" ); // path to file
84
84
typeMapping .put ("array" , "List" );
85
85
typeMapping .put ("map" , "Dictionary" );
86
+ typeMapping .put ("object" , "Object" );
86
87
87
88
}
88
89
Original file line number Diff line number Diff line change @@ -53,10 +53,13 @@ namespace {{invokerPackage}} {
53
53
/// <param name =" json" > JSON string
54
54
/// <param name =" type" > Object type
55
55
/// <returns >Object representation of the JSON string</returns >
56
- public static object Deserialize(string json, Type type) {
56
+ public static object Deserialize(string content, Type type) {
57
+ if (type.GetType() == typeof(Object))
58
+ return (Object)content;
59
+
57
60
try
58
61
{
59
- return JsonConvert.DeserializeObject(json , type);
62
+ return JsonConvert.DeserializeObject(content , type);
60
63
}
61
64
catch (IOException e) {
62
65
throw new ApiException(500, e.Message);
Original file line number Diff line number Diff line change @@ -53,10 +53,13 @@ public static string ParameterToString(object obj)
53
53
/// <param name="json"> JSON string
54
54
/// <param name="type"> Object type
55
55
/// <returns>Object representation of the JSON string</returns>
56
- public static object Deserialize ( string json , Type type ) {
56
+ public static object Deserialize ( string content , Type type ) {
57
+ if ( type . GetType ( ) == typeof ( Object ) )
58
+ return ( Object ) content ;
59
+
57
60
try
58
61
{
59
- return JsonConvert . DeserializeObject ( json , type ) ;
62
+ return JsonConvert . DeserializeObject ( content , type ) ;
60
63
}
61
64
catch ( IOException e ) {
62
65
throw new ApiException ( 500 , e . Message ) ;
You can’t perform that action at this time.
0 commit comments