Re: inflector + codegen + spring

2017-02-21 Thread tony tam
Hi, thanks for the follow-up. Could you please add some notes to the README in a pull request so others can refer to it? > On Feb 21, 2017, at 1:02 AM, Abdullah Mourad wrote: > > For posterity's sake: > > I ended up solving this by creating a separate context holder class which > implemented

Re: inflector + codegen + spring

2017-02-21 Thread Abdullah Mourad
For posterity's sake: I ended up solving this by creating a separate context holder class which implemented ApplicationContextAware and had a static method which would return the application context. I ended up just calling that static method to get my spring loaded application context and then

Re: inflector + codegen + spring

2017-02-20 Thread Abdullah Mourad
Thanks, Tony! Thanks to your tip, I was able to use my own ControllerFactory by setting controllerFactoryClass in inflector.yaml. I also made it implement ApplicationContextAware and wired in my ApplicationContext successfully. However, Inflector also tries to instantiate my controllerFacotry i

Re: inflector + codegen + spring

2017-02-16 Thread tony tam
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

Re: inflector + codegen + spring

2017-02-15 Thread Abdullah Mourad
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 no

inflector + codegen + spring

2017-02-15 Thread Abdullah Mourad
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?