0

I am using springdoc with maven.

It's working just fine and displays any controller defined in my own application. But when i import a maven dependancy defining a controller (annoted with @RestController):

  • I can use this controller by directy calling it.
  • BUT the /v3/api-docs only shows the controller defined in my own application and not the imported one.

I tried to play with the springdoc.packagesToScan property but without effect.

I also tried without success the folowing code:

static { 
       SpringDocUtils.getConfig().addRestControllers(ProcessInstanceCollectionResource.class);
    }

Is there a way to expose this imported controller?

if needed, the imported controller is the flowable REST api :

@RestController
@Api(tags = { "Process Instances" }, description = "Manage Process Instances", authorizations = { @Authorization(value = "basicAuth") })
 public class ProcessInstanceCollectionResource extends BaseProcessInstanceResource {

defined by

       <dependency>
            <groupId>org.flowable</groupId>
            <artifactId>flowable-spring-boot-starter-rest</artifactId>
            <version>${flowable.version}</version>
        </dependency>
Marc
  • 174
  • 4
  • 12

1 Answers1

0

Actually, we need to add an @ComponentScan annotation

@ComponentScan(basePackages = "org.flowable.rest.service.api")

Full solution: (cf. https://forum.flowable.org/t/flowable-and-swagger/2177/8 ) (need to add the restResponseFactory bean to satisfy a dependancy)

   @Configuration
    @ComponentScan(basePackages = "org.flowable.rest.service.api")
   public class SwaggerDocumentationConfig {
    @Autowired
    protected ObjectMapper objectMapper;    
     @Bean()
     public RestResponseFactory restResponseFactory() {
        RestResponseFactory restResponseFactory = new RestResponseFactory(objectMapper);
        return restResponseFactory;
    }
}
Marc
  • 174
  • 4
  • 12