@ Bean @ ConditionalOnMissingBean ( name = "swaggerSpringfoxApiDocket" ) public Docket swaggerSpringfoxApiDocket ( List < SwaggerCustomizer > swaggerCustomizers , ObjectProvider < AlternateTypeRule [ ] > alternateTypeRules ) { log . debug ( STARTING_MESSAGE ) ; StopWatch watch = new StopWatch ( ) ; watch . start ( ) ; Docket docket = createDocket ( ) ; // Apply all SwaggerCustomizers orderly. swaggerCustomizers . forEach ( customizer -> customizer . customize ( docket ) ) ; // Add all AlternateTypeRules if available in spring bean factory. // Also you can add your rules in a customizer bean above. Optional . ofNullable ( alternateTypeRules . getIfAvailable ( ) ) . ifPresent ( docket :: alternateTypeRules ) ; watch . stop ( ) ; log . debug ( STARTED_MESSAGE , watch . getTotalTimeMillis ( ) ) ; return docket ; }
Springfox configuration for the API Swagger docs .