forked from loafle/openapi-generator-original
[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:
committed by
wing328
parent
c9182ba00f
commit
7cc20cbeba
@@ -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
|
||||
|
||||
/**
|
||||
|
||||
@@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user