openapi-generator/samples/server/petstore/aspnetcore
Jim Schubert da6b57f3fc [aspnetcore] use default in model constructors, supports enums (#4573)
* [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
2017-01-18 16:43:12 +08:00
..
src/IO.Swagger [aspnetcore] use default in model constructors, supports enums (#4573) 2017-01-18 16:43:12 +08:00
.swagger-codegen-ignore [aspnetcore] Deprecating aspnet5 for aspnetcore 2016-10-16 21:22:34 -04:00
build.bat Remove Apache license from server stub generators (#4200) 2016-11-17 00:37:21 +08:00
build.sh Remove Apache license from server stub generators (#4200) 2016-11-17 00:37:21 +08:00
global.json [aspnetcore] use default in model constructors, supports enums (#4573) 2017-01-18 16:43:12 +08:00
IO.Swagger.sln [aspnetcore] use default in model constructors, supports enums (#4573) 2017-01-18 16:43:12 +08:00
NuGet.Config [aspnetcore] Deprecating aspnet5 for aspnetcore 2016-10-16 21:22:34 -04:00
README.md [aspnetcore] Deprecating aspnet5 for aspnetcore 2016-10-16 21:22:34 -04:00

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