forked from loafle/openapi-generator-original
Fixed CSharpDataTypeMappingProvider for string type.
This commit is contained in:
parent
2633eb77e2
commit
43d15d4d00
@ -155,7 +155,6 @@ namespace SwaggerRuntime.Common
|
|||||||
|
|
||||||
protected string EncodeUrl(string value)
|
protected string EncodeUrl(string value)
|
||||||
{
|
{
|
||||||
// TODO IMM HI: do we need to replace: .replaceAll("\\+", "%20"); ????
|
|
||||||
return HttpUtility.UrlEncode(value);
|
return HttpUtility.UrlEncode(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ public class CSharpDataTypeMappingProvider implements DataTypeMappingProvider {
|
|||||||
private static final Map<String, String> _primitiveValueMap;
|
private static final Map<String, String> _primitiveValueMap;
|
||||||
private static final Map<String, String> _primitiveObjectMap;
|
private static final Map<String, String> _primitiveObjectMap;
|
||||||
|
|
||||||
private NamingPolicyProvider _nameGenerator = new CamelCaseNamingPolicyProvider();
|
private NamingPolicyProvider _nameGenerator = new CSharpNamingPolicyProvider();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
_primitiveValueMap = new HashMap<String, String>();
|
_primitiveValueMap = new HashMap<String, String>();
|
||||||
|
@ -45,6 +45,10 @@ public class CSharpNamingPolicyProvider implements NamingPolicyProvider {
|
|||||||
@Override
|
@Override
|
||||||
public String applyClassNamingPolicy(String input) {
|
public String applyClassNamingPolicy(String input) {
|
||||||
if (input != null && input.length() > 0) {
|
if (input != null && input.length() > 0) {
|
||||||
|
if ("string".equalsIgnoreCase(input)) {
|
||||||
|
return "string";
|
||||||
|
}
|
||||||
|
|
||||||
String output = input.substring(0, 1).toUpperCase() + input.substring(1);
|
String output = input.substring(0, 1).toUpperCase() + input.substring(1);
|
||||||
// class name can't have . so if dot exists remove the same
|
// class name can't have . so if dot exists remove the same
|
||||||
output = output.replace(".", "");
|
output = output.replace(".", "");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user