Comments (16)
Confirming this as well.
from dropwizard-swagger.
Just for information: you can make the application (and dropwizard-swagger) run, by NOT using SwaggerBundle, but instead a ViewBundle class that extends ViewBundle, and override the method that returns the configuration for views.
Example:
// Add viewbundle with anon class
bootstrap.addBundle(new ViewBundle<MyConfiguration>()
{
@Override
public ImmutableMap<String, ImmutableMap<String, String>> getViewConfiguration(MyConfiguration myConf)
{
return myConf.getViewRendererConfiguration();
}
});
And, in you configuration.yml:
viewRendererConfiguration:
.ftl:
strict_syntax: yes
whitespace_stripping: yes
And, again, in ExampleConfiguration.java, you must add:
@NotNull
private ImmutableMap<String, ImmutableMap<String, String>> viewRendererConfiguration = ImmutableMap.of();
@JsonProperty("viewRendererConfiguration")
public ImmutableMap<String, ImmutableMap<String, String>> getViewRendererConfiguration() {
return viewRendererConfiguration;
}
@JsonProperty("viewRendererConfiguration")
public void setViewRendererConfiguration(Map<String, Map<String, String>> viewRendererConfiguration) {
ImmutableMap.Builder<String, ImmutableMap<String, String>> builder = ImmutableMap.builder();
for (Map.Entry<String, Map<String, String>> entry : viewRendererConfiguration.entrySet()) {
builder.put(entry.getKey(), ImmutableMap.copyOf(entry.getValue()));
}
this.viewRendererConfiguration = builder.build();
}
Hope this helps!
from dropwizard-swagger.
I have the same issue. What can I do to help get this working?
from dropwizard-swagger.
@danieljamesscott check my previous answer: #37 (comment)
from dropwizard-swagger.
Hi Carminexx,
I followed your post and did following changes -
1 - added snippet below in my application class in initialize method.
bootstrap.addBundle(new ViewBundle()
{
@OverRide
public ImmutableMap<String, ImmutableMap<String, String>> getViewConfiguration(ConferenceConfiguration myConf)
{
return myConf.getViewRendererConfiguration();
}
});
2 - added config in yml
3 - already there in my configuration class
I don't see the error anymore and can run the app fine. My issue is I do not see the swagger ui at http://localhost:8080/swagger
Can you please point me to missing link here?
from dropwizard-swagger.
I think this is a duplicate of #30
from dropwizard-swagger.
I made the necessary changes and created a pull request for Dropwizard v0.8.0 support.
from dropwizard-swagger.
@vultron81 nice 👍
from dropwizard-swagger.
@alph486 Maybe, but only from 0.8.0-rc2 and above. I used it with Dropwizard 0.8.0-rc1 and it worked, it broke only when I upgraded to 0.8.0. I don't know if the problem was also in 0.8.0-rc2/3/4.
@Dp1121 Have you checked the access log? It seems like a Jersey problem. How do you instantiate dropwizard-swagger in your main() ?
from dropwizard-swagger.
Thanks @vultron81 and @carminexx I am past the issue I was having.
from dropwizard-swagger.
Hi, I can't seem to use the workaround @carminexx provided. I followed the instructions and get the following when calling gradlew run
:
Exception in thread "main" java.util.ServiceConfigurationError: io.dropwizard.views.ViewRenderer: Provider io.dropwizard.views.freemarker.FreemarkerViewRenderer could not be instantiated
Any ideas?
from dropwizard-swagger.
@Dp1121 how did you fix your error? I am able to get my app to run now, but can't see anything at /swagger either.
from dropwizard-swagger.
@bdbull I had missed adding swaggerDropwizard.onRun(configuration, environment,"localhost"); to run method within application class. HTH
from dropwizard-swagger.
@Dp1121 That was it...thanks!!!
from dropwizard-swagger.
It's great to see all this interaction going on!
Just FYI I deployed a new release with version 0.6 that provides support for DW 0.8 (thanks to @thiagomoretto and @vultron81 for the help). The README has been updated accordingly.
from dropwizard-swagger.
Hi, I can't seem to use the workaround @carminexx provided. I followed the instructions and get the following when calling
gradlew run
:Exception in thread "main" java.util.ServiceConfigurationError: io.dropwizard.views.ViewRenderer: Provider io.dropwizard.views.freemarker.FreemarkerViewRenderer could not be instantiated
Any ideas?
How did you solve this issue?
from dropwizard-swagger.
Related Issues (20)
- Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version (>= 4.0.0) or downgrade your runtime to an older version (>= 2.0.0-beta.1) HOT 1
- NoSuchMethodError: org.apache.commons.lang3.StringUtils HOT 3
- Disable Try It Out Button
- API page stuck at fetching resource list http://localhost/api/swagger.json
- Multiple swagger related endpoints published
- Dropwizard with @Auth issues
- You need to provide an instance of SwaggerBundleConfiguration error while running the sample app provided in the swagger documentation
- Jakarta XML support HOT 1
- FR: Support for Dropwizard 3.0
- FR: Support for Dropwizard 4.0 HOT 1
- SwaggerBundleConfiguration schemes default
- 2.2 POM is broken in Maven Central HOT 1
- File button not showing up on swagger ui HOT 2
- SwaggerBundleConfig variables HOT 2
- Dropwizard 1.0.0 support HOT 1
- dropwizard-swagger doesn't work with dropwizard version 1.0.0 HOT 5
- Error while Running dropwizard-swagger HOT 1
- Value.Immutable classes
- Allow to define custom swagger path HOT 4
- swagger not running behind nginx. static context not loading
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dropwizard-swagger.