heaphach
heaphach

Reputation: 1492

Dropwizard 0.8.0 WADL support

Wadl can be configured in Dropwizard 0.7.1 like this:

environment
        .jersey()
        .getResourceConfig()
        .getProperties()
        .put(ResourceConfig.FEATURE_DISABLE_WADL, Boolean.FALSE);//Create WADL

How can I set it in Dropwizard 0.8.0

Upvotes: 3

Views: 1137

Answers (2)

Valeriy
Valeriy

Reputation: 79

import org.glassfish.jersey.server.ServerProperties;
...
environment.jersey().disable(ServerProperties.WADL_FEATURE_DISABLE);

Upvotes: 1

condit
condit

Reputation: 10962

The location of the property key has changed and the map is unmodifiable - so you'll need to use the addProperties method instead:

import org.glassfish.jersey.server.ServerProperties;
...
Map<String, Object> properties = new HashMap<>();
properties.put(ServerProperties.WADL_FEATURE_DISABLE, false);
environment.jersey().getResourceConfig().addProperties(properties);

And as of 0.8.0 Dropwizard is disabling WADL generation so you'll need to turn it on explicitly.

Upvotes: 8

Related Questions