Forum Discussion

4411441's avatar
4411441
Occasional Visitor
5 years ago

Multiple generated clients in same app

I've inherited some code that includes a generated client using spring rest template.  It's failing to start as there are multiple rest template beans on our path.  In our handcrafted clients we qualify the beans such that they find the appropriate rest template, is there a way to do this with swagger-codegen?

 

I believe this is related to how the ApiClient is autowired through the constructor:

 

    @Autowired
    public ApiClient(RestTemplate restTemplate) {
        this.restTemplate = restTemplate;
        init();
    }

This will attempt to find a RestTemplate bean to wire in here, since we have many I'm guessing this needs to be qualified somehow?

No RepliesBe the first to reply