Open stemar87 opened 7 years ago
How about attaching stacktrace...?
Sorry, did the report in a rush on the train and forgot the most important thing :/ Here it is, although I'm afraid it isn't of much help...
FYI omitted trace is simply the call to beanConfig.setScan(true);
in my implementation.
Exception in thread "main" java.lang.NullPointerException
at io.swagger.jaxrs.config.BeanConfig.classes(BeanConfig.java:304)
at io.swagger.jaxrs.config.BeanConfig.scanAndRead(BeanConfig.java:240)
at io.swagger.jaxrs.config.BeanConfig.setScan(BeanConfig.java:221)
PS: I edited the original post which contained an inconsistency in registered package names.
Hi everybody, as the title suggests I experience a NPE while using
BeanConfig
for generating Swagger documentation for a Jersey project I'm developing. Notice: I browsed through both open/closed issues but found no solution in my specific setting.In particular, my setting and workflow followed are as follows (please, do not hesitate to ask for further clarification if I am missing anything):
I followed the documentation at https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-Jersey-2.X-Project-Setup-1.5
also, I do not have any
web.xml
norApplication
subclassResourceConfig
, which should offer the same functionalitiesMy only (atm) REST resource is annotated with (dummy fields for hiding details)
and lives in package
fake.package.path
In the above configuration I get the mentioned exception.
FYI, I tried a few changes based on open/closed issues found on Github issue tracker for Swagger core:
based on https://github.com/swagger-api/swagger-core/issues/927
ServletContainer
based on https://stackoverflow.com/questions/33681371/swagger-documentation-with-jax-rs-jersey-2-and-grizzly
but none of them worked.
Also fyi, it is worth mentioning that besides the exception stack trace I get no log messages whatsoever indicating that Swagger is doing anything. BUT, if I add the following dependencies to my Gradle build script
I get the following log line (without changing anything else)
Any idea of what I am doing wrong?
:)