stoicflame / enunciate-openapi

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

java.lang.IllegalStateException: Do not know how to pass type formdata #25

Open SKalt opened 4 years ago

SKalt commented 4 years ago

Expected behavior: enunciate-openapi should recognize and encode formdata parameters as described in the OpeAPI 3.0.0 spec, "special considerations for multipart content" section.

Actual behavior: enunciate-openapi throws an error when it encounters a param of type formdata.

Debug info If I run `mvn enunciate:docs` in [this repo](https://github.com/SKalt/OpenTripPlanner/tree/d4006ca5f0d8a90267235d6756ff1363b67649fb), I'll get an error at `Param.java:73` [[link @ master](https://github.com/Jyskebank/enunciate-openapi/blob/master/src/main/java/dk/jyskebank/tools/enunciate/modules/openapi/paths/Param.java#L73)] [[@ 70bd54af](https://github.com/Jyskebank/enunciate-openapi/blob/70bd54afadc281358e40ff1904d124f5a5ae714d/src/main/java/dk/jyskebank/tools/enunciate/modules/openapi/paths/Param.java#L73)]. Here's the relevant part of the stack trace. ``` # ... snip ... Caused by: java.lang.IllegalStateException: Do not know how to pass type formdata at dk.jyskebank.tools.enunciate.modules.openapi.paths.Param. (Param.java:73) at dk.jyskebank.tools.enunciate.modules.openapi.paths.Operation. (Operation.java:66) at dk.jyskebank.tools.enunciate.modules.openapi.paths.Endpoint. (Endpoint.java:44) at dk.jyskebank.tools.enunciate.modules.openapi.paths.Paths. (Paths.java:44) at dk.jyskebank.tools.enunciate.modules.openapi.OpenApiModule$OpenApiInterfaceDescription.writeToFolder (OpenApiModule.java:212) 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:980) at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs (JavacProcessingEnvironment.java:896) at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run (JavacProcessingEnvironment.java:1222) at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing (JavacProcessingEnvironment.java:1334) at com.sun.tools.javac.main.JavaCompiler.processAnnotations (JavaCompiler.java:1258) at com.sun.tools.javac.main.JavaCompiler.compile (JavaCompiler.java:936) # ... snip ... ```
jskov-jyskebank-dk commented 4 years ago

Hi there. Just letting you know I am aware of the issues you created. FYI I will try to get the docs updated (the other issue), but I am unlikely to spend time on fixing this bug.

SKalt commented 4 years ago

hey, thanks for replying!

I am unlikely to spend time on fixing this bug.

Understandable since (1) this is open source but also (2) since this bug seems isolated. I was able to generate an openapi.yml in the above repo by excluding one API class which used org.glassfish.jersey.media.multipart.FormDataParam [permalink to that line].

FYI I will try to get the docs updated (the other issue)

No rush. LMK when you start; I'll let you know if I free up and feel like drafting the documentation. I should be busy for the next 3 weeks, so no guarantees.

Ryan-Gordon1 commented 3 years ago

I am now experiencing this issue also, was excluding the FormDataParam class the recommended way to work around this?