From 650aaa2bee2bf32d056e8357cac3626707bae565 Mon Sep 17 00:00:00 2001 From: Blackclaws Date: Wed, 24 Mar 2021 05:33:17 +0100 Subject: [PATCH] Fix FromForm for complex parameters (#9040) --- .../src/main/resources/aspnetcore/3.0/formParam.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/formParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/formParam.mustache index 7c9085c62df..f0b9d704280 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/formParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/formParam.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isBinary}}[FromForm (Name = "{{baseName}}")]{{/isBinary}}{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isBinary}}[FromForm{{^isModel}} (Name = "{{baseName}}"){{/isModel}}]{{/isBinary}}{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isFormParam}} \ No newline at end of file