Skip to content

Commit

Permalink
[JPA] Correction génération multipart
Browse files Browse the repository at this point in the history
  • Loading branch information
gideruette committed Nov 7, 2023
1 parent 7498ff6 commit 72a5c3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions TopModel.Generator.Jpa/SpringServerApiGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ private void WriteEndpoint(JavaWriter fw, Endpoint endpoint, string tag)

if (endpoint.IsMultipart)
{
foreach (var param in endpoint.Params.Where(param => param is CompositionProperty || param is IFieldProperty { Domain.BodyParam: true }))
foreach (var param in endpoint.Params.Where(param => param is CompositionProperty || (param.Domain?.BodyParam ?? false) || (param.Domain?.IsMultipart ?? false)))
{
var ann = string.Empty;
if (param.Domain.MediaType != "multipart/form-data")
if (!(param.Domain?.IsMultipart ?? false))
{
ann += @$"@ModelAttribute ";
fw.AddImport("org.springframework.web.bind.annotation.ModelAttribute");
Expand Down

0 comments on commit 72a5c3c

Please sign in to comment.