1
如何從jhipster SwaggerConfiguration覆蓋Docket bean?我需要爲我的api添加自定義Docket :: directModelSubstitute。覆蓋JH4.x中的SwaggerConfiguration
如何從jhipster SwaggerConfiguration覆蓋Docket bean?我需要爲我的api添加自定義Docket :: directModelSubstitute。覆蓋JH4.x中的SwaggerConfiguration
要覆蓋SwaggerConfiguration我添加SwaggerConfig類,我的項目配置/擴展SwaggerConfiguration apidocs和@Override的swaggerSpringfoxDocket豆
@Configuration
public class SwaggerConfig extends SwaggerConfiguration {
private final Logger log = LoggerFactory.getLogger(SwaggerConfig.class);
@Bean
@Override
public Docket swaggerSpringfoxDocket(JHipsterProperties jHipsterProperties) {
終於在App.java
@EnableAutoConfiguration(exclude = {MetricFilterAutoConfiguration.class, MetricRepositoryAutoConfiguration.class, SwaggerConfiguration.class})
添加SwaggerConfiguration到排除的@EnableAutoConfiguration
如果SwaggerConfiguration對於swaggerSpringfoxDocket bean有@ConditionalOnMissingBean,那將會容易得多。