All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.paradoxical.dropwizard.swagger.EnvironmentSwaggerConfiguration Maven / Gradle / Ivy

There is a newer version: 2.4
Show newest version
package io.paradoxical.dropwizard.swagger;

import io.dropwizard.jetty.MutableServletContextHandler;
import io.dropwizard.setup.Environment;
import lombok.AccessLevel;
import lombok.Getter;

import javax.annotation.Nullable;
import java.util.function.Function;

public abstract class EnvironmentSwaggerConfiguration extends SwaggerConfiguration {

    @Getter(AccessLevel.PROTECTED)
    private final Environment environment;

    protected EnvironmentSwaggerConfiguration(
        @Nullable final Environment environment,
        final Function contextSelector) {

        this.environment = environment;

        if (environment != null) {
            setBasePath(contextSelector.apply(environment).getContextPath());
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy