mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 19:08:52 +00:00
da6b57f3fc
* [aspnetcore] Use default rather than null in ctor See original issue #3608 This adds same model constructor logic to aspnetcore as what was added to csharp generator by PR #4145. This doesn't include NancyFX because model construction relies more on object initialization in that generator. * [aspnetcore] ctor defaults + enum support This follows up to #4145, and modifies model constructors to use default(x) instead of initializing to nulls. default(x) works in all cases using intuitive default values it is intended to support. Example: csharp> public enum Color { RED = -1, BLUE = 0, GREEN } csharp> var color = default(Color) csharp> color BLUE In the above example, The default of BLUE=0 is expected. For nullable enums, this would be null as a default. The aspnetcore generated code is also updated to support enums and nested enums to account for changed to the petstore.yaml used to generate the sample. * [aspnetcore] Regenerate sample |
||
---|---|---|
.. | ||
src/IO.Swagger | ||
.swagger-codegen-ignore | ||
build.bat | ||
build.sh | ||
global.json | ||
IO.Swagger.sln | ||
NuGet.Config | ||
README.md |
IO.Swagger - ASP.NET Core 1.0 Server
This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key special-key
to test the authorization filters.
Run
Linux/OS X:
sh build.sh
Windows:
build.bat
Run in Docker
cd src/IO.Swagger
docker build -t IO.Swagger .
docker run -p 5000:5000 IO.Swagger