forked from loafle/openapi-generator-original
* add support for async routes/endpoints you can now set --optional-properties async=true to generate a nancyfx server stub that uses asynchronous programming. (cherry picked from commit 126869cb0b967e8063417e11993cf6326ce8ffd4) * add nancyfx-petstore-server-async.sh to generate sample of async nancyfx. * Rename async => asyncServer * update bin/nancyfx-petstore-server-async.sh * rename async => asyncServer in api.mustache + small bugfix * run ./bin/nancyfx-petstore-server.sh and ./bin/nancyfx-petstore-server-async.sh * remove additional new line in api.mustache + add space after if * run ./bin/nancyfx-petstore-server.sh and ./bin/nancyfx-petstore-server-async.sh * Map `date` fields to LocalDate c# type + add a JsonConverter for LocalDate.
This commit is contained in:
@@ -121,6 +121,7 @@ public class NancyFXServerCodegen extends AbstractCSharpCodegen {
|
||||
modelPackage = isNullOrEmpty(packageName) ? MODEL_NAMESPACE : packageName + "." + MODEL_NAMESPACE;
|
||||
|
||||
supportingFiles.add(new SupportingFile("parameters.mustache", sourceFile("Utils"), "Parameters.cs"));
|
||||
supportingFiles.add(new SupportingFile("localDateConverter.mustache", sourceFile("Utils"), "LocalDateConverter.cs"));
|
||||
supportingFiles.add(new SupportingFile("packages.config.mustache", sourceFolder(), "packages.config"));
|
||||
supportingFiles.add(new SupportingFile("nuspec.mustache", sourceFolder(), packageName + ".nuspec"));
|
||||
|
||||
@@ -391,12 +392,12 @@ public class NancyFXServerCodegen extends AbstractCSharpCodegen {
|
||||
private static Map<String, String> nodaTimeTypesMappings() {
|
||||
return ImmutableMap.of(
|
||||
"time", "LocalTime?",
|
||||
"date", "ZonedDateTime?",
|
||||
"date", "LocalDate?",
|
||||
"datetime", "ZonedDateTime?");
|
||||
}
|
||||
|
||||
private static Set<String> nodaTimePrimitiveTypes() {
|
||||
return ImmutableSet.of("LocalTime?", "ZonedDateTime?");
|
||||
return ImmutableSet.of("LocalTime?", "LocalDate?","ZonedDateTime?");
|
||||
}
|
||||
|
||||
private class DependencyInfo {
|
||||
|
||||
Reference in New Issue
Block a user