Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 4 additions & 22 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>io.federecio</groupId>
<artifactId>dropwizard-swagger</artifactId>
<version>0.7.1-SNAPSHOT</version>
<version>0.8.0-SNAPSHOT</version>

<name>Dropwizard Swagger support</name>
<description>A simple way to document your REST APIs in DropWizard using Swagger</description>
Expand Down Expand Up @@ -47,11 +47,11 @@
</scm>

<properties>
<dropwizard.version>0.8.0</dropwizard.version>
<dropwizard.version>1.0.0</dropwizard.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<file.encoding>UTF-8</file.encoding>
<jdk.version>1.7</jdk.version>
<jdk.version>1.8</jdk.version>
<swagger.version>1.5.1-M2</swagger.version>
</properties>

Expand Down Expand Up @@ -176,7 +176,7 @@
<dependency>
<groupId>io.federecio</groupId>
<artifactId>dropwizard-junit</artifactId>
<version>0.6</version>
<version>0.7</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -277,24 +277,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.3.1</version>
<executions>
<execution>
<id>enforce</id>
<configuration>
<rules>
<DependencyConvergence />
</rules>
</configuration>
<goals>
<goal>enforce</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import io.dropwizard.server.ServerFactory;
import io.dropwizard.server.SimpleServerFactory;

import java.util.Optional;

/**
* Wrapper around Dropwizard's configuration and the bundle's config that simplifies getting some
* information from them.
Expand All @@ -43,7 +45,7 @@ public String getJerseyRootPath() {
return swaggerBundleConfiguration.getUriPrefix();
}

String rootPath;
Optional<String> rootPath;

ServerFactory serverFactory = configuration.getServerFactory();

Expand All @@ -53,7 +55,9 @@ public String getJerseyRootPath() {
rootPath = ((DefaultServerFactory) serverFactory).getJerseyRootPath();
}

return stripUrlSlashes(rootPath);
String rootPathOrNull = rootPath.orElse(null);

return stripUrlSlashes(rootPathOrNull);
}

public String getUrlPattern() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,19 @@
package io.federecio.dropwizard.swagger;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.google.common.collect.ImmutableMap;
import com.wordnik.swagger.jaxrs.config.BeanConfig;
import com.wordnik.swagger.jaxrs.listing.ApiListingResource;

import io.dropwizard.Configuration;
import io.dropwizard.ConfiguredBundle;
import io.dropwizard.assets.AssetsBundle;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;
import io.dropwizard.views.ViewBundle;

import java.util.HashMap;
import java.util.Map;

/**
* A {@link io.dropwizard.ConfiguredBundle} that provides hassle-free configuration of Swagger and Swagger UI
* on top of Dropwizard.
Expand All @@ -40,8 +43,8 @@ public abstract class SwaggerBundle<T extends Configuration> implements Configur
public void initialize(Bootstrap<?> bootstrap) {
bootstrap.addBundle(new ViewBundle<Configuration>() {
@Override
public ImmutableMap<String, ImmutableMap<String, String>> getViewConfiguration(final Configuration configuration) {
return ImmutableMap.of();
public Map<String, Map<String, String>> getViewConfiguration(final Configuration configuration) {
return new HashMap<>();
}
});
}
Expand Down