File tree Expand file tree Collapse file tree 4 files changed +24
-7
lines changed
modules/swagger-codegen/src/main
java/io/swagger/codegen/languages
samples/client/petstore/csharp/SwaggerClientTest Expand file tree Collapse file tree 4 files changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -484,12 +484,20 @@ public String getTypeDeclaration(Property p) {
484
484
485
485
@ Override
486
486
public String toModelName (String name ) {
487
- name = sanitizeName (modelNamePrefix + name + modelNameSuffix );
487
+ if (!StringUtils .isEmpty (modelNamePrefix )) {
488
+ name = modelNamePrefix + "_" + name ;
489
+ }
490
+
491
+ if (!StringUtils .isEmpty (modelNameSuffix )) {
492
+ name = name + "_" + modelNameSuffix ;
493
+ }
494
+
495
+ name = sanitizeName (name );
488
496
489
497
// model name cannot use reserved keyword, e.g. return
490
498
if (isReservedWord (name )) {
491
- LOGGER .warn (name + " (reserved word) cannot be used as model name. Renamed to " + camelize ("object_ " + name ));
492
- name = "object_ " + name ; // e.g. return => ObjectReturn (after camelize)
499
+ LOGGER .warn (name + " (reserved word) cannot be used as model name. Renamed to " + camelize ("model_ " + name ));
500
+ name = "model_ " + name ; // e.g. return => ObjectReturn (after camelize)
493
501
}
494
502
495
503
// camelize the model name
Original file line number Diff line number Diff line change 6
6
if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient).DownloadFile('https://nuget.org/nuget.exe', '.\nuget.exe')"
7
7
.\nuget.exe install vendor/packages.config -o vendor
8
8
9
- cp vendor/Newtonsoft.Json.8.0.2/lib/{ {targetFrameworkNuget} }/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll
10
- cp vendor/RestSharp.105.1.0/lib/{ {targetFrameworkNuget} }/RestSharp.dll bin/RestSharp.dll
9
+ copy vendor/Newtonsoft.Json.8.0.2/lib/{ {targetFrameworkNuget} }/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll
10
+ copy vendor/RestSharp.105.1.0/lib/{ {targetFrameworkNuget} }/RestSharp.dll bin/RestSharp.dll
11
11
12
12
%CSCPATH%\csc /reference:bin/Newtonsoft.Json.dll;bin/RestSharp.dll /target:library /out:bin/{ {packageName} }.dll /recurse:src\*.cs /doc:bin/{ {packageName} }.xml
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319
6
6
if not exist " .\nuget.exe" powershell -Command " (new-object System.Net.WebClient).DownloadFile('https://nuget.org/nuget.exe', '.\nuget.exe')"
7
7
.\nuget.exe install vendor/packages.config -o vendor
8
8
9
- cp vendor/Newtonsoft.Json.8.0.2/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll
10
- cp vendor/RestSharp.105.1.0/lib/net45/RestSharp.dll bin/RestSharp.dll
9
+ copy vendor/Newtonsoft.Json.8.0.2/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll
10
+ copy vendor/RestSharp.105.1.0/lib/net45/RestSharp.dll bin/RestSharp.dll
11
11
12
12
%CSCPATH% \csc /reference:bin/Newtonsoft.Json.dll;bin/RestSharp.dll /target:library /out:bin/IO.Swagger.dll /recurse:src\*.cs /doc:bin/IO.Swagger.xml
Original file line number Diff line number Diff line change 7
7
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/Newtonsoft.Json.dll
8
8
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/nunit.framework.dll
9
9
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/RestSharp.dll
10
+ /Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/.NETFramework,Version=v4.5.AssemblyAttribute.cs
11
+ /Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.swagger-logo.png
12
+ /Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb
13
+ /Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll
14
+ /Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll
15
+ /Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb
16
+ /Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/Newtonsoft.Json.dll
17
+ /Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/nunit.framework.dll
18
+ /Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/RestSharp.dll
You can’t perform that action at this time.
0 commit comments