stoicflame / enunciate-openapi

OpenAPI3 module for Enunciate
Apache License 2.0
10 stars 10 forks source link

Support for `@RequestPart` #26

Open soberich opened 4 years ago

soberich commented 4 years ago

Hi, Currently @RequestPart("fileContent") MultipartFile fileContent in parameters fails with stackstace..

Enunciate has literal "file" for such type and it is not listed in switch expression there.

Caused by: java.lang.IllegalStateException: Called with unhandled type file
    at dk.jyskebank.tools.enunciate.modules.openapi.OpenApiTypeFormat.toEnunciateType (OpenApiTypeFormat.java:115)
    at dk.jyskebank.tools.enunciate.modules.openapi.OpenApiTypeFormat.from (OpenApiTypeFormat.java:78)
    at dk.jyskebank.tools.enunciate.modules.openapi.DataTypeReferenceRenderer.renderType (DataTypeReferenceRenderer.java:147)
    at dk.jyskebank.tools.enunciate.modules.openapi.paths.ParameterRenderer.addType (ParameterRenderer.java:61)
    at dk.jyskebank.tools.enunciate.modules.openapi.paths.ParameterRenderer.exec (ParameterRenderer.java:48)
    at dk.jyskebank.tools.enunciate.modules.openapi.paths.ParameterRenderer.exec (ParameterRenderer.java:29)
    at dk.jyskebank.tools.enunciate.modules.freemarker.Typed1ArgTemplateMethod.exec (Typed1ArgTemplateMethod.java:41)
    at freemarker.core.MethodCall._eval (MethodCall.java:62)
    at freemarker.core.Expression.eval (Expression.java:101)
    at freemarker.core.DollarVariable.calculateInterpolatedStringOrMarkup (DollarVariable.java:100)
    at freemarker.core.DollarVariable.accept (DollarVariable.java:63)
    at freemarker.core.Environment.visit (Environment.java:370)
    at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing (IteratorBlock.java:321)
    at freemarker.core.IteratorBlock$IterationContext.executeNestedContent (IteratorBlock.java:271)
    at freemarker.core.IteratorBlock$IterationContext.accept (IteratorBlock.java:244)
    at freemarker.core.Environment.visitIteratorBlock (Environment.java:644)
    at freemarker.core.IteratorBlock.acceptWithResult (IteratorBlock.java:108)
    at freemarker.core.IteratorBlock.accept (IteratorBlock.java:94)
    at freemarker.core.Environment.visit (Environment.java:334)
    at freemarker.core.Environment.visit (Environment.java:376)
    at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing (IteratorBlock.java:321)
    at freemarker.core.IteratorBlock$IterationContext.executeNestedContent (IteratorBlock.java:271)
    at freemarker.core.IteratorBlock$IterationContext.accept (IteratorBlock.java:244)
    at freemarker.core.Environment.visitIteratorBlock (Environment.java:644)
    at freemarker.core.IteratorBlock.acceptWithResult (IteratorBlock.java:108)
    at freemarker.core.IteratorBlock.accept (IteratorBlock.java:94)
    at freemarker.core.Environment.visit (Environment.java:370)
    at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing (IteratorBlock.java:321)
    at freemarker.core.IteratorBlock$IterationContext.executeNestedContent (IteratorBlock.java:271)
    at freemarker.core.IteratorBlock$IterationContext.accept (IteratorBlock.java:244)
    at freemarker.core.Environment.visitIteratorBlock (Environment.java:644)
    at freemarker.core.IteratorBlock.acceptWithResult (IteratorBlock.java:108)
    at freemarker.core.IteratorBlock.accept (IteratorBlock.java:94)
    at freemarker.core.Environment.visit (Environment.java:334)
    at freemarker.core.Environment.visit (Environment.java:376)
    at freemarker.core.Environment$NestedElementTemplateDirectiveBody.render (Environment.java:3244)
    at com.webcohesion.enunciate.util.freemarker.FileDirective.execute (FileDirective.java:78)
    at freemarker.core.Environment.visit (Environment.java:451)
    at freemarker.core.UnifiedCall.accept (UnifiedCall.java:102)
    at freemarker.core.Environment.visit (Environment.java:334)
    at freemarker.core.Environment.visit (Environment.java:340)
    at freemarker.core.Environment.process (Environment.java:313)
    at freemarker.template.Template.process (Template.java:383)
    at dk.jyskebank.tools.enunciate.modules.openapi.OpenApiModule.processTemplate (OpenApiModule.java:300)
    at dk.jyskebank.tools.enunciate.modules.openapi.OpenApiModule$OpenApiInterfaceDescription.writeToFolder (OpenApiModule.java:220)
    at dk.jyskebank.tools.enunciate.modules.openapi.OpenApiModule.call (OpenApiModule.java:146)
    at com.webcohesion.enunciate.Enunciate.invokeModules (Enunciate.java:898)
    at com.webcohesion.enunciate.EnunciateAnnotationProcessor.process (EnunciateAnnotationProcessor.java:127)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor (JavacProcessingEnvironment.java:802)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs (JavacProcessingEnvironment.java:713)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800 (JavacProcessingEnvironment.java:91)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run (JavacProcessingEnvironment.java:1043)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing (JavacProcessingEnvironment.java:1184)
    at com.sun.tools.javac.main.JavaCompiler.processAnnotations (JavaCompiler.java:1170)
    at com.sun.tools.javac.main.JavaCompiler.compile (JavaCompiler.java:856)
    at com.sun.tools.javac.main.Main.compile (Main.java:523)
    at com.sun.tools.javac.api.JavacTaskImpl.doCall (JavacTaskImpl.java:129)
    at com.sun.tools.javac.api.JavacTaskImpl.call (JavacTaskImpl.java:138)
    at com.webcohesion.enunciate.Enunciate.run (Enunciate.java:671)
    at com.webcohesion.enunciate.mojo.ConfigMojo.execute (ConfigMojo.java:436)
    at com.webcohesion.enunciate.mojo.AssembleBaseMojo.execute (AssembleBaseMojo.java:102)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:190)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:186)
    at java.util.concurrent.FutureTask.run (FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:511)
    at java.util.concurrent.FutureTask.run (FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)
    at java.lang.Thread.run (Thread.java:748)