jersey-2.0dropwizardwadl

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


Solution

  • 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.