[C#][aspnetcore] Improve generated code (#5257)

* Migrate from Swashbuckle to Swashbuckle.AspNetCore

* Fix typo

* Add SwaggerResponse for all responses

* Remove model constructor

* Add required attribute if available

* Improve whitespace and remove some redundant code

* Remove redundant code from Dockerfile

* Add disable warning 1591 pragma for model utility methods for bringing down compiler warnings to zero

* Add proper model state validation before controller is called

* Regenerate AspNetCore PetStore sample
This commit is contained in:
Sebastian Mandrean
2017-03-30 16:58:25 +02:00
committed by wing328
parent c9182ba00f
commit 7cc20cbeba
28 changed files with 525 additions and 592 deletions

View File

@@ -35,7 +35,7 @@ public class CodegenOperation {
public ExternalDocs externalDocs;
public Map<String, Object> vendorExtensions;
public String nickname; // legacy support
public String operationIdLowerCase; // for mardown documentation
public String operationIdLowerCase; // for markdown documentation
public String operationIdCamelCase; // for class names
/**

View File

@@ -114,6 +114,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
supportingFiles.add(new SupportingFile("project.json.mustache", packageFolder, "project.json"));
supportingFiles.add(new SupportingFile("Startup.mustache", packageFolder, "Startup.cs"));
supportingFiles.add(new SupportingFile("Program.mustache", packageFolder, "Program.cs"));
supportingFiles.add(new SupportingFile("validateModel.mustache", packageFolder + File.separator + "Attributes", "ValidateModelStateAttribute.cs"));
supportingFiles.add(new SupportingFile("web.config", packageFolder, "web.config"));
supportingFiles.add(new SupportingFile("Project.xproj.mustache", packageFolder, this.packageName + ".xproj"));