Skip to content
Permalink
Browse files

Fix float/double default value in C# generator (#791)

* fix float/double default value

* better code format

* better CI for openapi3 batch files (C# client)

* update nancyfx samples

* pipe output to /dev/null to reduce log size

* fix windows batch file

* add C# API client generated by OAS3 spec
  • Loading branch information...
wing328 committed Aug 13, 2018
1 parent c237fe9 commit b64864f47dc0a9a026ebb2a17dcca394bb1191a6
Showing with 22,328 additions and 134 deletions.
  1. 0 ...s.ci}/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj
  2. +6 −0 appveyor.yml
  3. +3 −2 bin/csharp-petstore.sh
  4. +1 −1 bin/openapi3/csharp-petstore.sh
  5. +33 −0 bin/openapi3/run-all-petstore
  6. +14 −0 bin/openapi3/windows/csharp-petstore.bat
  7. +15 −0 bin/openapi3/windows/run-all-petstore.cmd
  8. +3 −3 bin/run-all-petstore
  9. +1 −0 bin/utils/ensure-up-to-date
  10. +1 −1 bin/windows/csharp-petstore-net-40.bat
  11. +1 −1 bin/windows/csharp-petstore-netstandard.bat
  12. +3 −3 bin/windows/csharp-petstore.bat
  13. +52 −3 ...les/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java
  14. +18 −13 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java
  15. +4 −4 samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md
  16. +186 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/.gitignore
  17. +23 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/.openapi-generator-ignore
  18. +1 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION
  19. +9 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/.travis.yml
  20. +27 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/Org.OpenAPITools.sln
  21. +207 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/README.md
  22. +17 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/build.bat
  23. +68 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/build.sh
  24. +10 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/AdditionalPropertiesClass.md
  25. +10 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Animal.md
  26. +8 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/AnimalFarm.md
  27. +70 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/AnotherFakeApi.md
  28. +11 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ApiResponse.md
  29. +9 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayOfArrayOfNumberOnly.md
  30. +9 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayOfNumberOnly.md
  31. +11 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayTest.md
  32. +14 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Capitalization.md
  33. +11 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Cat.md
  34. +10 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Category.md
  35. +9 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ClassModel.md
  36. +11 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Dog.md
  37. +10 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumArrays.md
  38. +8 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumClass.md
  39. +13 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumTest.md
  40. +720 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md
  41. +75 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FakeClassnameTags123Api.md
  42. +9 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/File.md
  43. +10 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FileSchemaTestClass.md
  44. +21 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FormatTest.md
  45. +10 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/HasOnlyReadOnly.md
  46. +9 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/List.md
  47. +12 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/MapTest.md
  48. +11 −0 ...openapi3/client/petstore/csharp/OpenAPIClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md
  49. +10 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Model200Response.md
  50. +9 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ModelClient.md
  51. +12 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Name.md
  52. +9 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/NumberOnly.md
  53. +14 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Order.md
  54. +11 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterComposite.md
  55. +8 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnum.md
  56. +14 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Pet.md
  57. +593 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/PetApi.md
  58. +10 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ReadOnlyFirst.md
  59. +9 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Return.md
  60. +9 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/SpecialModelName.md
  61. +254 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/StoreApi.md
  62. +8 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/StringBooleanMap.md
  63. +10 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Tag.md
  64. +16 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/User.md
  65. +488 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/UserApi.md
  66. +52 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/git_push.sh
  67. +22 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/mono_nunit_test.sh
  68. +81 −0 ...penapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs
  69. +223 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs
  70. +81 −0 ...lient/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs
  71. +184 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Api/PetApiTests.cs
  72. +116 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs
  73. +166 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Api/UserApiTests.cs
  74. +88 −0 ...t/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs
  75. +72 −0 .../openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/AnimalFarmTests.cs
  76. +106 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/AnimalTests.cs
  77. +96 −0 ...openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs
  78. +80 −0 ...nt/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs
  79. +80 −0 ...i3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs
  80. +96 −0 ...s/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs
  81. +120 −0 ...napi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs
  82. +80 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/CatTests.cs
  83. +88 −0 ...es/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/CategoryTests.cs
  84. +80 −0 .../openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs
  85. +80 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/DogTests.cs
  86. +88 −0 .../openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs
  87. +72 −0 ...s/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs
  88. +112 −0 ...es/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs
  89. +88 −0 .../client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs
  90. +80 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/FileTests.cs
  91. +176 −0 .../openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs
  92. +88 −0 ...api3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs
  93. +80 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/ListTests.cs
  94. +104 −0 ...les/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/MapTestTests.cs
  95. +96 −0 ...OpenAPIClient/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs
  96. +88 −0 ...pi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs
  97. +80 −0 ...openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs
  98. +104 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/NameTests.cs
  99. +80 −0 .../openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs
  100. +120 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/OrderTests.cs
  101. +96 −0 ...napi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs
  102. +72 −0 ...s/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs
  103. +120 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/PetTests.cs
  104. +88 −0 ...enapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs
  105. +80 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/ReturnTests.cs
  106. +80 −0 ...pi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs
  107. +72 −0 ...pi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/StringBooleanMapTests.cs
  108. +88 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/TagTests.cs
  109. +136 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/UserTests.cs
  110. +89 −0 ...napi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj
  111. +7 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/packages.config
  112. +321 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs
  113. +2,397 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs
  114. +331 −0 ...openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs
  115. +1,919 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs
  116. +840 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs
  117. +1,590 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs
  118. +530 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs
  119. +60 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiException.cs
  120. +54 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiResponse.cs
  121. +452 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs
  122. +24 −0 ...les/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ExceptionFactory.cs
  123. +34 −0 .../openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/GlobalConfiguration.cs
  124. +42 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/IApiAccessor.cs
  125. +94 −0 ...enapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/IReadableConfiguration.cs
  126. +30 −0 ...openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs
  127. +140 −0 ...api3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs
  128. +175 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs
  129. +110 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AnimalFarm.cs
  130. +156 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs
  131. +124 −0 ...napi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs
  132. +124 −0 ...les/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs
  133. +156 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs
  134. +205 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Capitalization.cs
  135. +131 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs
  136. +140 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs
  137. +124 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ClassModel.cs
  138. +131 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs
  139. +181 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumArrays.cs
  140. +55 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumClass.cs
  141. +290 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs
  142. +125 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/File.cs
  143. +140 −0 ...s/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs
  144. +433 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs
  145. +137 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs
  146. +124 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/List.cs
  147. +193 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs
  148. +156 −0 ...re/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs
  149. +140 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs
  150. +124 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ModelClient.cs
  151. +181 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs
  152. +124 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs
  153. +240 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs
  154. +156 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs
  155. +55 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnum.cs
  156. +253 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs
  157. +138 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs
  158. +124 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs
  159. +124 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs
  160. +110 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/StringBooleanMap.cs
  161. +140 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs
  162. +237 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs
  163. +78 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj
  164. +41 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.nuspec
  165. +32 −0 ...les/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Properties/AssemblyInfo.cs
  166. +6 −0 samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/packages.config
  167. +0 −14 samples/server/petstore/nancyfx/src/IO.Swagger/IO.Swagger.nuspec
  168. +1 −1 samples/server/petstore/nancyfx/src/{IO.Swagger → Org.OpenAPITools}/Models/ApiResponse.cs
  169. +1 −1 samples/server/petstore/nancyfx/src/{IO.Swagger → Org.OpenAPITools}/Models/Category.cs
  170. +1 −1 samples/server/petstore/nancyfx/src/{IO.Swagger → Org.OpenAPITools}/Models/Order.cs
  171. +1 −1 samples/server/petstore/nancyfx/src/{IO.Swagger → Org.OpenAPITools}/Models/Pet.cs
  172. +1 −1 samples/server/petstore/nancyfx/src/{IO.Swagger → Org.OpenAPITools}/Models/Tag.cs
  173. +1 −1 samples/server/petstore/nancyfx/src/{IO.Swagger → Org.OpenAPITools}/Models/User.cs
  174. +23 −23 samples/server/petstore/nancyfx/src/{IO.Swagger → Org.OpenAPITools}/Modules/PetModule.cs
  175. +12 −12 samples/server/petstore/nancyfx/src/{IO.Swagger → Org.OpenAPITools}/Modules/StoreModule.cs
  176. +42 −42 samples/server/petstore/nancyfx/src/{IO.Swagger → Org.OpenAPITools}/Modules/UserModule.cs
  177. +4 −4 ...er/petstore/nancyfx/src/{IO.Swagger/IO.Swagger.csproj → Org.OpenAPITools/Org.OpenAPITools.csproj}
  178. +13 −0 samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.nuspec
  179. +1 −1 samples/server/petstore/nancyfx/src/{IO.Swagger → Org.OpenAPITools}/Utils/LocalDateConverter.cs
  180. +1 −1 samples/server/petstore/nancyfx/src/{IO.Swagger → Org.OpenAPITools}/Utils/Parameters.cs
  181. 0 samples/server/petstore/nancyfx/src/{IO.Swagger → Org.OpenAPITools}/packages.config
  182. +2 −0 shippable.yml
@@ -35,13 +35,19 @@ build_script:
# install openapi-generator locally
- mvn clean install --quiet
test_script:
# restore test-related files
- copy /b/v/y CI\samples.ci\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj samples\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
# test c# API client
- nunit-console samples\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\bin\Debug\Org.OpenAPITools.Test.dll --result=myresults.xml;format=AppVeyor
# test c# API client (with PropertyChanged)
- nunit-console samples\client\petstore\csharp\OpenAPIClientWithPropertyChanged\src\Org.OpenAPITools.Test\bin\Debug\Org.OpenAPITools.Test.dll --result=myresults.xml;format=AppVeyor

# generate all petstore clients
- .\bin\windows\run-all-petstore.cmd

# generate all petstore clients (openapi3)
- .\bin\openapi3\windows\run-all-petstore.cmd

cache:
- C:\maven\
- C:\Users\appveyor\.m2
@@ -29,8 +29,9 @@ fi
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples/client/petstore/csharp/OpenAPIClient --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C} $@"

java $JAVA_OPTS -jar $executable $ags

# restore csproj file
echo "restore csproject file: CI/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj"
cp ./CI/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj ./samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/
cp ./CI/samples.ci/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj ./samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/

java $JAVA_OPTS -jar $executable $ags
@@ -27,6 +27,6 @@ fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate $@ -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples/client/petstore/csharp/OpenAPIClient --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C}"
ags="generate $@ -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples/openapi3/client/petstore/csharp/OpenAPIClient --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C}"

java $JAVA_OPTS -jar $executable $ags
@@ -0,0 +1,33 @@
#!/bin/bash
# this bash script will loop through all the .sh files under bin
# execute the script and check the result (exit code) to see if
# there's any error

echo "IMPORTANT: this script should be run by the CI (e.g. Shippable) only. There's no need to run this script to update Petstore samples for all generators."
echo "Please press CTRL+C to stop or the script will continue in 10 seconds."

sleep 10

successes=0
failures=0
for SCRIPT in $(ls -l ./bin/openapi3/*.sh | grep -v all)
do
if [ -f ${SCRIPT} -a -x ${SCRIPT} ]; then
echo "Running $SCRIPT (output to /dev/null)"
${SCRIPT} 2>&1 > /dev/null
rc=$?
if [[ ${rc} != 0 ]]; then
>&2 echo "ERROR!! FAILED TO RUN ${SCRIPT}"
((failures+=1))
else
((successes+=1))
fi
fi
done

if (( failures > 0 )); then
>&2 echo "[ERROR] ${failures} out of $((failures+successes)) scripts failed."
exit 1
else
echo "[SUCCESS] ${successes} generators finished."
fi
@@ -0,0 +1,14 @@
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar

If Not Exist %executable% (
mvn clean package
)

REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -i modules\openapi-generator\src\test/resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples\openapi3\client\petstore\csharp\SwaggerClient --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C}

java %JAVA_OPTS% -jar %executable% %ags%

REM restore csproj file
echo "restore csproject file: CI\samples.ci\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj"
copy /b/v/y CI\samples.ci\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj samples\openapi3\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\
@@ -0,0 +1,15 @@
REM this batch file will loop through all the .bat files under bin\openapi3\windows\
REM execute the script and check the error level to see if there's any error

echo IMPORTANT: this script should be run by the CI (e.g. appveyor) only. There's no need to run this script to update Petstore samples for all generators.
echo Please press CTRL+C to stop or the script will continue in 10 seconds.

timeout 10

for /f "delims=" %%i in ('dir /b ".\bin\openapi3\windows\*.bat"') do (

CALL .\bin\openapi3\windows\%%i

IF ERRORLEVEL 1 IF NOT ERRORLEVEL 2 exit /b 1

)
@@ -13,8 +13,8 @@ failures=0
for SCRIPT in $(ls -l ./bin/*.sh | grep -v all)
do
if [ -f ${SCRIPT} -a -x ${SCRIPT} ]; then
echo "Running $SCRIPT"
${SCRIPT}
echo "Running $SCRIPT (output to /dev/null)"
${SCRIPT} 2>&1 > /dev/null
rc=$?
if [[ ${rc} != 0 ]]; then
>&2 echo "ERROR!! FAILED TO RUN ${SCRIPT}"
@@ -30,4 +30,4 @@ if (( failures > 0 )); then
exit 1
else
echo "[SUCCESS] ${successes} generators finished."
fi
fi
@@ -31,6 +31,7 @@ sleep 5
./bin/typescript-inversify-petstore.sh > /dev/null 2>&1
./bin/rust-server-petstore.sh > /dev/null 2>&1
./bin/openapi3/haskell-http-client-petstore.sh > /dev/null 2>&1
./bin/csharp-petstore.sh > /dev/null 2>&1

# Check:
if [ -n "$(git status --porcelain)" ]; then
@@ -5,6 +5,6 @@ If Not Exist %executable% (
)

REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples/client/petstore/csharp/SwaggerClientNet40 --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C} -c ./bin/csharp-petstore-net-40.json
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples\client\petstore\csharp\SwaggerClientNet40 --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C} -c .\bin\csharp-petstore-net-40.json

java %JAVA_OPTS% -jar %executable% %ags%
@@ -5,6 +5,6 @@ If Not Exist %executable% (
)

REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples\client\petstore\csharp\SwaggerClientNetStandard --additional-properties targetFramework=v5.0,packageGuid={3AB1F259-1769-484B-9411-84505FCCBD55}
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples\client\petstore\csharp\SwaggerClientNetStandard --additional-properties targetFramework=v5.0,packageGuid={3AB1F259-1769-484B-9411-84505FCCBD55}

java %JAVA_OPTS% -jar %executable% %ags%
@@ -9,7 +9,7 @@ set ags=generate -i modules\openapi-generator\src\test/resources\2_0\petstore-wi

java %JAVA_OPTS% -jar %executable% %ags%

# restore csproj file
echo "restore csproject file: CI\samples\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj"
copy .\CI\samples\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj .\samples\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\
REM restore csproj file
echo "restore csproject file: CI\samples.ci\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj"
copy /b/v/y CI\samples.ci\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj samples\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\

@@ -19,6 +19,7 @@

import com.google.common.collect.ImmutableMap;
import com.samskivert.mustache.Mustache;
import io.swagger.v3.core.util.Json;
import org.apache.commons.lang3.StringUtils;
import org.openapitools.codegen.*;
import org.openapitools.codegen.utils.*;
@@ -713,12 +714,22 @@ public String toDefaultValue(Schema p) {
return p.getDefault().toString();
}
} else if (ModelUtils.isDateSchema(p)) {
// TODO
if (p.getDefault() != null) {
return "\"" + p.getDefault().toString() + "\"";
}
} else if (ModelUtils.isDateTimeSchema(p)) {
// TODO
if (p.getDefault() != null) {
return "\"" + p.getDefault().toString() + "\"";
}
} else if (ModelUtils.isNumberSchema(p)) {
if (p.getDefault() != null) {
return p.getDefault().toString();
if (ModelUtils.isFloatSchema(p)) { // float
return p.getDefault().toString() + "F";
} else if (ModelUtils.isDoubleSchema(p)) { // double
return p.getDefault().toString() + "D";
} else {
return p.getDefault().toString();
}
}
} else if (ModelUtils.isIntegerSchema(p)) {
if (p.getDefault() != null) {
@@ -967,4 +978,42 @@ public boolean isDataTypeString(String dataType) {
// also treat double/decimal/float as "string" in enum so that the values (e.g. 2.8) get double-quoted
return "String".equalsIgnoreCase(dataType) || "double?".equals(dataType) || "decimal?".equals(dataType) || "float?".equals(dataType);
}

@Override
public void setParameterExampleValue(CodegenParameter codegenParameter) {

// set the example value
// if not specified in x-example, generate a default value
// TODO need to revise how to obtain the example value
if (codegenParameter.vendorExtensions != null && codegenParameter.vendorExtensions.containsKey("x-example")) {
codegenParameter.example = Json.pretty(codegenParameter.vendorExtensions.get("x-example"));
} else if (Boolean.TRUE.equals(codegenParameter.isBoolean)) {
codegenParameter.example = "true";
} else if (Boolean.TRUE.equals(codegenParameter.isLong)) {
codegenParameter.example = "789";
} else if (Boolean.TRUE.equals(codegenParameter.isInteger)) {
codegenParameter.example = "56";
} else if (Boolean.TRUE.equals(codegenParameter.isFloat)) {
codegenParameter.example = "3.4F";
} else if (Boolean.TRUE.equals(codegenParameter.isDouble)) {
codegenParameter.example = "1.2D";
} else if (Boolean.TRUE.equals(codegenParameter.isNumber)) {
codegenParameter.example = "8.14";
} else if (Boolean.TRUE.equals(codegenParameter.isBinary)) {
codegenParameter.example = "BINARY_DATA_HERE";
} else if (Boolean.TRUE.equals(codegenParameter.isByteArray)) {
codegenParameter.example = "BYTE_ARRAY_DATA_HERE";
} else if (Boolean.TRUE.equals(codegenParameter.isFile)) {
codegenParameter.example = "/path/to/file.txt";
} else if (Boolean.TRUE.equals(codegenParameter.isDate)) {
codegenParameter.example = "2013-10-20";
} else if (Boolean.TRUE.equals(codegenParameter.isDateTime)) {
codegenParameter.example = "2013-10-20T19:20:30+01:00";
} else if (Boolean.TRUE.equals(codegenParameter.isUuid)) {
codegenParameter.example = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
} else if (Boolean.TRUE.equals(codegenParameter.isString)) {
codegenParameter.example = codegenParameter.paramName + "_example";
}

}
}
@@ -603,11 +603,11 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert
}

/*
* The pattern spec follows the Perl convention and style of modifiers. .NET
* does not support this syntax directly so we need to convert the pattern to a .NET compatible
* format and apply modifiers in a compatible way.
* See https://msdn.microsoft.com/en-us/library/yd1hzczs(v=vs.110).aspx for .NET options.
*/
* The pattern spec follows the Perl convention and style of modifiers. .NET
* does not support this syntax directly so we need to convert the pattern to a .NET compatible
* format and apply modifiers in a compatible way.
* See https://msdn.microsoft.com/en-us/library/yd1hzczs(v=vs.110).aspx for .NET options.
*/
public void postProcessPattern(String pattern, Map<String, Object> vendorExtensions) {
if (pattern != null) {
int i = pattern.lastIndexOf('/');
@@ -707,7 +707,7 @@ public String toEnumVarName(String value, String datatype) {
}

// number
if(datatype.startsWith("int") || datatype.startsWith("long") ||
if (datatype.startsWith("int") || datatype.startsWith("long") ||
datatype.startsWith("double") || datatype.startsWith("float")) {
String varName = "NUMBER_" + value;
varName = varName.replaceAll("-", "MINUS_");
@@ -751,13 +751,18 @@ public String toVarName(String name) {

public String getNameUsingModelPropertyNaming(String name) {
switch (CodegenConstants.MODEL_PROPERTY_NAMING_TYPE.valueOf(getModelPropertyNaming())) {
case original: return name;
case camelCase: return camelize(name, true);
case PascalCase: return camelize(name);
case snake_case: return underscore(name);
default: throw new IllegalArgumentException("Invalid model property naming '" +
name + "'. Must be 'original', 'camelCase', " +
"'PascalCase' or 'snake_case'");
case original:
return name;
case camelCase:
return camelize(name, true);
case PascalCase:
return camelize(name);
case snake_case:
return underscore(name);
default:
throw new IllegalArgumentException("Invalid model property naming '" +
name + "'. Must be 'original', 'camelCase', " +
"'PascalCase' or 'snake_case'");
}
}

@@ -160,7 +160,7 @@ namespace Example
public void main()
{
var apiInstance = new FakeApi();
var body = 1.2; // decimal? | Input number as post body (optional)
var body = 1.2D; // decimal? | Input number as post body (optional)
try
{
@@ -464,13 +464,13 @@ namespace Example
var apiInstance = new FakeApi();
var number = 8.14; // decimal? | None
var _double = 1.2; // double? | None
var _double = 1.2D; // double? | None
var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None
var _byte = BYTE_ARRAY_DATA_HERE; // byte[] | None
var integer = 56; // int? | None (optional)
var int32 = 56; // int? | None (optional)
var int64 = 789; // long? | None (optional)
var _float = 3.4; // float? | None (optional)
var _float = 3.4F; // float? | None (optional)
var _string = _string_example; // string | None (optional)
var binary = BINARY_DATA_HERE; // System.IO.Stream | None (optional)
var date = 2013-10-20; // DateTime? | None (optional)
@@ -554,7 +554,7 @@ namespace Example
var enumQueryStringArray = enumQueryStringArray_example; // List<string> | Query parameter enum test (string array) (optional)
var enumQueryString = enumQueryString_example; // string | Query parameter enum test (string) (optional) (default to -efg)
var enumQueryInteger = 56; // int? | Query parameter enum test (double) (optional)
var enumQueryDouble = 1.2; // double? | Query parameter enum test (double) (optional)
var enumQueryDouble = 1.2D; // double? | Query parameter enum test (double) (optional)
var enumFormStringArray = new List<string>(); // List<string> | Form parameter enum test (string array) (optional) (default to $)
var enumFormString = enumFormString_example; // string | Form parameter enum test (string) (optional) (default to -efg)
Oops, something went wrong.

0 comments on commit b64864f

Please sign in to comment.
You can’t perform that action at this time.