forked from loafle/openapi-generator-original
make datetime nullable
This commit is contained in:
parent
92dd5cab93
commit
c2c43bba37
@ -60,7 +60,7 @@ public class CSharpClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
"byte[]",
|
"byte[]",
|
||||||
"List",
|
"List",
|
||||||
"Dictionary",
|
"Dictionary",
|
||||||
"DateTime",
|
"DateTime?",
|
||||||
"String",
|
"String",
|
||||||
"Boolean",
|
"Boolean",
|
||||||
"Double",
|
"Double",
|
||||||
@ -80,9 +80,11 @@ public class CSharpClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
typeMapping.put("long", "long?");
|
typeMapping.put("long", "long?");
|
||||||
typeMapping.put("double", "double?");
|
typeMapping.put("double", "double?");
|
||||||
typeMapping.put("number", "double?");
|
typeMapping.put("number", "double?");
|
||||||
typeMapping.put("Date", "DateTime");
|
typeMapping.put("datetime", "DateTime?");
|
||||||
|
typeMapping.put("date", "DateTime?");
|
||||||
typeMapping.put("file", "string"); // path to file
|
typeMapping.put("file", "string"); // path to file
|
||||||
typeMapping.put("array", "List");
|
typeMapping.put("array", "List");
|
||||||
|
typeMapping.put("list", "List");
|
||||||
typeMapping.put("map", "Dictionary");
|
typeMapping.put("map", "Dictionary");
|
||||||
typeMapping.put("object", "Object");
|
typeMapping.put("object", "Object");
|
||||||
|
|
||||||
@ -166,8 +168,8 @@ public class CSharpClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
public String getSwaggerType(Property p) {
|
public String getSwaggerType(Property p) {
|
||||||
String swaggerType = super.getSwaggerType(p);
|
String swaggerType = super.getSwaggerType(p);
|
||||||
String type = null;
|
String type = null;
|
||||||
if(typeMapping.containsKey(swaggerType)) {
|
if(typeMapping.containsKey(swaggerType.toLowerCase())) {
|
||||||
type = typeMapping.get(swaggerType);
|
type = typeMapping.get(swaggerType.toLowerCase());
|
||||||
if(languageSpecificPrimitives.contains(type))
|
if(languageSpecificPrimitives.contains(type))
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ namespace IO.Swagger.Model {
|
|||||||
|
|
||||||
|
|
||||||
[DataMember(Name="shipDate", EmitDefaultValue=false)]
|
[DataMember(Name="shipDate", EmitDefaultValue=false)]
|
||||||
public DateTime ShipDate { get; set; }
|
public DateTime? ShipDate { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/* Order Status */
|
/* Order Status */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user