forked from loafle/openapi-generator-original
[csharp] Fixed isMap property (#13482)
* fixed data type for maps * fighting line endings * fighting line endings * removed commented code * reverted unintended line break * reverted unintended line break * reverted unintended line break
This commit is contained in:
parent
36976d5c72
commit
4e54b07076
@ -118,7 +118,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
);
|
||||
|
||||
mapTypes = new HashSet<>(
|
||||
Arrays.asList("IDictionary")
|
||||
Arrays.asList("IDictionary", "Dictionary")
|
||||
);
|
||||
|
||||
// NOTE: C# uses camel cased reserved words, while models are title cased. We don't want lowercase comparisons.
|
||||
@ -712,7 +712,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
}
|
||||
} else {
|
||||
operation.returnContainer = operation.returnType;
|
||||
operation.isMap = this.mapTypes.contains(typeMapping);
|
||||
operation.isMap = this.mapTypes.stream().anyMatch(t -> typeMapping.startsWith(t));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
var example = exampleJson != null
|
||||
? JsonConvert.DeserializeObject<Dictionary<{{{returnType}}}>>(exampleJson)
|
||||
: new Dictionary<{{{returnType}}}>();
|
||||
? JsonConvert.DeserializeObject<{{{returnType}}}>(exampleJson)
|
||||
: new {{{returnType}}}();
|
@ -1,4 +1,4 @@
|
||||
|
||||
var example = exampleJson != null
|
||||
? JsonConvert.DeserializeObject<Dictionary<{{{returnType}}}>>(exampleJson)
|
||||
: new Dictionary<{{{returnType}}}>();
|
||||
? JsonConvert.DeserializeObject<{{{returnType}}}>(exampleJson)
|
||||
: new {{{returnType}}}();
|
@ -1,4 +1,4 @@
|
||||
|
||||
var example = exampleJson != null
|
||||
? JsonConvert.DeserializeObject<Dictionary<{{{returnType}}}>>(exampleJson)
|
||||
: new Dictionary<{{{returnType}}}>();
|
||||
? JsonConvert.DeserializeObject<{{{returnType}}}>(exampleJson)
|
||||
: new {{{returnType}}}();
|
@ -70,7 +70,7 @@ namespace Org.OpenAPITools.Controllers
|
||||
|
||||
var example = exampleJson != null
|
||||
? JsonConvert.DeserializeObject<Dictionary<string, int>>(exampleJson)
|
||||
: default(Dictionary<string, int>);
|
||||
: new Dictionary<string, int>();
|
||||
//TODO: Change the data returned
|
||||
return new ObjectResult(example);
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ namespace Org.OpenAPITools.Controllers
|
||||
|
||||
var example = exampleJson != null
|
||||
? JsonConvert.DeserializeObject<Dictionary<string, int>>(exampleJson)
|
||||
: default(Dictionary<string, int>);
|
||||
: new Dictionary<string, int>();
|
||||
//TODO: Change the data returned
|
||||
return new ObjectResult(example);
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ namespace Org.OpenAPITools.Controllers
|
||||
|
||||
var example = exampleJson != null
|
||||
? JsonConvert.DeserializeObject<Dictionary<string, int>>(exampleJson)
|
||||
: default(Dictionary<string, int>);
|
||||
: new Dictionary<string, int>();
|
||||
//TODO: Change the data returned
|
||||
return new ObjectResult(example);
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ namespace Org.OpenAPITools.Controllers
|
||||
|
||||
var example = exampleJson != null
|
||||
? JsonConvert.DeserializeObject<Dictionary<string, int>>(exampleJson)
|
||||
: default(Dictionary<string, int>);
|
||||
: new Dictionary<string, int>();
|
||||
//TODO: Change the data returned
|
||||
return new ObjectResult(example);
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ namespace Org.OpenAPITools.Controllers
|
||||
|
||||
var example = exampleJson != null
|
||||
? JsonConvert.DeserializeObject<Dictionary<string, int>>(exampleJson)
|
||||
: default(Dictionary<string, int>);
|
||||
: new Dictionary<string, int>();
|
||||
//TODO: Change the data returned
|
||||
return new ObjectResult(example);
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ namespace Org.OpenAPITools.Controllers
|
||||
|
||||
var example = exampleJson != null
|
||||
? JsonConvert.DeserializeObject<Dictionary<string, int>>(exampleJson)
|
||||
: default(Dictionary<string, int>);
|
||||
: new Dictionary<string, int>();
|
||||
//TODO: Change the data returned
|
||||
return new ObjectResult(example);
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ namespace Org.OpenAPITools.Controllers
|
||||
|
||||
var example = exampleJson != null
|
||||
? JsonConvert.DeserializeObject<Dictionary<string, int>>(exampleJson)
|
||||
: default(Dictionary<string, int>);
|
||||
: new Dictionary<string, int>();
|
||||
//TODO: Change the data returned
|
||||
return new ObjectResult(example);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user