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

net.guerlab.spring.swagger2.autoconfigure.ResponseAdvisorPropertiesAutoconfigure Maven / Gradle / Ivy

There is a newer version: 2.1.5
Show newest version
package net.guerlab.spring.swagger2.autoconfigure;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Configuration;

import net.guerlab.spring.commons.properties.ResponseAdvisorProperties;

/**
 * @author guer
 *
 */
@Configuration
@ConditionalOnClass(ResponseAdvisorProperties.class)
public class ResponseAdvisorPropertiesAutoconfigure {

    @Autowired
    public void advisor(ResponseAdvisorProperties responseAdvisorProperties) {
        List excluded = responseAdvisorProperties.getExcluded();

        List list = excluded == null ? new ArrayList<>() : new ArrayList<>(excluded);
        list.add(Swagger2ControllerAutoConfigure.BASE_PATH);
        list.add("/swagger");
        list.add("/v2");
        list.add("/webjars/springfox-swagger-ui");

        responseAdvisorProperties.setExcluded(list);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy