In REST Upgrade Guide we can read that we need to add the @Inject (see “Add @Inject to the constructor of the resource and provider classes”), but it is unclear
if we need to do this despite we use Spring Java Config
if we need to write a Configuration for REST Services (or Macros) on Platform 7 as we do it for other services (components), although it is not necessary for previous versions
I can start the app with Confluence 9.0.3 without mentioning REST Services / Macros in the Spring Java Config Configuration. But maybe this is only by coincidence?
What is the correct way of using REST services on Platform 7 / Confluence 9 with Spring Java Config regarding the @Inject topic in the Upgrade Guide?
Hi! I didn’t have to do any REST Service migration, but I tested a simple app using Confluence 9 and Spring Java Config, and nothing changed. On the other hand, @Inject should never be used, classes in Spring with a single constructor use that as default, and this is the recommended way of injecting beans.
It is helpful to know that @Inject does not apply when using Spring Java Config.
I have the REST services configured via Spring Java Config and this seems to be required. Otherwise I could deploy the app successfully, but get an error when I actually use the REST service.
I do not provide injection for macros the same way, but maybe I should?
It would be helpful if there was some official documentation that would make clear, what we need to cover in the configuration classes of Spring Java Config.
It seems that if REST services work by configuring it with Spring Java Config (as I do to do injection for all other components/services).
But since I register REST Services and Macros in the atlassian-plugin.xml, it is just not clear to me, what Confluence expects when I use Spring Java Config and REST v2 on Platform 7. Do macros still work without extra configuration in Spring Java Config because of some backward-compatibility layer I am using, but not aware of? Does it harm if I configure REST Services with Spring Java Config because on some weird configuration (I am using or will be using on the next Confluence upgrade ) registers the services twice?
I just would hope that there is some documentation (besides REST Upgrade Guide and the sample project with Spring Java Config and REST v1 or REST v2 and Spring Scanner) for developers that specifies what to do. I assume there is one, but I just cannot find it … links from the REST Upgrade Guide to that information would be helpful, at least for me …