Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
SKalt opened this issue Mar 1, 2020 · 3 comments
Open

Comments

@SKalt
Copy link
Contributor

SKalt commented Mar 1, 2020

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, I'll get an error at Param.java:73 [link @ master] [@ 70bd54af].

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.<init> (Param.java:73)
    at dk.jyskebank.tools.enunciate.modules.openapi.paths.Operation.<init> (Operation.java:66)
    at dk.jyskebank.tools.enunciate.modules.openapi.paths.Endpoint.<init> (Endpoint.java:44)
    at dk.jyskebank.tools.enunciate.modules.openapi.paths.Paths.<init> (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 ...
@SKalt SKalt changed the title Do not know how to pass type formdata java.lang.IllegalStateException: Do not know how to pass type formdata Mar 1, 2020
@jskov-jyskebank-dk
Copy link
Collaborator

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
Copy link
Contributor Author

SKalt commented Mar 11, 2020

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants