CSharp: add support for DateTimeOffset and sourceFolder configuration options

Adds option to use DateTimeOffset to model datetime fields instead of
DateTime to allow preservation of timezone information. Modifies
ApiClient.ParameterToString to support DateTimeOffset. Also adds
sourceFolder option.
This commit is contained in:
John Hancock
2016-01-06 20:02:43 -05:00
parent 5f9164049c
commit ebe090572f
3 changed files with 37 additions and 38 deletions

View File

@@ -33,11 +33,10 @@ public class CSharpClientOptionsTest extends AbstractOptionsTest {
times = 1;
clientCodegen.setOptionalAssemblyInfoFlag(true);
times = 1;
clientCodegen.setSourceFolder(CSharpClientOptionsProvider.SOURCE_FOLDER_VALUE);
times = 1;
clientCodegen.useDateTimeOffset(true);
times = 1;
clientCodegen.setSourceFolder(CSharpClientOptionsProvider.SOURCE_FOLDER_VALUE);
times = 1;
clientCodegen.useDateTimeOffset(true);
times = 1;
}};
}
}

View File

@@ -9,7 +9,7 @@ import java.util.Map;
public class CSharpClientOptionsProvider implements OptionsProvider {
public static final String PACKAGE_NAME_VALUE = "swagger_client_csharp";
public static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT";
public static final String SOURCE_FOLDER_VALUE = "src_csharp";
public static final String SOURCE_FOLDER_VALUE = "src_csharp";
@Override
public String getLanguage() {
@@ -24,8 +24,8 @@ public class CSharpClientOptionsProvider implements OptionsProvider {
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, "true")
.put(CodegenConstants.OPTIONAL_METHOD_ARGUMENT, "true")
.put(CodegenConstants.OPTIONAL_ASSEMBLY_INFO, "true")
.put(CodegenConstants.USE_DATETIME_OFFSET, "true")
.put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE)
.put(CodegenConstants.USE_DATETIME_OFFSET, "true")
.put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE)
.build();
}