I believe you can implement your own ControllerFactory to do this.  See here:

https://github.com/swagger-api/swagger-inflector/blob/master/src/main/java/io/swagger/inflector/config/ControllerFactory.java
 
<https://github.com/swagger-api/swagger-inflector/blob/master/src/main/java/io/swagger/inflector/config/ControllerFactory.java>

> On Feb 15, 2017, at 5:16 PM, Abdullah Mourad <[email protected]> wrote:
> 
> To clarify, my initial instance that is created by spring is created 
> correctly, but it appears that inflector creates a new instance for each 
> operation - In this case my controller has 2 operations, so I end up with 3 
> separate instances of my controller. The 2 non-spring created instances do 
> not have the proper fields initialized (as expected since they are not 
> created via spring).
> 
> On Wednesday, February 15, 2017 at 5:14:16 PM UTC-8, Abdullah Mourad wrote:
> I am using codegen to generate my controllers and inflector to route to them. 
> I would like to use Spring to populate some managers in my controllers but 
> inflector creates a new instance of the controller each time and those don't 
> get the managers injected properly. Is there any way around this? Is it 
> possible to use a single instance of my controller?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Swagger" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to